Add embedding as API dependency instead of compile only dependency (#41142)

This commit is contained in:
Emmanuel Garcia
2019-09-25 17:59:17 -07:00
committed by GitHub
parent ab8cf94778
commit 975e770e13
15 changed files with 359 additions and 22 deletions

View File

@@ -332,9 +332,11 @@ class FlutterPlugin implements Plugin<Project> {
}
Closure addEmbeddingCompileOnlyDependency = { buildType ->
String flutterBuildMode = buildModeFor(buildType)
// Add the embedding as a compile only dependency to the plugin.
// In AGP 3.5, the embedding must be added as an API implementation,
// so java8 features are desugared against the runtime classpath.
// For more, see https://github.com/flutter/flutter/issues/40126
if (flutterJar) {
addCompileOnlyDependency(
addApiDependencies(
pluginProject,
buildType.name,
project.files {
@@ -343,7 +345,7 @@ class FlutterPlugin implements Plugin<Project> {
)
return
}
addCompileOnlyDependency(
addApiDependencies(
pluginProject,
buildType.name,
"io.flutter:flutter_embedding_$flutterBuildMode:1.0.0-$engineVersion",