Unverified Commit 4fc5048e authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

gradle: add a dependency on the task that generates the x86 jar instead of the jar file (#21466)

parent 358822e6
...@@ -152,7 +152,7 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -152,7 +152,7 @@ class FlutterPlugin implements Plugin<Project> {
// Add x86/x86_64 native library. Debug mode only, for now. // Add x86/x86_64 native library. Debug mode only, for now.
flutterX86Jar = project.file("${project.buildDir}/${AndroidProject.FD_INTERMEDIATES}/flutter/flutter-x86.jar") flutterX86Jar = project.file("${project.buildDir}/${AndroidProject.FD_INTERMEDIATES}/flutter/flutter-x86.jar")
project.tasks.create("flutterBuildX86Jar", Jar) { Task flutterX86JarTask = project.tasks.create("flutterBuildX86Jar", Jar) {
destinationDir flutterX86Jar.parentFile destinationDir flutterX86Jar.parentFile
archiveName flutterX86Jar.name archiveName flutterX86Jar.name
from("${flutterRoot}/bin/cache/artifacts/engine/android-x86/libflutter.so") { from("${flutterRoot}/bin/cache/artifacts/engine/android-x86/libflutter.so") {
...@@ -164,8 +164,8 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -164,8 +164,8 @@ class FlutterPlugin implements Plugin<Project> {
} }
// Add flutter.jar dependencies to all <buildType>Api configurations, including custom ones // Add flutter.jar dependencies to all <buildType>Api configurations, including custom ones
// added after applying the Flutter plugin. // added after applying the Flutter plugin.
project.android.buildTypes.each { addFlutterJarApiDependency(project, it) } project.android.buildTypes.each { addFlutterJarApiDependency(project, it, flutterX86JarTask) }
project.android.buildTypes.whenObjectAdded { addFlutterJarApiDependency(project, it) } project.android.buildTypes.whenObjectAdded { addFlutterJarApiDependency(project, it, flutterX86JarTask) }
} }
project.extensions.create("flutter", FlutterExtension) project.extensions.create("flutter", FlutterExtension)
...@@ -219,7 +219,7 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -219,7 +219,7 @@ class FlutterPlugin implements Plugin<Project> {
* *
* Note: The BuildType DSL type is not public, and is therefore omitted from the signature. * Note: The BuildType DSL type is not public, and is therefore omitted from the signature.
*/ */
private void addFlutterJarApiDependency(Project project, buildType) { private void addFlutterJarApiDependency(Project project, buildType, Task flutterX86JarTask) {
project.dependencies { project.dependencies {
String configuration; String configuration;
if (project.getConfigurations().findByName("api")) { if (project.getConfigurations().findByName("api")) {
...@@ -230,7 +230,7 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -230,7 +230,7 @@ class FlutterPlugin implements Plugin<Project> {
add(configuration, project.files { add(configuration, project.files {
String buildMode = buildModeFor(buildType) String buildMode = buildModeFor(buildType)
if (buildMode == "debug") { if (buildMode == "debug") {
[flutterX86Jar, debugFlutterJar] [flutterX86JarTask, debugFlutterJar]
} else if (buildMode == "profile") { } else if (buildMode == "profile") {
profileFlutterJar profileFlutterJar
} else if (buildMode == "dynamicProfile") { } else if (buildMode == "dynamicProfile") {
......
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