diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/config/config.go | 1 | ||||
-rw-r--r-- | java/java.go | 7 | ||||
-rw-r--r-- | java/java_test.go | 17 |
3 files changed, 16 insertions, 9 deletions
diff --git a/java/config/config.go b/java/config/config.go index d44315c5..4a74c7cb 100644 --- a/java/config/config.go +++ b/java/config/config.go @@ -30,6 +30,7 @@ var ( DefaultBootclasspathLibraries = []string{"core-oj", "core-libart"} DefaultSystemModules = "core-system-modules" DefaultLibraries = []string{"ext", "framework", "okhttp"} + DefaultLambdaStubsLibraries = []string{"core-lambda-stubs"} DefaultJacocoExcludeFilter = []string{"org.junit.*", "org.jacoco.*", "org.mockito.*"} diff --git a/java/java.go b/java/java.go index 02fdc00f..7abd2999 100644 --- a/java/java.go +++ b/java/java.go @@ -479,6 +479,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { sdkDep := decodeSdkDep(ctx, String(j.deviceProperties.Sdk_version)) if sdkDep.useDefaultLibs { ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultBootclasspathLibraries...) + ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultLambdaStubsLibraries...) if ctx.Config().TargetOpenJDK9() { ctx.AddDependency(ctx.Module(), systemModulesTag, config.DefaultSystemModules) } @@ -490,10 +491,13 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { ctx.AddDependency(ctx.Module(), systemModulesTag, sdkDep.systemModules) } ctx.AddDependency(ctx.Module(), bootClasspathTag, sdkDep.module) + ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultLambdaStubsLibraries...) if Bool(j.deviceProperties.Optimize.Enabled) { ctx.AddDependency(ctx.Module(), proguardRaiseTag, config.DefaultBootclasspathLibraries...) ctx.AddDependency(ctx.Module(), proguardRaiseTag, config.DefaultLibraries...) } + } else if sdkDep.useFiles { + ctx.AddDependency(ctx.Module(), libTag, config.DefaultLambdaStubsLibraries...) } } else if j.deviceProperties.System_modules == nil { ctx.PropertyErrorf("no_standard_libs", @@ -625,8 +629,9 @@ const ( func getLinkType(m *Module, name string) linkType { ver := String(m.deviceProperties.Sdk_version) + noStdLibs := Bool(m.properties.No_standard_libs) switch { - case name == "core.current.stubs" || ver == "core_current": + case name == "core.current.stubs" || ver == "core_current" || noStdLibs: return javaCore case name == "android_system_stubs_current" || strings.HasPrefix(ver, "system_"): return javaSystem diff --git a/java/java_test.go b/java/java_test.go index baf4b723..03a623bc 100644 --- a/java/java_test.go +++ b/java/java_test.go @@ -98,6 +98,7 @@ func testContext(config android.Config, bp string, extraModules := []string{ "core-oj", "core-libart", + "core-lambda-stubs", "framework", "ext", "okhttp", @@ -347,14 +348,14 @@ var classpathTestcases = []struct { }{ { name: "default", - bootclasspath: []string{"core-oj", "core-libart"}, + bootclasspath: []string{"core-oj", "core-libart", "core-lambda-stubs"}, system: "core-system-modules", classpath: []string{"ext", "framework", "okhttp"}, }, { name: "blank sdk version", properties: `sdk_version: "",`, - bootclasspath: []string{"core-oj", "core-libart"}, + bootclasspath: []string{"core-oj", "core-libart", "core-lambda-stubs"}, system: "core-system-modules", classpath: []string{"ext", "framework", "okhttp"}, }, @@ -364,20 +365,20 @@ var classpathTestcases = []struct { properties: `sdk_version: "14",`, bootclasspath: []string{`""`}, system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath - classpath: []string{"prebuilts/sdk/14/public/android.jar"}, + classpath: []string{"prebuilts/sdk/14/public/android.jar", "core-lambda-stubs"}, }, { name: "current", properties: `sdk_version: "current",`, - bootclasspath: []string{"android_stubs_current"}, + bootclasspath: []string{"android_stubs_current", "core-lambda-stubs"}, system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath }, { name: "system_current", properties: `sdk_version: "system_current",`, - bootclasspath: []string{"android_system_stubs_current"}, + bootclasspath: []string{"android_system_stubs_current", "core-lambda-stubs"}, system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath }, { @@ -386,20 +387,20 @@ var classpathTestcases = []struct { properties: `sdk_version: "system_14",`, bootclasspath: []string{`""`}, system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath - classpath: []string{"prebuilts/sdk/14/system/android.jar"}, + classpath: []string{"prebuilts/sdk/14/system/android.jar", "core-lambda-stubs"}, }, { name: "test_current", properties: `sdk_version: "test_current",`, - bootclasspath: []string{"android_test_stubs_current"}, + bootclasspath: []string{"android_test_stubs_current", "core-lambda-stubs"}, system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath }, { name: "core_current", properties: `sdk_version: "core_current",`, - bootclasspath: []string{"core.current.stubs"}, + bootclasspath: []string{"core.current.stubs", "core-lambda-stubs"}, system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath }, { |