Merge "Revert "Add core-lambda-stubs to classpath""

This commit is contained in:
Treehugger Robot
2018-05-30 07:23:09 +00:00
committed by Gerrit Code Review
3 changed files with 9 additions and 16 deletions

View File

@@ -30,7 +30,6 @@ var (
DefaultBootclasspathLibraries = []string{"core-oj", "core-libart"} DefaultBootclasspathLibraries = []string{"core-oj", "core-libart"}
DefaultSystemModules = "core-system-modules" DefaultSystemModules = "core-system-modules"
DefaultLibraries = []string{"ext", "framework", "okhttp"} DefaultLibraries = []string{"ext", "framework", "okhttp"}
DefaultLambdaStubsLibraries = []string{"core-lambda-stubs"}
DefaultJacocoExcludeFilter = []string{"org.junit.*", "org.jacoco.*", "org.mockito.*"} DefaultJacocoExcludeFilter = []string{"org.junit.*", "org.jacoco.*", "org.mockito.*"}

View File

@@ -479,7 +479,6 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
sdkDep := decodeSdkDep(ctx, String(j.deviceProperties.Sdk_version)) sdkDep := decodeSdkDep(ctx, String(j.deviceProperties.Sdk_version))
if sdkDep.useDefaultLibs { if sdkDep.useDefaultLibs {
ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultBootclasspathLibraries...) ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultBootclasspathLibraries...)
ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultLambdaStubsLibraries...)
if ctx.Config().TargetOpenJDK9() { if ctx.Config().TargetOpenJDK9() {
ctx.AddDependency(ctx.Module(), systemModulesTag, config.DefaultSystemModules) ctx.AddDependency(ctx.Module(), systemModulesTag, config.DefaultSystemModules)
} }
@@ -491,13 +490,10 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) {
ctx.AddDependency(ctx.Module(), systemModulesTag, sdkDep.systemModules) ctx.AddDependency(ctx.Module(), systemModulesTag, sdkDep.systemModules)
} }
ctx.AddDependency(ctx.Module(), bootClasspathTag, sdkDep.module) ctx.AddDependency(ctx.Module(), bootClasspathTag, sdkDep.module)
ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultLambdaStubsLibraries...)
if Bool(j.deviceProperties.Optimize.Enabled) { if Bool(j.deviceProperties.Optimize.Enabled) {
ctx.AddDependency(ctx.Module(), proguardRaiseTag, config.DefaultBootclasspathLibraries...) ctx.AddDependency(ctx.Module(), proguardRaiseTag, config.DefaultBootclasspathLibraries...)
ctx.AddDependency(ctx.Module(), proguardRaiseTag, config.DefaultLibraries...) 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 { } else if j.deviceProperties.System_modules == nil {
ctx.PropertyErrorf("no_standard_libs", ctx.PropertyErrorf("no_standard_libs",
@@ -629,9 +625,8 @@ const (
func getLinkType(m *Module, name string) linkType { func getLinkType(m *Module, name string) linkType {
ver := String(m.deviceProperties.Sdk_version) ver := String(m.deviceProperties.Sdk_version)
noStdLibs := Bool(m.properties.No_standard_libs)
switch { switch {
case name == "core.current.stubs" || ver == "core_current" || noStdLibs: case name == "core.current.stubs" || ver == "core_current":
return javaCore return javaCore
case name == "android_system_stubs_current" || strings.HasPrefix(ver, "system_"): case name == "android_system_stubs_current" || strings.HasPrefix(ver, "system_"):
return javaSystem return javaSystem

View File

@@ -98,7 +98,6 @@ func testContext(config android.Config, bp string,
extraModules := []string{ extraModules := []string{
"core-oj", "core-oj",
"core-libart", "core-libart",
"core-lambda-stubs",
"framework", "framework",
"ext", "ext",
"okhttp", "okhttp",
@@ -348,14 +347,14 @@ var classpathTestcases = []struct {
}{ }{
{ {
name: "default", name: "default",
bootclasspath: []string{"core-oj", "core-libart", "core-lambda-stubs"}, bootclasspath: []string{"core-oj", "core-libart"},
system: "core-system-modules", system: "core-system-modules",
classpath: []string{"ext", "framework", "okhttp"}, classpath: []string{"ext", "framework", "okhttp"},
}, },
{ {
name: "blank sdk version", name: "blank sdk version",
properties: `sdk_version: "",`, properties: `sdk_version: "",`,
bootclasspath: []string{"core-oj", "core-libart", "core-lambda-stubs"}, bootclasspath: []string{"core-oj", "core-libart"},
system: "core-system-modules", system: "core-system-modules",
classpath: []string{"ext", "framework", "okhttp"}, classpath: []string{"ext", "framework", "okhttp"},
}, },
@@ -365,20 +364,20 @@ var classpathTestcases = []struct {
properties: `sdk_version: "14",`, properties: `sdk_version: "14",`,
bootclasspath: []string{`""`}, bootclasspath: []string{`""`},
system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
classpath: []string{"prebuilts/sdk/14/public/android.jar", "core-lambda-stubs"}, classpath: []string{"prebuilts/sdk/14/public/android.jar"},
}, },
{ {
name: "current", name: "current",
properties: `sdk_version: "current",`, properties: `sdk_version: "current",`,
bootclasspath: []string{"android_stubs_current", "core-lambda-stubs"}, bootclasspath: []string{"android_stubs_current"},
system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
}, },
{ {
name: "system_current", name: "system_current",
properties: `sdk_version: "system_current",`, properties: `sdk_version: "system_current",`,
bootclasspath: []string{"android_system_stubs_current", "core-lambda-stubs"}, bootclasspath: []string{"android_system_stubs_current"},
system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
}, },
{ {
@@ -387,20 +386,20 @@ var classpathTestcases = []struct {
properties: `sdk_version: "system_14",`, properties: `sdk_version: "system_14",`,
bootclasspath: []string{`""`}, bootclasspath: []string{`""`},
system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
classpath: []string{"prebuilts/sdk/14/system/android.jar", "core-lambda-stubs"}, classpath: []string{"prebuilts/sdk/14/system/android.jar"},
}, },
{ {
name: "test_current", name: "test_current",
properties: `sdk_version: "test_current",`, properties: `sdk_version: "test_current",`,
bootclasspath: []string{"android_test_stubs_current", "core-lambda-stubs"}, bootclasspath: []string{"android_test_stubs_current"},
system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
}, },
{ {
name: "core_current", name: "core_current",
properties: `sdk_version: "core_current",`, properties: `sdk_version: "core_current",`,
bootclasspath: []string{"core.current.stubs", "core-lambda-stubs"}, bootclasspath: []string{"core.current.stubs"},
system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath system: "bootclasspath", // special value to tell 1.9 test to expect bootclasspath
}, },
{ {