Unverified Commit 3cee8e0e authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] include depfile outputs in gradle outputs (#50877)

parent 2f09d601
......@@ -891,13 +891,13 @@ class FlutterTask extends BaseFlutterTask {
}
}
FileCollection readDependencies(File dependenciesFile) {
FileCollection readDependencies(File dependenciesFile, Boolean inputs) {
if (dependenciesFile.exists()) {
// Dependencies file has Makefile syntax:
// <target> <files>: <source> <files> <separated> <by> <non-escaped space>
String depText = dependenciesFile.text
// So we split list of files by non-escaped(by backslash) space,
def matcher = depText.split(': ')[1] =~ /(\\ |[^\s])+/
def matcher = depText.split(': ')[inputs ? 1 : 0] =~ /(\\ |[^\s])+/
// then we replace all escaped spaces with regular spaces
def depList = matcher.collect{it[0].replaceAll("\\\\ ", " ")}
return project.files(depList)
......@@ -909,11 +909,20 @@ class FlutterTask extends BaseFlutterTask {
FileCollection getSourceFiles() {
FileCollection sources = project.files()
for (File depfile in getDependenciesFiles()) {
sources += readDependencies(depfile)
sources += readDependencies(depfile, true)
}
return sources + project.files('pubspec.yaml')
}
@OutputFiles
FileCollection getOutputFiles() {
FileCollection sources = project.files()
for (File depfile in getDependenciesFiles()) {
sources += readDependencies(depfile, false)
}
return sources
}
@TaskAction
void build() {
buildBundle()
......
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