Unverified Commit 383562a7 authored by Gray Mackall's avatar Gray Mackall Committed by GitHub

Declare dependency on copyFlutterAssetsTask in bundleAarTask (#137370)

Fixes https://github.com/flutter/flutter/issues/129471.

Does so by doing a very similar thing that is done by https://github.com/flutter/flutter/pull/121958, but for a task that is specific to the add to app build process.
parent 6f093b1d
......@@ -1130,12 +1130,19 @@ class FlutterPlugin implements Plugin<Project> {
variantOutput.processResourcesProvider.get() : variantOutput.processResources
processResources.dependsOn(copyFlutterAssetsTask)
}
// Task compressAssets uses the output of copyFlutterAssetsTask,
// so it's necessary to declare it as an dependency.
// The following tasks use the output of copyFlutterAssetsTask,
// so it's necessary to declare it as an dependency since Gradle 8.
// See https://docs.gradle.org/8.1/userguide/validation_problems.html#implicit_dependency.
def compressAssetsTask = project.tasks.findByName("compress${variant.name.capitalize()}Assets")
if (compressAssetsTask) {
compressAssetsTask.dependsOn copyFlutterAssetsTask
}
def bundleAarTask = project.tasks.findByName("bundle${variant.name.capitalize()}Aar")
if (bundleAarTask) {
bundleAarTask.dependsOn copyFlutterAssetsTask
}
return copyFlutterAssetsTask
} // end def addFlutterDeps
......
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