diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/bootclasspath_fragment.go | 2 | ||||
-rw-r--r-- | java/bootclasspath_fragment_test.go | 36 | ||||
-rw-r--r-- | java/config/makevars.go | 6 | ||||
-rw-r--r-- | java/hiddenapi_modular.go | 2 | ||||
-rw-r--r-- | java/java.go | 2 | ||||
-rw-r--r-- | java/legacy_core_platform_api_usage.go | 8 | ||||
-rw-r--r-- | java/sdk.go | 4 |
7 files changed, 10 insertions, 50 deletions
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index 108fdd483..50429b07a 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -479,8 +479,6 @@ func (b *BootclasspathFragmentModule) DepsMutator(ctx android.BottomUpMutatorCon for _, apiScope := range hiddenAPISdkLibrarySupportedScopes { // Add a dependency onto a possibly scope specific stub library. scopeSpecificDependency := apiScope.scopeSpecificStubModule(ctx, additionalStubModule) - // Use JavaApiLibraryName function to be redirected to stubs generated from .txt if applicable - scopeSpecificDependency = android.JavaApiLibraryName(ctx.Config(), scopeSpecificDependency) tag := hiddenAPIStubsDependencyTag{apiScope: apiScope, fromAdditionalDependency: true} ctx.AddVariationDependencies(nil, tag, scopeSpecificDependency) } diff --git a/java/bootclasspath_fragment_test.go b/java/bootclasspath_fragment_test.go index 9bdef749b..2541f14ff 100644 --- a/java/bootclasspath_fragment_test.go +++ b/java/bootclasspath_fragment_test.go @@ -432,39 +432,3 @@ func TestBootclasspathFragment_Test(t *testing.T) { fragment = result.Module("a_test_fragment", "android_common").(*BootclasspathFragmentModule) android.AssertBoolEquals(t, "is a test fragment by type", true, fragment.isTestFragment()) } - -func TestBootclassFragment_LinkTextStub(t *testing.T) { - result := android.GroupFixturePreparers( - prepareForJavaTest, - prepareForTestWithBootclasspathFragment, - PrepareForTestWithJavaSdkLibraryFiles, - FixtureWithLastReleaseApis("mysdklibrary"), - android.FixtureModifyConfig(func(config android.Config) { - config.SetBuildFromTextStub(true) - }), - ).RunTestWithBp(t, ` - bootclasspath_fragment { - name: "myfragment", - contents: ["mysdklibrary"], - hidden_api: {split_packages: ["*"]}, - additional_stubs: [ - "android-non-updatable", - ], - } - java_sdk_library { - name: "mysdklibrary", - srcs: ["a.java"], - shared_library: false, - public: {enabled: true}, - system: {enabled: true}, - } - `) - - fragment := result.ModuleForTests("myfragment", "android_common") - ruleCommand := fragment.Rule("modularHiddenAPIStubFlagsFile").RuleParams.Command - android.AssertStringDoesContain(t, "Command expected to contain library as dependency stub dex", - ruleCommand, "--dependency-stub-dex=out/soong/.intermediates/default/java/android-non-updatable.stubs.module_lib.from-text/android_common/dex/android-non-updatable.stubs.module_lib.from-text.jar") - android.AssertStringDoesNotContain(t, - "Command not expected to contain multiple api_library as dependency stub dex", ruleCommand, - "--dependency-stub-dex=out/soong/.intermediates/default/java/android-non-updatable.stubs.from-text/android_common/dex/android-non-updatable.stubs.from-text.jar") -} diff --git a/java/config/makevars.go b/java/config/makevars.go index d383d9888..4e0919537 100644 --- a/java/config/makevars.go +++ b/java/config/makevars.go @@ -29,10 +29,8 @@ func makeVarsProvider(ctx android.MakeVarsContext) { // These are used by make when LOCAL_PRIVATE_PLATFORM_APIS is set (equivalent to platform_apis in blueprint): ctx.Strict("LEGACY_CORE_PLATFORM_BOOTCLASSPATH_LIBRARIES", - strings.Join(android.JavaApiLibraryNames(ctx.Config(), LegacyCorePlatformBootclasspathLibraries), " ")) - ctx.Strict("LEGACY_CORE_PLATFORM_SYSTEM_MODULES", - android.JavaApiLibraryName(ctx.Config(), LegacyCorePlatformSystemModules), - ) + strings.Join(LegacyCorePlatformBootclasspathLibraries, " ")) + ctx.Strict("LEGACY_CORE_PLATFORM_SYSTEM_MODULES", LegacyCorePlatformSystemModules) ctx.Strict("ANDROID_JAVA_HOME", "${JavaHome}") ctx.Strict("ANDROID_JAVA8_HOME", "prebuilts/jdk/jdk8/${hostPrebuiltTag}") diff --git a/java/hiddenapi_modular.go b/java/hiddenapi_modular.go index da9c9970a..c6b921bb2 100644 --- a/java/hiddenapi_modular.go +++ b/java/hiddenapi_modular.go @@ -647,7 +647,7 @@ func (s StubDexJarsByModule) addStubDexJar(ctx android.ModuleContext, module and // public version is provided by the art.module.public.api module. In those cases it is necessary // to treat all those modules as they were the same name, otherwise it will result in multiple // definitions of a single class being passed to hidden API processing which will cause an error. - if name == scope.nonUpdatablePrebuiltModule || name == android.JavaApiLibraryName(ctx.Config(), scope.nonUpdatableSourceModule) { + if name == scope.nonUpdatablePrebuiltModule || name == scope.nonUpdatableSourceModule { // Treat all *android-non-updatable* modules as if they were part of an android-non-updatable // java_sdk_library. // TODO(b/192067200): Remove once android-non-updatable is a java_sdk_library or equivalent. diff --git a/java/java.go b/java/java.go index a026610c2..454f42f7a 100644 --- a/java/java.go +++ b/java/java.go @@ -459,7 +459,7 @@ func sdkDeps(ctx android.BottomUpMutatorContext, sdkContext android.SdkContext, ctx.AddVariationDependencies(nil, sdkLibTag, sdkDep.classpath...) if d.effectiveOptimizeEnabled() && sdkDep.hasStandardLibs() { ctx.AddVariationDependencies(nil, proguardRaiseTag, - android.JavaApiLibraryNames(ctx.Config(), config.LegacyCorePlatformBootclasspathLibraries)..., + config.LegacyCorePlatformBootclasspathLibraries..., ) } if d.effectiveOptimizeEnabled() && sdkDep.hasFrameworkLibs() { diff --git a/java/legacy_core_platform_api_usage.go b/java/legacy_core_platform_api_usage.go index 04c6d05b1..6cb549eaf 100644 --- a/java/legacy_core_platform_api_usage.go +++ b/java/legacy_core_platform_api_usage.go @@ -93,16 +93,16 @@ func useLegacyCorePlatformApi(ctx android.EarlyModuleContext, moduleName string) func corePlatformSystemModules(ctx android.EarlyModuleContext) string { if useLegacyCorePlatformApi(ctx, ctx.ModuleName()) { - return android.JavaApiLibraryName(ctx.Config(), config.LegacyCorePlatformSystemModules) + return config.LegacyCorePlatformSystemModules } else { - return android.JavaApiLibraryName(ctx.Config(), config.StableCorePlatformSystemModules) + return config.StableCorePlatformSystemModules } } func corePlatformBootclasspathLibraries(ctx android.EarlyModuleContext) []string { if useLegacyCorePlatformApi(ctx, ctx.ModuleName()) { - return android.JavaApiLibraryNames(ctx.Config(), config.LegacyCorePlatformBootclasspathLibraries) + return config.LegacyCorePlatformBootclasspathLibraries } else { - return android.JavaApiLibraryNames(ctx.Config(), config.StableCorePlatformBootclasspathLibraries) + return config.StableCorePlatformBootclasspathLibraries } } diff --git a/java/sdk.go b/java/sdk.go index 7699aabe0..7c702c405 100644 --- a/java/sdk.go +++ b/java/sdk.go @@ -148,7 +148,7 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) toModule := func(module string, aidl android.Path) sdkDep { // Select the kind of system modules needed for the sdk version. systemModulesKind := systemModuleKind(sdkVersion.Kind, android.FutureApiLevel) - systemModules := android.JavaApiLibraryName(ctx.Config(), fmt.Sprintf("core-%s-stubs-system-modules", systemModulesKind)) + systemModules := fmt.Sprintf("core-%s-stubs-system-modules", systemModulesKind) return sdkDep{ useModule: true, bootclasspath: []string{module, config.DefaultLambdaStubsLibrary}, @@ -198,7 +198,7 @@ func decodeSdkDep(ctx android.EarlyModuleContext, sdkContext android.SdkContext) return sdkDep{ useModule: true, bootclasspath: []string{android.SdkCore.DefaultJavaLibraryName(), config.DefaultLambdaStubsLibrary}, - systemModules: android.JavaApiLibraryName(ctx.Config(), "core-public-stubs-system-modules"), + systemModules: "core-public-stubs-system-modules", noFrameworksLibs: true, } case android.SdkModule: |