Unverified Commit 731ed1b1 authored by Mikkel Nygaard Ravn's avatar Mikkel Nygaard Ravn Committed by GitHub

Make flutter.gradle support Flutter used as lib (#16300)

parent 2134adce
......@@ -289,7 +289,7 @@ class FlutterPlugin implements Plugin<Project> {
targetPlatformValue = project.property('target-platform')
}
project.android.applicationVariants.all { variant ->
def addFlutterDeps = { variant ->
String flutterBuildMode = buildModeFor(variant.buildType)
if (flutterBuildMode == 'debug' && project.tasks.findByName('flutterBuildX86Jar')) {
Task task = project.tasks.findByName("compile${variant.name.capitalize()}JavaWithJavac")
......@@ -350,6 +350,11 @@ class FlutterPlugin implements Plugin<Project> {
}
variant.outputs[0].processResources.dependsOn(copyFlxTask)
}
if (project.android.hasProperty("applicationVariants")) {
project.android.applicationVariants.all addFlutterDeps
} else {
project.android.libraryVariants.all 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