Unverified Commit 617e8f65 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Handle escaped spaces in deps-file. (#23249)

Fixes https://github.com/flutter/flutter/issues/23236
parent 82d65895
......@@ -581,9 +581,13 @@ class FlutterTask extends BaseFlutterTask {
if (dependenciesFile.exists()) {
try {
// Dependencies file has Makefile syntax:
// <target> <files>: <source> <files> <separated> <by> <space>
// <target> <files>: <source> <files> <separated> <by> <non-escaped space>
String depText = dependenciesFile.text
return project.files(depText.split(': ')[1].split())
// So we split list of files by non-escaped(by backslash) space,
def matcher = depText.split(': ')[1] =~ /(\\ |[^\s])+/
// then we remove all backslashes
def depList = matcher.collect{it[0].replaceAll("\\\\", "")}
return project.files(depList)
} catch (Exception e) {
logger.error("Error reading dependency file ${dependenciesFile}: ${e}")
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment