Loading android/config.go +15 −0 Original line number Diff line number Diff line Loading @@ -1618,6 +1618,21 @@ func (l *ConfiguredJarList) RemoveList(list ConfiguredJarList) ConfiguredJarList return ConfiguredJarList{apexes, jars} } // Filter keeps the entries if a jar appears in the given list of jars to keep; returns a new list. func (l *ConfiguredJarList) Filter(jarsToKeep []string) ConfiguredJarList { var apexes []string var jars []string for i, jar := range l.jars { if InList(jar, jarsToKeep) { apexes = append(apexes, l.apexes[i]) jars = append(jars, jar) } } return ConfiguredJarList{apexes, jars} } // CopyOfJars returns a copy of the list of strings containing jar module name // components. func (l *ConfiguredJarList) CopyOfJars() []string { Loading android/module.go +19 −12 Original line number Diff line number Diff line Loading @@ -1809,8 +1809,8 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) if m.Enabled() { // ensure all direct android.Module deps are enabled ctx.VisitDirectDepsBlueprint(func(bm blueprint.Module) { if _, ok := bm.(Module); ok { ctx.validateAndroidModule(bm, ctx.baseModuleContext.strictVisitDeps) if m, ok := bm.(Module); ok { ctx.validateAndroidModule(bm, ctx.OtherModuleDependencyTag(m), ctx.baseModuleContext.strictVisitDeps) } }) Loading Loading @@ -2234,7 +2234,12 @@ func (b *baseModuleContext) AddMissingDependencies(deps []string) { } } func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, strict bool) Module { type AllowDisabledModuleDependency interface { blueprint.DependencyTag AllowDisabledModuleDependency(target Module) bool } func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, tag blueprint.DependencyTag, strict bool) Module { aModule, _ := module.(Module) if !strict { Loading @@ -2247,11 +2252,13 @@ func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, stric } if !aModule.Enabled() { if t, ok := tag.(AllowDisabledModuleDependency); !ok || !t.AllowDisabledModuleDependency(aModule) { if b.Config().AllowMissingDependencies() { b.AddMissingDependencies([]string{b.OtherModuleName(aModule)}) } else { b.ModuleErrorf("depends on disabled module %q", b.OtherModuleName(aModule)) } } return nil } return aModule Loading Loading @@ -2343,7 +2350,7 @@ func (b *baseModuleContext) VisitDirectDepsBlueprint(visit func(blueprint.Module func (b *baseModuleContext) VisitDirectDeps(visit func(Module)) { b.bp.VisitDirectDeps(func(module blueprint.Module) { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { visit(aModule) } }) Loading @@ -2351,7 +2358,7 @@ func (b *baseModuleContext) VisitDirectDeps(visit func(Module)) { func (b *baseModuleContext) VisitDirectDepsWithTag(tag blueprint.DependencyTag, visit func(Module)) { b.bp.VisitDirectDeps(func(module blueprint.Module) { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { if b.bp.OtherModuleDependencyTag(aModule) == tag { visit(aModule) } Loading @@ -2363,7 +2370,7 @@ func (b *baseModuleContext) VisitDirectDepsIf(pred func(Module) bool, visit func b.bp.VisitDirectDepsIf( // pred func(module blueprint.Module) bool { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { return pred(aModule) } else { return false Loading @@ -2377,7 +2384,7 @@ func (b *baseModuleContext) VisitDirectDepsIf(pred func(Module) bool, visit func func (b *baseModuleContext) VisitDepsDepthFirst(visit func(Module)) { b.bp.VisitDepsDepthFirst(func(module blueprint.Module) { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { visit(aModule) } }) Loading @@ -2387,7 +2394,7 @@ func (b *baseModuleContext) VisitDepsDepthFirstIf(pred func(Module) bool, visit b.bp.VisitDepsDepthFirstIf( // pred func(module blueprint.Module) bool { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { return pred(aModule) } else { return false Loading apex/apex.go +4 −1 Original line number Diff line number Diff line Loading @@ -2096,7 +2096,10 @@ func apexFileForBootclasspathFragmentContentModule(ctx android.ModuleContext, fr // Get the dexBootJar from the bootclasspath_fragment as that is responsible for performing the // hidden API encpding. dexBootJar := bootclasspathFragmentInfo.DexBootJarPathForContentModule(javaModule) dexBootJar, err := bootclasspathFragmentInfo.DexBootJarPathForContentModule(javaModule) if err != nil { ctx.ModuleErrorf("%s", err) } // Create an apexFile as for a normal java module but with the dex boot jar provided by the // bootclasspath_fragment. Loading apex/bootclasspath_fragment_test.go +4 −1 Original line number Diff line number Diff line Loading @@ -512,7 +512,10 @@ func TestBootclasspathFragmentContentsNoName(t *testing.T) { checkFragmentExportedDexJar := func(name string, expectedDexJar string) { module := result.Module(name, "android_common_apex10000") dexJar := info.DexBootJarPathForContentModule(module) dexJar, err := info.DexBootJarPathForContentModule(module) if err != nil { t.Error(err) } android.AssertPathRelativeToTopEquals(t, name+" dex", expectedDexJar, dexJar) expectedCopyCommand := fmt.Sprintf("&& cp -f %s out/soong/.intermediates/myapex/android_common_myapex_image/image.apex/javalib/%s.jar", expectedDexJar, name) Loading cc/image.go +13 −1 Original line number Diff line number Diff line Loading @@ -430,6 +430,16 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) { recoverySnapshotVersion := mctx.DeviceConfig().RecoverySnapshotVersion() usingRecoverySnapshot := recoverySnapshotVersion != "current" && recoverySnapshotVersion != "" needVndkVersionVendorVariantForLlndk := false if boardVndkVersion != "" { boardVndkApiLevel, err := android.ApiLevelFromUser(mctx, boardVndkVersion) if err == nil && !boardVndkApiLevel.IsPreview() { // VNDK snapshot newer than v30 has LLNDK stub libraries. // Only the VNDK version less than or equal to v30 requires generating the vendor // variant of the VNDK version from the source tree. needVndkVersionVendorVariantForLlndk = boardVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(mctx, "30")) } } if boardVndkVersion == "current" { boardVndkVersion = platformVndkVersion } Loading @@ -446,7 +456,9 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) { vendorVariants = append(vendorVariants, platformVndkVersion) productVariants = append(productVariants, platformVndkVersion) } if boardVndkVersion != "" { // Generate vendor variants for boardVndkVersion only if the VNDK snapshot does not // provide the LLNDK stub libraries. if needVndkVersionVendorVariantForLlndk { vendorVariants = append(vendorVariants, boardVndkVersion) } if productVndkVersion != "" { Loading Loading
android/config.go +15 −0 Original line number Diff line number Diff line Loading @@ -1618,6 +1618,21 @@ func (l *ConfiguredJarList) RemoveList(list ConfiguredJarList) ConfiguredJarList return ConfiguredJarList{apexes, jars} } // Filter keeps the entries if a jar appears in the given list of jars to keep; returns a new list. func (l *ConfiguredJarList) Filter(jarsToKeep []string) ConfiguredJarList { var apexes []string var jars []string for i, jar := range l.jars { if InList(jar, jarsToKeep) { apexes = append(apexes, l.apexes[i]) jars = append(jars, jar) } } return ConfiguredJarList{apexes, jars} } // CopyOfJars returns a copy of the list of strings containing jar module name // components. func (l *ConfiguredJarList) CopyOfJars() []string { Loading
android/module.go +19 −12 Original line number Diff line number Diff line Loading @@ -1809,8 +1809,8 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) if m.Enabled() { // ensure all direct android.Module deps are enabled ctx.VisitDirectDepsBlueprint(func(bm blueprint.Module) { if _, ok := bm.(Module); ok { ctx.validateAndroidModule(bm, ctx.baseModuleContext.strictVisitDeps) if m, ok := bm.(Module); ok { ctx.validateAndroidModule(bm, ctx.OtherModuleDependencyTag(m), ctx.baseModuleContext.strictVisitDeps) } }) Loading Loading @@ -2234,7 +2234,12 @@ func (b *baseModuleContext) AddMissingDependencies(deps []string) { } } func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, strict bool) Module { type AllowDisabledModuleDependency interface { blueprint.DependencyTag AllowDisabledModuleDependency(target Module) bool } func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, tag blueprint.DependencyTag, strict bool) Module { aModule, _ := module.(Module) if !strict { Loading @@ -2247,11 +2252,13 @@ func (b *baseModuleContext) validateAndroidModule(module blueprint.Module, stric } if !aModule.Enabled() { if t, ok := tag.(AllowDisabledModuleDependency); !ok || !t.AllowDisabledModuleDependency(aModule) { if b.Config().AllowMissingDependencies() { b.AddMissingDependencies([]string{b.OtherModuleName(aModule)}) } else { b.ModuleErrorf("depends on disabled module %q", b.OtherModuleName(aModule)) } } return nil } return aModule Loading Loading @@ -2343,7 +2350,7 @@ func (b *baseModuleContext) VisitDirectDepsBlueprint(visit func(blueprint.Module func (b *baseModuleContext) VisitDirectDeps(visit func(Module)) { b.bp.VisitDirectDeps(func(module blueprint.Module) { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { visit(aModule) } }) Loading @@ -2351,7 +2358,7 @@ func (b *baseModuleContext) VisitDirectDeps(visit func(Module)) { func (b *baseModuleContext) VisitDirectDepsWithTag(tag blueprint.DependencyTag, visit func(Module)) { b.bp.VisitDirectDeps(func(module blueprint.Module) { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { if b.bp.OtherModuleDependencyTag(aModule) == tag { visit(aModule) } Loading @@ -2363,7 +2370,7 @@ func (b *baseModuleContext) VisitDirectDepsIf(pred func(Module) bool, visit func b.bp.VisitDirectDepsIf( // pred func(module blueprint.Module) bool { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { return pred(aModule) } else { return false Loading @@ -2377,7 +2384,7 @@ func (b *baseModuleContext) VisitDirectDepsIf(pred func(Module) bool, visit func func (b *baseModuleContext) VisitDepsDepthFirst(visit func(Module)) { b.bp.VisitDepsDepthFirst(func(module blueprint.Module) { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { visit(aModule) } }) Loading @@ -2387,7 +2394,7 @@ func (b *baseModuleContext) VisitDepsDepthFirstIf(pred func(Module) bool, visit b.bp.VisitDepsDepthFirstIf( // pred func(module blueprint.Module) bool { if aModule := b.validateAndroidModule(module, b.strictVisitDeps); aModule != nil { if aModule := b.validateAndroidModule(module, b.bp.OtherModuleDependencyTag(module), b.strictVisitDeps); aModule != nil { return pred(aModule) } else { return false Loading
apex/apex.go +4 −1 Original line number Diff line number Diff line Loading @@ -2096,7 +2096,10 @@ func apexFileForBootclasspathFragmentContentModule(ctx android.ModuleContext, fr // Get the dexBootJar from the bootclasspath_fragment as that is responsible for performing the // hidden API encpding. dexBootJar := bootclasspathFragmentInfo.DexBootJarPathForContentModule(javaModule) dexBootJar, err := bootclasspathFragmentInfo.DexBootJarPathForContentModule(javaModule) if err != nil { ctx.ModuleErrorf("%s", err) } // Create an apexFile as for a normal java module but with the dex boot jar provided by the // bootclasspath_fragment. Loading
apex/bootclasspath_fragment_test.go +4 −1 Original line number Diff line number Diff line Loading @@ -512,7 +512,10 @@ func TestBootclasspathFragmentContentsNoName(t *testing.T) { checkFragmentExportedDexJar := func(name string, expectedDexJar string) { module := result.Module(name, "android_common_apex10000") dexJar := info.DexBootJarPathForContentModule(module) dexJar, err := info.DexBootJarPathForContentModule(module) if err != nil { t.Error(err) } android.AssertPathRelativeToTopEquals(t, name+" dex", expectedDexJar, dexJar) expectedCopyCommand := fmt.Sprintf("&& cp -f %s out/soong/.intermediates/myapex/android_common_myapex_image/image.apex/javalib/%s.jar", expectedDexJar, name) Loading
cc/image.go +13 −1 Original line number Diff line number Diff line Loading @@ -430,6 +430,16 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) { recoverySnapshotVersion := mctx.DeviceConfig().RecoverySnapshotVersion() usingRecoverySnapshot := recoverySnapshotVersion != "current" && recoverySnapshotVersion != "" needVndkVersionVendorVariantForLlndk := false if boardVndkVersion != "" { boardVndkApiLevel, err := android.ApiLevelFromUser(mctx, boardVndkVersion) if err == nil && !boardVndkApiLevel.IsPreview() { // VNDK snapshot newer than v30 has LLNDK stub libraries. // Only the VNDK version less than or equal to v30 requires generating the vendor // variant of the VNDK version from the source tree. needVndkVersionVendorVariantForLlndk = boardVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(mctx, "30")) } } if boardVndkVersion == "current" { boardVndkVersion = platformVndkVersion } Loading @@ -446,7 +456,9 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) { vendorVariants = append(vendorVariants, platformVndkVersion) productVariants = append(productVariants, platformVndkVersion) } if boardVndkVersion != "" { // Generate vendor variants for boardVndkVersion only if the VNDK snapshot does not // provide the LLNDK stub libraries. if needVndkVersionVendorVariantForLlndk { vendorVariants = append(vendorVariants, boardVndkVersion) } if productVndkVersion != "" { Loading