mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Handle escaped spaces in deps-file. (#23273)
This commit is contained in:
parent
6a3ff018b1
commit
dd789e645b
@ -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 replace all escaped spaces with regular spaces
|
||||
def depList = matcher.collect{it[0].replaceAll("\\\\ ", " ")}
|
||||
return project.files(depList)
|
||||
} catch (Exception e) {
|
||||
logger.error("Error reading dependency file ${dependenciesFile}: ${e}")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user