From 12e311d95838051b5dd2cc2a963d9ff0cb5d7273 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 28 Oct 2021 17:42:16 +0100 Subject: [PATCH 1/4] Add tests for prebuilts of all API surfaces Previously, the tests only covered checking the sdk dependencies added when using a prebuilt current (public) and system SDKs, i.e. with sdk_version set to "current_30" or "system_30". This change adds tests to cover other APIs, e.g. "test_30", "module_30" and "system_server_30". It adds tests for "module" and "system-server" up to API level 32 as following changes will give them different behavior as API levels less than or equal to 31 do not have a separate core-for-system-modules.jar file for the module-lib API. Bug: 204189791 Test: m nothing Change-Id: I585a88615439a24abf75250114a86113b5f5da57 --- android/sdk_version.go | 2 +- java/sdk_test.go | 70 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/android/sdk_version.go b/android/sdk_version.go index c6c75a399..1813e7e14 100644 --- a/android/sdk_version.go +++ b/android/sdk_version.go @@ -157,7 +157,7 @@ func (s SdkSpec) UsePrebuilt(ctx EarlyModuleContext) bool { return ctx.Config().AlwaysUsePrebuiltSdks() } else if !s.ApiLevel.IsPreview() { // validation check - if s.Kind != SdkPublic && s.Kind != SdkSystem && s.Kind != SdkTest && s.Kind != SdkModule { + if s.Kind != SdkPublic && s.Kind != SdkSystem && s.Kind != SdkTest && s.Kind != SdkModule && s.Kind != SdkSystemServer { panic(fmt.Errorf("prebuilt SDK is not not available for SdkKind=%q", s.Kind)) return false } diff --git a/java/sdk_test.go b/java/sdk_test.go index 6d6213011..28b962432 100644 --- a/java/sdk_test.go +++ b/java/sdk_test.go @@ -128,7 +128,6 @@ func TestClasspath(t *testing.T) { aidl: "-pprebuilts/sdk/30/public/framework.aidl", }, { - name: "test_current", properties: `sdk_version: "test_current",`, bootclasspath: []string{"android_test_stubs_current", "core-lambda-stubs"}, @@ -136,6 +135,15 @@ func TestClasspath(t *testing.T) { java9classpath: []string{"android_test_stubs_current"}, aidl: "-pout/soong/framework.aidl", }, + { + name: "test_30", + properties: `sdk_version: "test_30",`, + bootclasspath: []string{`""`}, + system: "sdk_public_30_system_modules", + java8classpath: []string{"prebuilts/sdk/30/test/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/30/test/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/30/public/framework.aidl", + }, { name: "core_current", @@ -223,6 +231,33 @@ func TestClasspath(t *testing.T) { java9classpath: []string{"android_module_lib_stubs_current"}, aidl: "-pout/soong/framework_non_updatable.aidl", }, + { + name: "module_30", + properties: `sdk_version: "module_30",`, + bootclasspath: []string{`""`}, + system: "sdk_public_30_system_modules", + java8classpath: []string{"prebuilts/sdk/30/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/30/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/30/public/framework.aidl", + }, + { + name: "module_31", + properties: `sdk_version: "module_31",`, + bootclasspath: []string{`""`}, + system: "sdk_public_31_system_modules", + java8classpath: []string{"prebuilts/sdk/31/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/31/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/31/public/framework.aidl", + }, + { + name: "module_32", + properties: `sdk_version: "module_32",`, + bootclasspath: []string{`""`}, + system: "sdk_public_32_system_modules", + java8classpath: []string{"prebuilts/sdk/32/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/32/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/32/public/framework.aidl", + }, { name: "system_server_current", properties: `sdk_version: "system_server_current",`, @@ -231,6 +266,33 @@ func TestClasspath(t *testing.T) { java9classpath: []string{"android_system_server_stubs_current"}, aidl: "-pout/soong/framework.aidl", }, + { + name: "system_server_30", + properties: `sdk_version: "system_server_30",`, + bootclasspath: []string{`""`}, + system: "sdk_public_30_system_modules", + java8classpath: []string{"prebuilts/sdk/30/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/30/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/30/public/framework.aidl", + }, + { + name: "system_server_31", + properties: `sdk_version: "system_server_31",`, + bootclasspath: []string{`""`}, + system: "sdk_public_31_system_modules", + java8classpath: []string{"prebuilts/sdk/31/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/31/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/31/public/framework.aidl", + }, + { + name: "system_server_32", + properties: `sdk_version: "system_server_32",`, + bootclasspath: []string{`""`}, + system: "sdk_public_32_system_modules", + java8classpath: []string{"prebuilts/sdk/32/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/32/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/32/public/framework.aidl", + }, } for _, testcase := range classpathTestcases { @@ -299,7 +361,9 @@ func TestClasspath(t *testing.T) { system = "--system=none" } else if testcase.system != "" { dir := "" - if strings.HasPrefix(testcase.system, "sdk_public_") { + // If the system modules name starts with sdk_ then it is a prebuilt module and so comes + // from the prebuilt directory. + if strings.HasPrefix(testcase.system, "sdk_") { dir = "prebuilts/sdk" } else { dir = defaultJavaDir @@ -356,6 +420,8 @@ func TestClasspath(t *testing.T) { FixtureWithPrebuiltApis(map[string][]string{ "29": {}, "30": {}, + "31": {}, + "32": {}, "current": {}, }), android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { From 0b3b36a4027a7456f765b85fd819a4d26ed50795 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 28 Oct 2021 18:05:53 +0100 Subject: [PATCH 2/4] Refactor TestClasspath to simplify follow up change Extracts classpathTestCase and extracts the logic for creating the test into a separate testClasspathTestCases func. Bug: 204189791 Test: m nothing Change-Id: I657fbcde23a18f7f5651c174fbf17a9b7b7f1a9a --- java/sdk_test.go | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/java/sdk_test.go b/java/sdk_test.go index 28b962432..ed874e543 100644 --- a/java/sdk_test.go +++ b/java/sdk_test.go @@ -25,27 +25,29 @@ import ( "android/soong/java/config" ) +type classpathTestCase struct { + name string + unbundled bool + moduleType string + host android.OsClass + properties string + + // for java 8 + bootclasspath []string + java8classpath []string + + // for java 9 + system string + java9classpath []string + + forces8 bool // if set, javac will always be called with java 8 arguments + + aidl string +} + func TestClasspath(t *testing.T) { const frameworkAidl = "-I" + defaultJavaDir + "/framework/aidl" - var classpathTestcases = []struct { - name string - unbundled bool - moduleType string - host android.OsClass - properties string - - // for java 8 - bootclasspath []string - java8classpath []string - - // for java 9 - system string - java9classpath []string - - forces8 bool // if set, javac will always be called with java 8 arguments - - aidl string - }{ + var classpathTestcases = []classpathTestCase{ { name: "default", bootclasspath: config.StableCorePlatformBootclasspathLibraries, @@ -295,6 +297,10 @@ func TestClasspath(t *testing.T) { }, } + testClasspathTestCases(t, classpathTestcases) +} + +func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase) { for _, testcase := range classpathTestcases { t.Run(testcase.name, func(t *testing.T) { moduleType := "java_library" From 132c3e61c0357bf0ef438107b2896e55841bbca2 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 28 Oct 2021 18:16:14 +0100 Subject: [PATCH 3/4] Run TestClasspath test cases with Always_use_prebuilt_sdks=true/false Previously, the TestClasspath test cases were only run with the default setting of Always_use_prebuilt_sdks=false. That meant that some of the code under test that depended on the setting of that variable was not tested properly. This change runs the test cases m with Always_use_prebuilt_sdks=true as well. Those test cases whose behavior depends on the setting of that variable are split into two separate test cases, each of which only runs with the appropriate setting of that variable. All other test cases are run for both settings of the variable. That revealed a slight issue with the test setup (a missing prebuilts/sdk/public/core/android.jar file) which broke the core_current test when run with Always_use_prebuilt_sdks=true which has also been fixed. Bug: 204189791 Test: m nothing Change-Id: If2ea3fde40c7573262e93691af0b5a57e4d54469 --- java/sdk_test.go | 117 +++++++++++++++++++++++++++++++++++++++++++++-- java/testing.go | 3 ++ 2 files changed, 116 insertions(+), 4 deletions(-) diff --git a/java/sdk_test.go b/java/sdk_test.go index ed874e543..9a711922c 100644 --- a/java/sdk_test.go +++ b/java/sdk_test.go @@ -43,6 +43,13 @@ type classpathTestCase struct { forces8 bool // if set, javac will always be called with java 8 arguments aidl string + + // Indicates how this test case is affected by the setting of Always_use_prebuilt_sdks. + // + // If this is nil then the test case is unaffected by the setting of Always_use_prebuilt_sdks. + // Otherwise, the test case can only be used when + // Always_use_prebuilt_sdks=*forAlwaysUsePrebuiltSdks. + forAlwaysUsePrebuiltSdks *bool } func TestClasspath(t *testing.T) { @@ -93,6 +100,8 @@ func TestClasspath(t *testing.T) { aidl: "-pprebuilts/sdk/30/public/framework.aidl", }, { + // Test case only applies when Always_use_prebuilt_sdks=false (the default). + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(false), name: "current", properties: `sdk_version: "current",`, @@ -102,6 +111,20 @@ func TestClasspath(t *testing.T) { aidl: "-pout/soong/framework.aidl", }, { + // Test case only applies when Always_use_prebuilt_sdks=true. + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(true), + + name: "current", + properties: `sdk_version: "current",`, + bootclasspath: []string{`""`}, + system: "sdk_public_current_system_modules", + java8classpath: []string{"prebuilts/sdk/current/public/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/current/public/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/current/public/framework.aidl", + }, + { + // Test case only applies when Always_use_prebuilt_sdks=false (the default). + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(false), name: "system_current", properties: `sdk_version: "system_current",`, @@ -111,7 +134,18 @@ func TestClasspath(t *testing.T) { aidl: "-pout/soong/framework.aidl", }, { + // Test case only applies when Always_use_prebuilt_sdks=true. + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(true), + name: "system_current", + properties: `sdk_version: "system_current",`, + bootclasspath: []string{`""`}, + system: "sdk_public_current_system_modules", + java8classpath: []string{"prebuilts/sdk/current/system/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/current/system/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/current/public/framework.aidl", + }, + { name: "system_29", properties: `sdk_version: "system_29",`, bootclasspath: []string{`""`}, @@ -120,7 +154,6 @@ func TestClasspath(t *testing.T) { aidl: "-pprebuilts/sdk/29/public/framework.aidl", }, { - name: "system_30", properties: `sdk_version: "system_30",`, bootclasspath: []string{`""`}, @@ -130,6 +163,9 @@ func TestClasspath(t *testing.T) { aidl: "-pprebuilts/sdk/30/public/framework.aidl", }, { + // Test case only applies when Always_use_prebuilt_sdks=false (the default). + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(false), + name: "test_current", properties: `sdk_version: "test_current",`, bootclasspath: []string{"android_test_stubs_current", "core-lambda-stubs"}, @@ -137,6 +173,18 @@ func TestClasspath(t *testing.T) { java9classpath: []string{"android_test_stubs_current"}, aidl: "-pout/soong/framework.aidl", }, + { + // Test case only applies when Always_use_prebuilt_sdks=true. + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(true), + + name: "test_current", + properties: `sdk_version: "test_current",`, + bootclasspath: []string{`""`}, + system: "sdk_public_current_system_modules", + java8classpath: []string{"prebuilts/sdk/current/test/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/current/test/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/current/public/framework.aidl", + }, { name: "test_30", properties: `sdk_version: "test_30",`, @@ -147,12 +195,26 @@ func TestClasspath(t *testing.T) { aidl: "-pprebuilts/sdk/30/public/framework.aidl", }, { + // Test case only applies when Always_use_prebuilt_sdks=false (the default). + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(false), name: "core_current", properties: `sdk_version: "core_current",`, bootclasspath: []string{"core.current.stubs", "core-lambda-stubs"}, system: "core-current-stubs-system-modules", }, + { + // Test case only applies when Always_use_prebuilt_sdks=true. + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(true), + + name: "core_current", + properties: `sdk_version: "core_current",`, + bootclasspath: []string{`""`}, + system: "sdk_public_current_system_modules", + java8classpath: []string{"prebuilts/sdk/current/core/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/current/core/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/current/public/framework.aidl", + }, { name: "nostdlib", @@ -224,8 +286,10 @@ func TestClasspath(t *testing.T) { java9classpath: []string{"prebuilts/sdk/current/public/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, aidl: "-pprebuilts/sdk/current/public/framework.aidl", }, - { + // Test case only applies when Always_use_prebuilt_sdks=false (the default). + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(false), + name: "module_current", properties: `sdk_version: "module_current",`, bootclasspath: []string{"android_module_lib_stubs_current", "core-lambda-stubs"}, @@ -233,6 +297,18 @@ func TestClasspath(t *testing.T) { java9classpath: []string{"android_module_lib_stubs_current"}, aidl: "-pout/soong/framework_non_updatable.aidl", }, + { + // Test case only applies when Always_use_prebuilt_sdks=true. + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(true), + + name: "module_current", + properties: `sdk_version: "module_current",`, + bootclasspath: []string{`""`}, + system: "sdk_public_current_system_modules", + java8classpath: []string{"prebuilts/sdk/current/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/current/module-lib/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/current/public/framework.aidl", + }, { name: "module_30", properties: `sdk_version: "module_30",`, @@ -261,6 +337,9 @@ func TestClasspath(t *testing.T) { aidl: "-pprebuilts/sdk/32/public/framework.aidl", }, { + // Test case only applies when Always_use_prebuilt_sdks=false (the default). + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(false), + name: "system_server_current", properties: `sdk_version: "system_server_current",`, bootclasspath: []string{"android_system_server_stubs_current", "core-lambda-stubs"}, @@ -268,6 +347,18 @@ func TestClasspath(t *testing.T) { java9classpath: []string{"android_system_server_stubs_current"}, aidl: "-pout/soong/framework.aidl", }, + { + // Test case only applies when Always_use_prebuilt_sdks=true. + forAlwaysUsePrebuiltSdks: proptools.BoolPtr(true), + + name: "system_server_current", + properties: `sdk_version: "system_server_current",`, + bootclasspath: []string{`""`}, + system: "sdk_public_current_system_modules", + java8classpath: []string{"prebuilts/sdk/current/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + java9classpath: []string{"prebuilts/sdk/current/system-server/android.jar", "prebuilts/sdk/tools/core-lambda-stubs.jar"}, + aidl: "-pprebuilts/sdk/current/public/framework.aidl", + }, { name: "system_server_30", properties: `sdk_version: "system_server_30",`, @@ -297,11 +388,21 @@ func TestClasspath(t *testing.T) { }, } - testClasspathTestCases(t, classpathTestcases) + t.Run("basic", func(t *testing.T) { + testClasspathTestCases(t, classpathTestcases, false) + }) + + t.Run("Always_use_prebuilt_sdks=true", func(t *testing.T) { + testClasspathTestCases(t, classpathTestcases, true) + }) } -func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase) { +func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase, alwaysUsePrebuiltSdks bool) { for _, testcase := range classpathTestcases { + if testcase.forAlwaysUsePrebuiltSdks != nil && *testcase.forAlwaysUsePrebuiltSdks != alwaysUsePrebuiltSdks { + continue + } + t.Run(testcase.name, func(t *testing.T) { moduleType := "java_library" if testcase.moduleType != "" { @@ -421,6 +522,13 @@ func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase android.AssertPathsRelativeToTopEquals(t, "implicits", deps, javac.Implicits) } + preparer := android.NullFixturePreparer + if alwaysUsePrebuiltSdks { + preparer = android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) { + variables.Always_use_prebuilt_sdks = proptools.BoolPtr(true) + }) + } + fixtureFactory := android.GroupFixturePreparers( prepareForJavaTest, FixtureWithPrebuiltApis(map[string][]string{ @@ -441,6 +549,7 @@ func testClasspathTestCases(t *testing.T, classpathTestcases []classpathTestCase env["ANDROID_JAVA8_HOME"] = "jdk8" } }), + preparer, ) // Test with legacy javac -source 1.8 -target 1.8 diff --git a/java/testing.go b/java/testing.go index 99d55a054..0a6a4fabb 100644 --- a/java/testing.go +++ b/java/testing.go @@ -181,6 +181,9 @@ func prebuiltApisFilesForLibs(apiLevels []string, sdkLibs []string) map[string][ } } } + if level == "current" { + fs["prebuilts/sdk/current/core/android.jar"] = nil + } fs[fmt.Sprintf("prebuilts/sdk/%s/public/framework.aidl", level)] = nil } return fs From e9758b0415e30dec6005cc18f29d6ada70e9a75c Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Thu, 28 Oct 2021 11:43:21 +0100 Subject: [PATCH 4/4] Use toModule for all "standard" API surfaces For the purposes of this change a standard API surface is one of the following: * public * system * test * module-lib * system-server Test: m droid Bug: 204189791 Change-Id: I88ee9709430ca455dd6c7d1523ae22f8c22b0b7e --- java/sdk.go | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/java/sdk.go b/java/sdk.go index 80f2d6a69..3c6b23463 100644 --- a/java/sdk.go +++ b/java/sdk.go @@ -116,13 +116,13 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) } } - toModule := func(modules []string, res string, aidl android.Path) sdkDep { + toModule := func(systemModules string, module string, aidl android.Path) sdkDep { return sdkDep{ useModule: true, - bootclasspath: append(modules, config.DefaultLambdaStubsLibrary), - systemModules: "core-current-stubs-system-modules", - java9Classpath: modules, - frameworkResModule: res, + bootclasspath: []string{module, config.DefaultLambdaStubsLibrary}, + systemModules: systemModules, + java9Classpath: []string{module}, + frameworkResModule: "framework-res", aidl: android.OptionalPathForPath(aidl), } } @@ -161,11 +161,11 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) noFrameworksLibs: true, } case android.SdkPublic: - return toModule([]string{"android_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx)) + return toModule("core-current-stubs-system-modules", "android_stubs_current", sdkFrameworkAidlPath(ctx)) case android.SdkSystem: - return toModule([]string{"android_system_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx)) + return toModule("core-current-stubs-system-modules", "android_system_stubs_current", sdkFrameworkAidlPath(ctx)) case android.SdkTest: - return toModule([]string{"android_test_stubs_current"}, "framework-res", sdkFrameworkAidlPath(ctx)) + return toModule("core-current-stubs-system-modules", "android_test_stubs_current", sdkFrameworkAidlPath(ctx)) case android.SdkCore: return sdkDep{ useModule: true, @@ -175,24 +175,10 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) } case android.SdkModule: // TODO(146757305): provide .apk and .aidl that have more APIs for modules - return sdkDep{ - useModule: true, - bootclasspath: []string{"android_module_lib_stubs_current", config.DefaultLambdaStubsLibrary}, - systemModules: "core-module-lib-stubs-system-modules", - java9Classpath: []string{"android_module_lib_stubs_current"}, - frameworkResModule: "framework-res", - aidl: android.OptionalPathForPath(nonUpdatableFrameworkAidlPath(ctx)), - } + return toModule("core-module-lib-stubs-system-modules", "android_module_lib_stubs_current", nonUpdatableFrameworkAidlPath(ctx)) case android.SdkSystemServer: // TODO(146757305): provide .apk and .aidl that have more APIs for modules - return sdkDep{ - useModule: true, - bootclasspath: []string{"android_system_server_stubs_current", config.DefaultLambdaStubsLibrary}, - systemModules: "core-module-lib-stubs-system-modules", - java9Classpath: []string{"android_system_server_stubs_current"}, - frameworkResModule: "framework-res", - aidl: android.OptionalPathForPath(sdkFrameworkAidlPath(ctx)), - } + return toModule("core-module-lib-stubs-system-modules", "android_system_server_stubs_current", sdkFrameworkAidlPath(ctx)) default: panic(fmt.Errorf("invalid sdk %q", sdkVersion.Raw)) }