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> { ...@@ -1130,12 +1130,19 @@ class FlutterPlugin implements Plugin<Project> {
variantOutput.processResourcesProvider.get() : variantOutput.processResources variantOutput.processResourcesProvider.get() : variantOutput.processResources
processResources.dependsOn(copyFlutterAssetsTask) processResources.dependsOn(copyFlutterAssetsTask)
} }
// Task compressAssets uses the output of copyFlutterAssetsTask, // The following tasks use the output of copyFlutterAssetsTask,
// so it's necessary to declare it as an dependency. // 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") def compressAssetsTask = project.tasks.findByName("compress${variant.name.capitalize()}Assets")
if (compressAssetsTask) { if (compressAssetsTask) {
compressAssetsTask.dependsOn copyFlutterAssetsTask compressAssetsTask.dependsOn copyFlutterAssetsTask
} }
def bundleAarTask = project.tasks.findByName("bundle${variant.name.capitalize()}Aar")
if (bundleAarTask) {
bundleAarTask.dependsOn copyFlutterAssetsTask
}
return copyFlutterAssetsTask return copyFlutterAssetsTask
} // end def addFlutterDeps } // 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