Loading apex/apex_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -5429,11 +5429,11 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) { apex_available: ["myapex"], shared_library: false, permitted_packages: ["bar"], prefer: true, } java_sdk_library { name: "libbar", enabled: false, srcs: ["foo/bar/MyClass.java"], unsafe_ignore_missing_latest_api: true, apex_available: ["myapex"], Loading apex/platform_bootclasspath_test.go +6 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,9 @@ func TestPlatformBootclasspathDependencies(t *testing.T) { // The fragments. `com.android.art:art-bootclasspath-fragment`, `myapex:my-bootclasspath-fragment`, // Impl lib of sdk_library for transitive srcjar generation `platform:foo.impl`, }) } Loading Loading @@ -565,6 +568,9 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) { // The fragments. "myapex:mybootclasspath-fragment", "myapex:prebuilt_mybootclasspath-fragment", // Impl lib of sdk_library for transitive srcjar generation "platform:foo.impl", }) } Loading java/platform_bootclasspath.go +24 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ var ( platformBootclasspathArtBootJarDepTag = bootclasspathDependencyTag{name: "art-boot-jar"} platformBootclasspathBootJarDepTag = bootclasspathDependencyTag{name: "platform-boot-jar"} platformBootclasspathApexBootJarDepTag = bootclasspathDependencyTag{name: "apex-boot-jar"} platformBootclasspathImplLibDepTag = dependencyTag{name: "impl-lib-tag"} ) type platformBootclasspathModule struct { Loading Loading @@ -111,12 +112,18 @@ func (b *platformBootclasspathModule) BootclasspathDepsMutator(ctx android.Botto // Add dependencies on all the ART jars. global := dexpreopt.GetGlobalConfig(ctx) addDependenciesOntoSelectedBootImageApexes(ctx, "com.android.art") var bootImageModuleNames []string // TODO: b/308174306 - Remove the mechanism of depending on the java_sdk_library(_import) directly addDependenciesOntoBootImageModules(ctx, global.ArtApexJars, platformBootclasspathArtBootJarDepTag) bootImageModuleNames = append(bootImageModuleNames, global.ArtApexJars.CopyOfJars()...) // Add dependencies on all the non-updatable jars, which are on the platform or in non-updatable // APEXes. addDependenciesOntoBootImageModules(ctx, b.platformJars(ctx), platformBootclasspathBootJarDepTag) platformJars := b.platformJars(ctx) addDependenciesOntoBootImageModules(ctx, platformJars, platformBootclasspathBootJarDepTag) bootImageModuleNames = append(bootImageModuleNames, platformJars.CopyOfJars()...) // Add dependencies on all the updatable jars, except the ART jars. apexJars := dexpreopt.GetGlobalConfig(ctx).ApexBootJars Loading @@ -127,9 +134,17 @@ func (b *platformBootclasspathModule) BootclasspathDepsMutator(ctx android.Botto addDependenciesOntoSelectedBootImageApexes(ctx, android.FirstUniqueStrings(apexes)...) // TODO: b/308174306 - Remove the mechanism of depending on the java_sdk_library(_import) directly addDependenciesOntoBootImageModules(ctx, apexJars, platformBootclasspathApexBootJarDepTag) bootImageModuleNames = append(bootImageModuleNames, apexJars.CopyOfJars()...) // Add dependencies on all the fragments. b.properties.BootclasspathFragmentsDepsProperties.addDependenciesOntoFragments(ctx) for _, bootImageModuleName := range bootImageModuleNames { implLibName := implLibraryModuleName(bootImageModuleName) if ctx.OtherModuleExists(implLibName) { ctx.AddFarVariationDependencies(nil, platformBootclasspathImplLibDepTag, implLibName) } } } func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, modules android.ConfiguredJarList, tag bootclasspathDependencyTag) { Loading Loading @@ -166,8 +181,15 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo allModules = append(allModules, apexModules...) b.configuredModules = allModules // Do not add implLibModule to allModules as the impl lib is only used to collect the // transitive source files var implLibModule []android.Module ctx.VisitDirectDepsWithTag(implLibraryTag, func(m android.Module) { implLibModule = append(implLibModule, m) }) var transitiveSrcFiles android.Paths for _, module := range allModules { for _, module := range append(allModules, implLibModule...) { if depInfo, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok { if depInfo.TransitiveSrcFiles != nil { transitiveSrcFiles = append(transitiveSrcFiles, depInfo.TransitiveSrcFiles.ToList()...) Loading java/sdk_library.go +0 −1 Original line number Diff line number Diff line Loading @@ -1437,7 +1437,6 @@ func (module *SdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) if dep, ok := android.OtherModuleProvider(ctx, to, JavaInfoProvider); ok { module.implLibraryHeaderJars = append(module.implLibraryHeaderJars, dep.HeaderJars...) module.implLibraryModule = to.(*Library) android.SetProvider(ctx, JavaInfoProvider, dep) } } }) Loading java/sdk_library_internal.go +5 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,13 @@ const ( implLibSuffix = ".impl" ) func implLibraryModuleName(sdkLibName string) string { return sdkLibName + implLibSuffix } // Module name of the runtime implementation library func (c *commonToSdkLibraryAndImport) implLibraryModuleName() string { return c.module.RootLibraryName() + implLibSuffix return implLibraryModuleName(c.module.RootLibraryName()) } // Module name of the XML file for the lib Loading Loading
apex/apex_test.go +1 −1 Original line number Diff line number Diff line Loading @@ -5429,11 +5429,11 @@ func TestBootDexJarsFromSourcesAndPrebuilts(t *testing.T) { apex_available: ["myapex"], shared_library: false, permitted_packages: ["bar"], prefer: true, } java_sdk_library { name: "libbar", enabled: false, srcs: ["foo/bar/MyClass.java"], unsafe_ignore_missing_latest_api: true, apex_available: ["myapex"], Loading
apex/platform_bootclasspath_test.go +6 −0 Original line number Diff line number Diff line Loading @@ -409,6 +409,9 @@ func TestPlatformBootclasspathDependencies(t *testing.T) { // The fragments. `com.android.art:art-bootclasspath-fragment`, `myapex:my-bootclasspath-fragment`, // Impl lib of sdk_library for transitive srcjar generation `platform:foo.impl`, }) } Loading Loading @@ -565,6 +568,9 @@ func TestPlatformBootclasspath_AlwaysUsePrebuiltSdks(t *testing.T) { // The fragments. "myapex:mybootclasspath-fragment", "myapex:prebuilt_mybootclasspath-fragment", // Impl lib of sdk_library for transitive srcjar generation "platform:foo.impl", }) } Loading
java/platform_bootclasspath.go +24 −2 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ var ( platformBootclasspathArtBootJarDepTag = bootclasspathDependencyTag{name: "art-boot-jar"} platformBootclasspathBootJarDepTag = bootclasspathDependencyTag{name: "platform-boot-jar"} platformBootclasspathApexBootJarDepTag = bootclasspathDependencyTag{name: "apex-boot-jar"} platformBootclasspathImplLibDepTag = dependencyTag{name: "impl-lib-tag"} ) type platformBootclasspathModule struct { Loading Loading @@ -111,12 +112,18 @@ func (b *platformBootclasspathModule) BootclasspathDepsMutator(ctx android.Botto // Add dependencies on all the ART jars. global := dexpreopt.GetGlobalConfig(ctx) addDependenciesOntoSelectedBootImageApexes(ctx, "com.android.art") var bootImageModuleNames []string // TODO: b/308174306 - Remove the mechanism of depending on the java_sdk_library(_import) directly addDependenciesOntoBootImageModules(ctx, global.ArtApexJars, platformBootclasspathArtBootJarDepTag) bootImageModuleNames = append(bootImageModuleNames, global.ArtApexJars.CopyOfJars()...) // Add dependencies on all the non-updatable jars, which are on the platform or in non-updatable // APEXes. addDependenciesOntoBootImageModules(ctx, b.platformJars(ctx), platformBootclasspathBootJarDepTag) platformJars := b.platformJars(ctx) addDependenciesOntoBootImageModules(ctx, platformJars, platformBootclasspathBootJarDepTag) bootImageModuleNames = append(bootImageModuleNames, platformJars.CopyOfJars()...) // Add dependencies on all the updatable jars, except the ART jars. apexJars := dexpreopt.GetGlobalConfig(ctx).ApexBootJars Loading @@ -127,9 +134,17 @@ func (b *platformBootclasspathModule) BootclasspathDepsMutator(ctx android.Botto addDependenciesOntoSelectedBootImageApexes(ctx, android.FirstUniqueStrings(apexes)...) // TODO: b/308174306 - Remove the mechanism of depending on the java_sdk_library(_import) directly addDependenciesOntoBootImageModules(ctx, apexJars, platformBootclasspathApexBootJarDepTag) bootImageModuleNames = append(bootImageModuleNames, apexJars.CopyOfJars()...) // Add dependencies on all the fragments. b.properties.BootclasspathFragmentsDepsProperties.addDependenciesOntoFragments(ctx) for _, bootImageModuleName := range bootImageModuleNames { implLibName := implLibraryModuleName(bootImageModuleName) if ctx.OtherModuleExists(implLibName) { ctx.AddFarVariationDependencies(nil, platformBootclasspathImplLibDepTag, implLibName) } } } func addDependenciesOntoBootImageModules(ctx android.BottomUpMutatorContext, modules android.ConfiguredJarList, tag bootclasspathDependencyTag) { Loading Loading @@ -166,8 +181,15 @@ func (b *platformBootclasspathModule) GenerateAndroidBuildActions(ctx android.Mo allModules = append(allModules, apexModules...) b.configuredModules = allModules // Do not add implLibModule to allModules as the impl lib is only used to collect the // transitive source files var implLibModule []android.Module ctx.VisitDirectDepsWithTag(implLibraryTag, func(m android.Module) { implLibModule = append(implLibModule, m) }) var transitiveSrcFiles android.Paths for _, module := range allModules { for _, module := range append(allModules, implLibModule...) { if depInfo, ok := android.OtherModuleProvider(ctx, module, JavaInfoProvider); ok { if depInfo.TransitiveSrcFiles != nil { transitiveSrcFiles = append(transitiveSrcFiles, depInfo.TransitiveSrcFiles.ToList()...) Loading
java/sdk_library.go +0 −1 Original line number Diff line number Diff line Loading @@ -1437,7 +1437,6 @@ func (module *SdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) if dep, ok := android.OtherModuleProvider(ctx, to, JavaInfoProvider); ok { module.implLibraryHeaderJars = append(module.implLibraryHeaderJars, dep.HeaderJars...) module.implLibraryModule = to.(*Library) android.SetProvider(ctx, JavaInfoProvider, dep) } } }) Loading
java/sdk_library_internal.go +5 −1 Original line number Diff line number Diff line Loading @@ -33,9 +33,13 @@ const ( implLibSuffix = ".impl" ) func implLibraryModuleName(sdkLibName string) string { return sdkLibName + implLibSuffix } // Module name of the runtime implementation library func (c *commonToSdkLibraryAndImport) implLibraryModuleName() string { return c.module.RootLibraryName() + implLibSuffix return implLibraryModuleName(c.module.RootLibraryName()) } // Module name of the XML file for the lib Loading