Snap for 11973804 from efe843b31919999b7afe9c70fb60f1f3e3d9e727 to 24Q3-release
Change-Id: Ie1f1f9555e0fff90981624cac9e575bafc09300f
diff --git a/aconfig/aconfig_declarations.go b/aconfig/aconfig_declarations.go
index 71a64dd..dac0ae3 100644
--- a/aconfig/aconfig_declarations.go
+++ b/aconfig/aconfig_declarations.go
@@ -15,7 +15,6 @@
package aconfig
import (
- "fmt"
"strings"
"android/soong/android"
@@ -44,8 +43,6 @@
// The flags will only be repackaged if this prop is true.
Exportable bool
}
-
- intermediatePath android.WritablePath
}
func DeclarationsFactory() android.Module {
@@ -86,18 +83,6 @@
}
}
-func (module *DeclarationsModule) OutputFiles(tag string) (android.Paths, error) {
- switch tag {
- case "":
- // The default output of this module is the intermediates format, which is
- // not installable and in a private format that no other rules can handle
- // correctly.
- return []android.Path{module.intermediatePath}, nil
- default:
- return nil, fmt.Errorf("unsupported aconfig_declarations module reference tag %q", tag)
- }
-}
-
func joinAndPrefix(prefix string, values []string) string {
var sb strings.Builder
for _, v := range values {
@@ -171,5 +156,4 @@
IntermediateCacheOutputPath: intermediateCacheFilePath,
IntermediateDumpOutputPath: intermediateDumpFilePath,
})
-
}
diff --git a/aconfig/build_flags/declarations.go b/aconfig/build_flags/declarations.go
index f6a6ee1..e927db2 100644
--- a/aconfig/build_flags/declarations.go
+++ b/aconfig/build_flags/declarations.go
@@ -15,7 +15,6 @@
package build_flags
import (
- "fmt"
"strings"
"android/soong/android"
@@ -39,8 +38,6 @@
// aconfig files, relative to this Android.bp file
Srcs []string `android:"path"`
}
-
- intermediatePath android.WritablePath
}
func DeclarationsFactory() android.Module {
@@ -53,18 +50,6 @@
return module
}
-func (module *DeclarationsModule) OutputFiles(tag string) (android.Paths, error) {
- switch tag {
- case "":
- // The default output of this module is the intermediates format, which is
- // not installable and in a private format that no other rules can handle
- // correctly.
- return []android.Path{module.intermediatePath}, nil
- default:
- return nil, fmt.Errorf("unsupported build_flags_declarations module reference tag %q", tag)
- }
-}
-
func joinAndPrefix(prefix string, values []string) string {
var sb strings.Builder
for _, v := range values {
diff --git a/aconfig/codegen/aconfig_declarations_group.go b/aconfig/codegen/aconfig_declarations_group.go
index 1c91bee..13daf47 100644
--- a/aconfig/codegen/aconfig_declarations_group.go
+++ b/aconfig/codegen/aconfig_declarations_group.go
@@ -15,7 +15,6 @@
package codegen
import (
- "fmt"
"maps"
"android/soong/android"
@@ -40,11 +39,6 @@
android.DefaultableModuleBase
properties AconfigDeclarationsGroupProperties
-
- aconfigDeclarationNames []string
- intermediateCacheOutputPaths android.Paths
- javaSrcjars android.Paths
- modeInfos map[string]android.ModeInfo
}
type AconfigDeclarationsGroupProperties struct {
@@ -77,63 +71,45 @@
ctx.AddDependency(ctx.Module(), rustAconfigLibraryTag, adg.properties.Rust_aconfig_libraries...)
}
-func (adg *AconfigDeclarationsGroup) VisitDeps(ctx android.ModuleContext) {
- adg.modeInfos = make(map[string]android.ModeInfo)
+func (adg *AconfigDeclarationsGroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+ modeInfos := make(map[string]android.ModeInfo)
+ var aconfigDeclarationNames []string
+ var intermediateCacheOutputPaths android.Paths
+ var javaSrcjars android.Paths
ctx.VisitDirectDeps(func(dep android.Module) {
tag := ctx.OtherModuleDependencyTag(dep)
if provider, ok := android.OtherModuleProvider(ctx, dep, android.CodegenInfoProvider); ok {
// aconfig declaration names and cache files are collected for all aconfig library dependencies
- adg.aconfigDeclarationNames = append(adg.aconfigDeclarationNames, provider.AconfigDeclarations...)
- adg.intermediateCacheOutputPaths = append(adg.intermediateCacheOutputPaths, provider.IntermediateCacheOutputPaths...)
+ aconfigDeclarationNames = append(aconfigDeclarationNames, provider.AconfigDeclarations...)
+ intermediateCacheOutputPaths = append(intermediateCacheOutputPaths, provider.IntermediateCacheOutputPaths...)
switch tag {
case aconfigDeclarationsGroupTag:
// Will retrieve outputs from another language codegen modules when support is added
- adg.javaSrcjars = append(adg.javaSrcjars, provider.Srcjars...)
- maps.Copy(adg.modeInfos, provider.ModeInfos)
+ javaSrcjars = append(javaSrcjars, provider.Srcjars...)
+ maps.Copy(modeInfos, provider.ModeInfos)
case javaAconfigLibraryTag:
- adg.javaSrcjars = append(adg.javaSrcjars, provider.Srcjars...)
- maps.Copy(adg.modeInfos, provider.ModeInfos)
+ javaSrcjars = append(javaSrcjars, provider.Srcjars...)
+ maps.Copy(modeInfos, provider.ModeInfos)
case ccAconfigLibraryTag:
- maps.Copy(adg.modeInfos, provider.ModeInfos)
+ maps.Copy(modeInfos, provider.ModeInfos)
case rustAconfigLibraryTag:
- maps.Copy(adg.modeInfos, provider.ModeInfos)
+ maps.Copy(modeInfos, provider.ModeInfos)
}
}
})
-}
-func (adg *AconfigDeclarationsGroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- adg.VisitDeps(ctx)
- adg.aconfigDeclarationNames = android.FirstUniqueStrings(adg.aconfigDeclarationNames)
- adg.intermediateCacheOutputPaths = android.FirstUniquePaths(adg.intermediateCacheOutputPaths)
+ aconfigDeclarationNames = android.FirstUniqueStrings(aconfigDeclarationNames)
+ intermediateCacheOutputPaths = android.FirstUniquePaths(intermediateCacheOutputPaths)
android.SetProvider(ctx, android.CodegenInfoProvider, android.CodegenInfo{
- AconfigDeclarations: adg.aconfigDeclarationNames,
- IntermediateCacheOutputPaths: adg.intermediateCacheOutputPaths,
- Srcjars: adg.javaSrcjars,
- ModeInfos: adg.modeInfos,
+ AconfigDeclarations: aconfigDeclarationNames,
+ IntermediateCacheOutputPaths: intermediateCacheOutputPaths,
+ Srcjars: javaSrcjars,
+ ModeInfos: modeInfos,
})
-}
-var _ android.OutputFileProducer = (*AconfigDeclarationsGroup)(nil)
-
-func (adg *AconfigDeclarationsGroup) OutputFiles(tag string) (android.Paths, error) {
- switch tag {
- case "":
- return adg.intermediateCacheOutputPaths, nil
- case ".srcjars":
- return adg.javaSrcjars, nil
- default:
- return nil, fmt.Errorf("unsupported module reference tag %s", tag)
- }
-}
-
-func (adg *AconfigDeclarationsGroup) Srcjars() android.Paths {
- return adg.javaSrcjars
-}
-
-func (adg *AconfigDeclarationsGroup) AconfigDeclarations() []string {
- return adg.aconfigDeclarationNames
+ ctx.SetOutputFiles(intermediateCacheOutputPaths, "")
+ ctx.SetOutputFiles(javaSrcjars, ".srcjars")
}
diff --git a/aconfig/codegen/java_aconfig_library.go b/aconfig/codegen/java_aconfig_library.go
index 9f42e21..673ac2a 100644
--- a/aconfig/codegen/java_aconfig_library.go
+++ b/aconfig/codegen/java_aconfig_library.go
@@ -15,8 +15,6 @@
package codegen
import (
- "fmt"
-
"android/soong/android"
"android/soong/java"
@@ -80,7 +78,7 @@
// Get the values that came from the global RELEASE_ACONFIG_VALUE_SETS flag
declarationsModules := ctx.GetDirectDepsWithTag(declarationsTag)
if len(declarationsModules) != 1 {
- panic(fmt.Errorf("Exactly one aconfig_declarations property required"))
+ panic("Exactly one aconfig_declarations property required")
}
declarations, _ := android.OtherModuleProvider(ctx, declarationsModules[0], android.AconfigDeclarationsProviderKey)
@@ -133,10 +131,6 @@
return srcJarPath, declarations.IntermediateCacheOutputPath
}
-func (callbacks *JavaAconfigDeclarationsLibraryCallbacks) AconfigDeclarations() *string {
- return proptools.StringPtr(callbacks.properties.Aconfig_declarations)
-}
-
func isModeSupported(mode string) bool {
return android.InList(mode, aconfigSupportedModes)
}
diff --git a/android/image.go b/android/image.go
index bc6b8cd..9cad056 100644
--- a/android/image.go
+++ b/android/image.go
@@ -44,9 +44,8 @@
ExtraImageVariations(ctx BaseModuleContext) []string
// SetImageVariation is called for each newly created image variant. The receiver is the original
- // module, "variation" is the name of the newly created variant and "module" is the newly created
- // variant itself.
- SetImageVariation(ctx BaseModuleContext, variation string, module Module)
+ // module, "variation" is the name of the newly created variant. "variation" is set on the receiver.
+ SetImageVariation(ctx BaseModuleContext, variation string)
}
const (
@@ -106,7 +105,7 @@
mod := ctx.CreateVariations(variations...)
for i, v := range variations {
mod[i].base().setImageVariation(v)
- m.SetImageVariation(ctx, v, mod[i])
+ mod[i].(ImageInterface).SetImageVariation(ctx, v)
}
}
}
diff --git a/android/selects_test.go b/android/selects_test.go
index 6f980ce..3093deb 100644
--- a/android/selects_test.go
+++ b/android/selects_test.go
@@ -778,6 +778,27 @@
my_string_list: &[]string{"a.cpp", "b.cpp", "c.cpp"},
},
},
+ {
+ name: "Test AppendSimpleValue",
+ bp: `
+ my_module_type {
+ name: "foo",
+ my_string_list: ["a.cpp"] + select(soong_config_variable("my_namespace", "my_variable"), {
+ "a": ["a.cpp"],
+ "b": ["b.cpp"],
+ default: ["c.cpp"],
+ }),
+ }
+ `,
+ vendorVars: map[string]map[string]string{
+ "selects_test": {
+ "append_to_string_list": "foo.cpp",
+ },
+ },
+ provider: selectsTestProvider{
+ my_string_list: &[]string{"a.cpp", "c.cpp", "foo.cpp"},
+ },
+ },
}
for _, tc := range testCases {
@@ -892,6 +913,10 @@
}
func (p *selectsMockModule) GenerateAndroidBuildActions(ctx ModuleContext) {
+ toAppend := ctx.Config().VendorConfig("selects_test").String("append_to_string_list")
+ if toAppend != "" {
+ p.properties.My_string_list.AppendSimpleValue([]string{toAppend})
+ }
SetProvider(ctx, selectsTestProviderKey, selectsTestProvider{
my_bool: optionalToPtr(p.properties.My_bool.Get(ctx)),
my_string: optionalToPtr(p.properties.My_string.Get(ctx)),
diff --git a/apex/apex.go b/apex/apex.go
index 180dcb4..c19732e 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1663,12 +1663,12 @@
var _ javaModule = (*java.SdkLibraryImport)(nil)
// apexFileForJavaModule creates an apexFile for a java module's dex implementation jar.
-func apexFileForJavaModule(ctx android.BaseModuleContext, module javaModule) apexFile {
+func apexFileForJavaModule(ctx android.ModuleContext, module javaModule) apexFile {
return apexFileForJavaModuleWithFile(ctx, module, module.DexJarBuildPath(ctx).PathOrNil())
}
// apexFileForJavaModuleWithFile creates an apexFile for a java module with the supplied file.
-func apexFileForJavaModuleWithFile(ctx android.BaseModuleContext, module javaModule, dexImplementationJar android.Path) apexFile {
+func apexFileForJavaModuleWithFile(ctx android.ModuleContext, module javaModule, dexImplementationJar android.Path) apexFile {
dirInApex := "javalib"
af := newApexFile(ctx, dexImplementationJar, module.BaseModuleName(), dirInApex, javaSharedLib, module)
af.jacocoReportClassesFile = module.JacocoReportClassesFile()
@@ -1679,10 +1679,12 @@
if sdkLib, ok := module.(*java.SdkLibrary); ok {
for _, install := range sdkLib.BuiltInstalledForApex() {
af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
+ install.PackageFile(ctx)
}
} else if dexpreopter, ok := module.(java.DexpreopterInterface); ok {
for _, install := range dexpreopter.DexpreoptBuiltInstalledForApex() {
af.requiredModuleNames = append(af.requiredModuleNames, install.FullModuleName())
+ install.PackageFile(ctx)
}
}
return af
diff --git a/apex/prebuilt.go b/apex/prebuilt.go
index 9ad5159..d91943f 100644
--- a/apex/prebuilt.go
+++ b/apex/prebuilt.go
@@ -197,6 +197,7 @@
// If this apex contains a system server jar, then the dexpreopt artifacts should be added as required
for _, install := range p.Dexpreopter.DexpreoptBuiltInstalledForApex() {
p.requiredModuleNames = append(p.requiredModuleNames, install.FullModuleName())
+ install.PackageFile(ctx)
}
}
diff --git a/bpf/bpf.go b/bpf/bpf.go
index 2eb869e..ce00b5b 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -131,7 +131,7 @@
return nil
}
-func (bpf *bpf) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
+func (bpf *bpf) SetImageVariation(ctx android.BaseModuleContext, variation string) {
bpf.properties.VendorInternal = variation == "vendor"
}
diff --git a/cc/cmake_module_cc.txt b/cc/cmake_module_cc.txt
index 693406d..0dc45ae 100644
--- a/cc/cmake_module_cc.txt
+++ b/cc/cmake_module_cc.txt
@@ -1,6 +1,6 @@
<<$srcs := getSources .M>>
<<$includeDirs := getIncludeDirs .Ctx .M>>
-<<$cflags := (getCompilerProperties .M).Cflags>>
+<<$cflags := getCflagsProperty .Ctx .M>>
<<$deps := mapLibraries .Ctx .M (concat5
(getLinkerProperties .M).Whole_static_libs
(getLinkerProperties .M).Static_libs
diff --git a/cc/cmake_snapshot.go b/cc/cmake_snapshot.go
index ad7beed..b4d1268 100644
--- a/cc/cmake_snapshot.go
+++ b/cc/cmake_snapshot.go
@@ -187,6 +187,10 @@
"getCompilerProperties": func(m *Module) BaseCompilerProperties {
return m.compiler.baseCompilerProps()
},
+ "getCflagsProperty": func(ctx android.ModuleContext, m *Module) []string {
+ cflags := m.compiler.baseCompilerProps().Cflags
+ return cflags.GetOrDefault(ctx, nil)
+ },
"getLinkerProperties": func(m *Module) BaseLinkerProperties {
return m.linker.baseLinkerProps()
},
diff --git a/cc/compiler.go b/cc/compiler.go
index ede6a5d..6916394 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -50,7 +50,7 @@
Exclude_srcs []string `android:"path,arch_variant"`
// list of module-specific flags that will be used for C and C++ compiles.
- Cflags []string `android:"arch_variant"`
+ Cflags proptools.Configurable[[]string] `android:"arch_variant"`
// list of module-specific flags that will be used for C++ compiles
Cppflags []string `android:"arch_variant"`
@@ -98,7 +98,7 @@
// list of generated headers to add to the include path. These are the names
// of genrule modules.
- Generated_headers []string `android:"arch_variant,variant_prepend"`
+ Generated_headers proptools.Configurable[[]string] `android:"arch_variant,variant_prepend"`
// pass -frtti instead of -fno-rtti
Rtti *bool `android:"arch_variant"`
@@ -274,7 +274,7 @@
}
func (compiler *baseCompiler) appendCflags(flags []string) {
- compiler.Properties.Cflags = append(compiler.Properties.Cflags, flags...)
+ compiler.Properties.Cflags.AppendSimpleValue(flags)
}
func (compiler *baseCompiler) appendAsflags(flags []string) {
@@ -302,7 +302,7 @@
func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps {
deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...)
deps.GeneratedSources = removeListFromList(deps.GeneratedSources, compiler.Properties.Exclude_generated_sources)
- deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers...)
+ deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers.GetOrDefault(ctx, nil)...)
deps.AidlLibs = append(deps.AidlLibs, compiler.Properties.Aidl.Libs...)
android.ProtoDeps(ctx, &compiler.Proto)
@@ -372,7 +372,8 @@
compiler.srcsBeforeGen = android.PathsForModuleSrcExcludes(ctx, compiler.Properties.Srcs, compiler.Properties.Exclude_srcs)
compiler.srcsBeforeGen = append(compiler.srcsBeforeGen, deps.GeneratedSources...)
- CheckBadCompilerFlags(ctx, "cflags", compiler.Properties.Cflags)
+ cflags := compiler.Properties.Cflags.GetOrDefault(ctx, nil)
+ CheckBadCompilerFlags(ctx, "cflags", cflags)
CheckBadCompilerFlags(ctx, "cppflags", compiler.Properties.Cppflags)
CheckBadCompilerFlags(ctx, "conlyflags", compiler.Properties.Conlyflags)
CheckBadCompilerFlags(ctx, "asflags", compiler.Properties.Asflags)
@@ -385,7 +386,7 @@
esc := proptools.NinjaAndShellEscapeList
- flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Cflags)...)
+ flags.Local.CFlags = append(flags.Local.CFlags, esc(cflags)...)
flags.Local.CppFlags = append(flags.Local.CppFlags, esc(compiler.Properties.Cppflags)...)
flags.Local.ConlyFlags = append(flags.Local.ConlyFlags, esc(compiler.Properties.Conlyflags)...)
flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Asflags)...)
@@ -819,7 +820,7 @@
Header_libs []string `android:"arch_variant,variant_prepend"`
// list of clang flags required to correctly interpret the headers.
- Cflags []string `android:"arch_variant"`
+ Cflags proptools.Configurable[[]string] `android:"arch_variant"`
// list of c++ specific clang flags required to correctly interpret the headers.
// This is provided primarily to make sure cppflags defined in cc_defaults are pulled in.
diff --git a/cc/config/darwin_host.go b/cc/config/darwin_host.go
index 47c61b0..4856669 100644
--- a/cc/config/darwin_host.go
+++ b/cc/config/darwin_host.go
@@ -50,6 +50,8 @@
darwinSupportedSdkVersions = []string{
"11",
"12",
+ "13",
+ "14",
}
darwinAvailableLibraries = append(
diff --git a/cc/genrule.go b/cc/genrule.go
index 431a01c..cabf787 100644
--- a/cc/genrule.go
+++ b/cc/genrule.go
@@ -62,6 +62,8 @@
android.InitApexModule(module)
+ android.InitDefaultableModule(module)
+
return module
}
@@ -114,5 +116,5 @@
return variants
}
-func (g *GenruleExtraProperties) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
+func (g *GenruleExtraProperties) SetImageVariation(ctx android.BaseModuleContext, variation string) {
}
diff --git a/cc/image.go b/cc/image.go
index 08335ba..48a9174 100644
--- a/cc/image.go
+++ b/cc/image.go
@@ -527,30 +527,29 @@
}
}
-func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) {
- m := module.(*Module)
+func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string) {
if variant == android.RamdiskVariation {
- m.MakeAsPlatform()
- squashRamdiskSrcs(m)
+ c.MakeAsPlatform()
+ squashRamdiskSrcs(c)
} else if variant == android.VendorRamdiskVariation {
- m.MakeAsPlatform()
- squashVendorRamdiskSrcs(m)
+ c.MakeAsPlatform()
+ squashVendorRamdiskSrcs(c)
} else if variant == android.RecoveryVariation {
- m.MakeAsPlatform()
- squashRecoverySrcs(m)
+ c.MakeAsPlatform()
+ squashRecoverySrcs(c)
} else if strings.HasPrefix(variant, VendorVariation) {
- m.Properties.ImageVariation = VendorVariation
+ c.Properties.ImageVariation = VendorVariation
if strings.HasPrefix(variant, VendorVariationPrefix) {
- m.Properties.VndkVersion = strings.TrimPrefix(variant, VendorVariationPrefix)
+ c.Properties.VndkVersion = strings.TrimPrefix(variant, VendorVariationPrefix)
}
- squashVendorSrcs(m)
+ squashVendorSrcs(c)
} else if strings.HasPrefix(variant, ProductVariation) {
- m.Properties.ImageVariation = ProductVariation
+ c.Properties.ImageVariation = ProductVariation
if strings.HasPrefix(variant, ProductVariationPrefix) {
- m.Properties.VndkVersion = strings.TrimPrefix(variant, ProductVariationPrefix)
+ c.Properties.VndkVersion = strings.TrimPrefix(variant, ProductVariationPrefix)
}
- squashProductSrcs(m)
+ squashProductSrcs(c)
}
if c.NeedsVendorPublicLibraryVariants() &&
diff --git a/cc/library.go b/cc/library.go
index 67c7bbf..e49f50c 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -149,7 +149,7 @@
Sanitized Sanitized `android:"arch_variant"`
- Cflags []string `android:"arch_variant"`
+ Cflags proptools.Configurable[[]string] `android:"arch_variant"`
Enabled *bool `android:"arch_variant"`
Whole_static_libs []string `android:"arch_variant"`
@@ -464,9 +464,9 @@
}
if library.static() {
- flags.Local.CFlags = append(flags.Local.CFlags, library.StaticProperties.Static.Cflags...)
+ flags.Local.CFlags = append(flags.Local.CFlags, library.StaticProperties.Static.Cflags.GetOrDefault(ctx, nil)...)
} else if library.shared() {
- flags.Local.CFlags = append(flags.Local.CFlags, library.SharedProperties.Shared.Cflags...)
+ flags.Local.CFlags = append(flags.Local.CFlags, library.SharedProperties.Shared.Cflags.GetOrDefault(ctx, nil)...)
}
if library.shared() {
@@ -2066,8 +2066,8 @@
// Check libraries in addition to cflags, since libraries may be exporting different
// include directories.
- if len(staticCompiler.StaticProperties.Static.Cflags) == 0 &&
- len(sharedCompiler.SharedProperties.Shared.Cflags) == 0 &&
+ if len(staticCompiler.StaticProperties.Static.Cflags.GetOrDefault(mctx, nil)) == 0 &&
+ len(sharedCompiler.SharedProperties.Shared.Cflags.GetOrDefault(mctx, nil)) == 0 &&
len(staticCompiler.StaticProperties.Static.Whole_static_libs) == 0 &&
len(sharedCompiler.SharedProperties.Shared.Whole_static_libs) == 0 &&
len(staticCompiler.StaticProperties.Static.Static_libs) == 0 &&
diff --git a/cc/library_stub.go b/cc/library_stub.go
index 746b951..9643ec2 100644
--- a/cc/library_stub.go
+++ b/cc/library_stub.go
@@ -511,5 +511,5 @@
return variations
}
-func (v *CcApiVariant) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
+func (v *CcApiVariant) SetImageVariation(ctx android.BaseModuleContext, variation string) {
}
diff --git a/cmd/release_config/release_config/main.go b/cmd/release_config/release_config/main.go
index bd4ab49..d06b2b7 100644
--- a/cmd/release_config/release_config/main.go
+++ b/cmd/release_config/release_config/main.go
@@ -88,7 +88,7 @@
return
}
// Write the makefile where release_config.mk is going to look for it.
- err = configs.WriteMakefile(makefilePath, targetRelease)
+ err = config.WriteMakefile(makefilePath, targetRelease, configs)
if err != nil {
panic(err)
}
@@ -97,7 +97,7 @@
for _, c := range configs.GetSortedReleaseConfigs() {
if c.Name != targetRelease {
makefilePath = filepath.Join(outputDir, fmt.Sprintf("release_config-%s-%s.varmk", product, c.Name))
- err = configs.WriteMakefile(makefilePath, c.Name)
+ err = config.WriteMakefile(makefilePath, c.Name, configs)
if err != nil {
panic(err)
}
diff --git a/cmd/release_config/release_config_lib/Android.bp b/cmd/release_config/release_config_lib/Android.bp
index 0c67e11..17251bd 100644
--- a/cmd/release_config/release_config_lib/Android.bp
+++ b/cmd/release_config/release_config_lib/Android.bp
@@ -24,6 +24,7 @@
"golang-protobuf-reflect-protoreflect",
"golang-protobuf-runtime-protoimpl",
"soong-cmd-release_config-proto",
+ "blueprint-pathtools",
],
srcs: [
"flag_artifact.go",
diff --git a/cmd/release_config/release_config_lib/flag_artifact.go b/cmd/release_config/release_config_lib/flag_artifact.go
index 6d36595..6cdde7c 100644
--- a/cmd/release_config/release_config_lib/flag_artifact.go
+++ b/cmd/release_config/release_config_lib/flag_artifact.go
@@ -82,6 +82,15 @@
return &ret
}
+func (fas *FlagArtifacts) SortedFlagNames() []string {
+ var names []string
+ for k, _ := range *fas {
+ names = append(names, k)
+ }
+ slices.Sort(names)
+ return names
+}
+
func (fa *FlagArtifact) GenerateFlagDeclarationArtifact() *rc_proto.FlagDeclarationArtifact {
ret := &rc_proto.FlagDeclarationArtifact{
Name: fa.FlagDeclaration.Name,
@@ -135,9 +144,11 @@
value := &rc_proto.Value{}
proto.Merge(value, src.Value)
return &FlagArtifact{
- FlagDeclaration: src.FlagDeclaration,
- Traces: src.Traces,
- Value: value,
+ FlagDeclaration: src.FlagDeclaration,
+ Traces: src.Traces,
+ Value: value,
+ DeclarationIndex: src.DeclarationIndex,
+ Redacted: src.Redacted,
}
}
diff --git a/cmd/release_config/release_config_lib/release_config.go b/cmd/release_config/release_config_lib/release_config.go
index 02b693c..f0ce1bb 100644
--- a/cmd/release_config/release_config_lib/release_config.go
+++ b/cmd/release_config/release_config_lib/release_config.go
@@ -17,6 +17,7 @@
import (
"cmp"
"fmt"
+ "os"
"path/filepath"
"regexp"
"slices"
@@ -169,8 +170,12 @@
if err != nil {
return err
}
- iConfig.GenerateReleaseConfig(configs)
- if err := config.InheritConfig(iConfig); err != nil {
+ err = iConfig.GenerateReleaseConfig(configs)
+ if err != nil {
+ return err
+ }
+ err = config.InheritConfig(iConfig)
+ if err != nil {
return err
}
}
@@ -310,6 +315,74 @@
return nil
}
+// Write the makefile for this targetRelease.
+func (config *ReleaseConfig) WriteMakefile(outFile, targetRelease string, configs *ReleaseConfigs) error {
+ makeVars := make(map[string]string)
+
+ myFlagArtifacts := config.FlagArtifacts.Clone()
+ // Sort the flags by name first.
+ names := myFlagArtifacts.SortedFlagNames()
+ partitions := make(map[string][]string)
+
+ vNames := []string{}
+ addVar := func(name, suffix, value string) {
+ fullName := fmt.Sprintf("_ALL_RELEASE_FLAGS.%s.%s", name, suffix)
+ vNames = append(vNames, fullName)
+ makeVars[fullName] = value
+ }
+
+ for _, name := range names {
+ flag := myFlagArtifacts[name]
+ decl := flag.FlagDeclaration
+
+ for _, container := range decl.Containers {
+ partitions[container] = append(partitions[container], name)
+ }
+ value := MarshalValue(flag.Value)
+ makeVars[name] = value
+ addVar(name, "TYPE", ValueType(flag.Value))
+ addVar(name, "PARTITIONS", strings.Join(decl.Containers, " "))
+ addVar(name, "DEFAULT", MarshalValue(decl.Value))
+ addVar(name, "VALUE", value)
+ addVar(name, "DECLARED_IN", *flag.Traces[0].Source)
+ addVar(name, "SET_IN", *flag.Traces[len(flag.Traces)-1].Source)
+ addVar(name, "NAMESPACE", *decl.Namespace)
+ }
+ pNames := []string{}
+ for k := range partitions {
+ pNames = append(pNames, k)
+ }
+ slices.Sort(pNames)
+
+ // Now sort the make variables, and output them.
+ slices.Sort(vNames)
+
+ // Write the flags as:
+ // _ALL_RELELASE_FLAGS
+ // _ALL_RELEASE_FLAGS.PARTITIONS.*
+ // all _ALL_RELEASE_FLAGS.*, sorted by name
+ // Final flag values, sorted by name.
+ data := fmt.Sprintf("# TARGET_RELEASE=%s\n", config.Name)
+ if targetRelease != config.Name {
+ data += fmt.Sprintf("# User specified TARGET_RELEASE=%s\n", targetRelease)
+ }
+ // As it stands this list is not per-product, but conceptually it is, and will be.
+ data += fmt.Sprintf("ALL_RELEASE_CONFIGS_FOR_PRODUCT :=$= %s\n", strings.Join(configs.GetAllReleaseNames(), " "))
+ data += fmt.Sprintf("_used_files := %s\n", strings.Join(config.GetSortedFileList(), " "))
+ data += fmt.Sprintf("_ALL_RELEASE_FLAGS :=$= %s\n", strings.Join(names, " "))
+ for _, pName := range pNames {
+ data += fmt.Sprintf("_ALL_RELEASE_FLAGS.PARTITIONS.%s :=$= %s\n", pName, strings.Join(partitions[pName], " "))
+ }
+ for _, vName := range vNames {
+ data += fmt.Sprintf("%s :=$= %s\n", vName, makeVars[vName])
+ }
+ data += "\n\n# Values for all build flags\n"
+ for _, name := range names {
+ data += fmt.Sprintf("%s :=$= %s\n", name, makeVars[name])
+ }
+ return os.WriteFile(outFile, []byte(data), 0644)
+}
+
func (config *ReleaseConfig) WritePartitionBuildFlags(outDir string) error {
var err error
for partition, flags := range config.PartitionBuildFlags {
diff --git a/cmd/release_config/release_config_lib/release_configs.go b/cmd/release_config/release_config_lib/release_configs.go
index 052cde8..f2e1388 100644
--- a/cmd/release_config/release_config_lib/release_configs.go
+++ b/cmd/release_config/release_config_lib/release_configs.go
@@ -395,94 +395,10 @@
allReleaseNames = append(allReleaseNames, v.Name)
allReleaseNames = append(allReleaseNames, v.OtherNames...)
}
- slices.SortFunc(allReleaseNames, func(a, b string) int {
- return cmp.Compare(a, b)
- })
+ slices.Sort(allReleaseNames)
return allReleaseNames
}
-// Write the makefile for this targetRelease.
-func (configs *ReleaseConfigs) WriteMakefile(outFile, targetRelease string) error {
- makeVars := make(map[string]string)
- config, err := configs.GetReleaseConfig(targetRelease)
- if err != nil {
- return err
- }
-
- myFlagArtifacts := config.FlagArtifacts.Clone()
- // Sort the flags by name first.
- names := []string{}
- for k, _ := range myFlagArtifacts {
- names = append(names, k)
- }
- slices.SortFunc(names, func(a, b string) int {
- return cmp.Compare(a, b)
- })
- partitions := make(map[string][]string)
-
- vNames := []string{}
- addVar := func(name, suffix, value string) {
- fullName := fmt.Sprintf("_ALL_RELEASE_FLAGS.%s.%s", name, suffix)
- vNames = append(vNames, fullName)
- makeVars[fullName] = value
- }
-
- for _, name := range names {
- flag := myFlagArtifacts[name]
- decl := flag.FlagDeclaration
-
- for _, container := range decl.Containers {
- partitions[container] = append(partitions[container], name)
- }
- value := MarshalValue(flag.Value)
- makeVars[name] = value
- addVar(name, "TYPE", ValueType(flag.Value))
- addVar(name, "PARTITIONS", strings.Join(decl.Containers, " "))
- addVar(name, "DEFAULT", MarshalValue(decl.Value))
- addVar(name, "VALUE", value)
- addVar(name, "DECLARED_IN", *flag.Traces[0].Source)
- addVar(name, "SET_IN", *flag.Traces[len(flag.Traces)-1].Source)
- addVar(name, "NAMESPACE", *decl.Namespace)
- }
- pNames := []string{}
- for k := range partitions {
- pNames = append(pNames, k)
- }
- slices.SortFunc(pNames, func(a, b string) int {
- return cmp.Compare(a, b)
- })
-
- // Now sort the make variables, and output them.
- slices.SortFunc(vNames, func(a, b string) int {
- return cmp.Compare(a, b)
- })
-
- // Write the flags as:
- // _ALL_RELELASE_FLAGS
- // _ALL_RELEASE_FLAGS.PARTITIONS.*
- // all _ALL_RELEASE_FLAGS.*, sorted by name
- // Final flag values, sorted by name.
- data := fmt.Sprintf("# TARGET_RELEASE=%s\n", config.Name)
- if targetRelease != config.Name {
- data += fmt.Sprintf("# User specified TARGET_RELEASE=%s\n", targetRelease)
- }
- // As it stands this list is not per-product, but conceptually it is, and will be.
- data += fmt.Sprintf("ALL_RELEASE_CONFIGS_FOR_PRODUCT :=$= %s\n", strings.Join(configs.GetAllReleaseNames(), " "))
- data += fmt.Sprintf("_used_files := %s\n", strings.Join(config.GetSortedFileList(), " "))
- data += fmt.Sprintf("_ALL_RELEASE_FLAGS :=$= %s\n", strings.Join(names, " "))
- for _, pName := range pNames {
- data += fmt.Sprintf("_ALL_RELEASE_FLAGS.PARTITIONS.%s :=$= %s\n", pName, strings.Join(partitions[pName], " "))
- }
- for _, vName := range vNames {
- data += fmt.Sprintf("%s :=$= %s\n", vName, makeVars[vName])
- }
- data += "\n\n# Values for all build flags\n"
- for _, name := range names {
- data += fmt.Sprintf("%s :=$= %s\n", name, makeVars[name])
- }
- return os.WriteFile(outFile, []byte(data), 0644)
-}
-
func (configs *ReleaseConfigs) GenerateReleaseConfigs(targetRelease string) error {
otherNames := make(map[string][]string)
for aliasName, aliasTarget := range configs.Aliases {
diff --git a/cmd/release_config/release_config_lib/util.go b/cmd/release_config/release_config_lib/util.go
index 0a19efe..9919c70 100644
--- a/cmd/release_config/release_config_lib/util.go
+++ b/cmd/release_config/release_config_lib/util.go
@@ -25,6 +25,7 @@
"slices"
"strings"
+ "github.com/google/blueprint/pathtools"
"google.golang.org/protobuf/encoding/prototext"
"google.golang.org/protobuf/proto"
)
@@ -101,7 +102,7 @@
if err != nil {
return err
}
- return os.WriteFile(path, data, 0644)
+ return pathtools.WriteFileIfChanged(path, data, 0644)
}
// Read a message from a file.
diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go
index c1a0b9c..2075488 100644
--- a/etc/prebuilt_etc.go
+++ b/etc/prebuilt_etc.go
@@ -241,7 +241,7 @@
return nil
}
-func (p *PrebuiltEtc) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
+func (p *PrebuiltEtc) SetImageVariation(ctx android.BaseModuleContext, variation string) {
}
func (p *PrebuiltEtc) SourceFilePath(ctx android.ModuleContext) android.Path {
@@ -268,17 +268,6 @@
return p.outputFilePaths[0]
}
-var _ android.OutputFileProducer = (*PrebuiltEtc)(nil)
-
-func (p *PrebuiltEtc) OutputFiles(tag string) (android.Paths, error) {
- switch tag {
- case "":
- return p.outputFilePaths.Paths(), nil
- default:
- return nil, fmt.Errorf("unsupported module reference tag %q", tag)
- }
-}
-
func (p *PrebuiltEtc) SubDir() string {
if subDir := proptools.String(p.subdirProperties.Sub_dir); subDir != "" {
return subDir
@@ -420,6 +409,8 @@
for _, ip := range installs {
ip.addInstallRules(ctx)
}
+
+ ctx.SetOutputFiles(p.outputFilePaths.Paths(), "")
}
type installProperties struct {
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 26dad01..06a7e18 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -650,7 +650,7 @@
func (x noopImageInterface) DebugRamdiskVariantNeeded(android.BaseModuleContext) bool { return false }
func (x noopImageInterface) RecoveryVariantNeeded(android.BaseModuleContext) bool { return false }
func (x noopImageInterface) ExtraImageVariations(ctx android.BaseModuleContext) []string { return nil }
-func (x noopImageInterface) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
+func (x noopImageInterface) SetImageVariation(ctx android.BaseModuleContext, variation string) {
}
func NewGenSrcs() *Module {
diff --git a/java/base.go b/java/base.go
index 1a6584b..49214d8 100644
--- a/java/base.go
+++ b/java/base.go
@@ -2544,7 +2544,7 @@
case Implementation:
return RenameUseInclude, "info"
default:
- //fmt.Printf("LJ: %v -> %v StubsLinkType unknown\n", module, m)
+ //fmt.Printf("collectDirectDepsProviders: %v -> %v StubsLinkType unknown\n", module, m)
// Fall through to the heuristic logic.
}
switch reflect.TypeOf(m).String() {
diff --git a/java/dexpreopt.go b/java/dexpreopt.go
index 57aaa1a..7949244 100644
--- a/java/dexpreopt.go
+++ b/java/dexpreopt.go
@@ -96,6 +96,10 @@
}
}
+func (install dexpreopterInstall) PackageFile(ctx android.ModuleContext) android.PackagingSpec {
+ return ctx.PackageFile(install.installDirOnDevice, install.installFileOnDevice, install.outputPathOnHost)
+}
+
type Dexpreopter struct {
dexpreopter
}
@@ -541,10 +545,18 @@
// Use the path of the dex file to determine the library name
isApexSystemServerJar := global.AllApexSystemServerJars(ctx).ContainsJar(dexJarStem)
- partition := d.installPath.Partition()
+ dexpreoptPartition := d.installPath.Partition()
+ // dexpreoptPartition is set to empty for dexpreopts of system APEX and system_other.
+ // In case of system APEX, however, we can set it to "system" manually.
+ // TODO(b/346662300): Let dexpreopter generate the installPath for dexpreopt files instead of
+ // using the dex location to generate the installPath.
+ if isApexSystemServerJar {
+ dexpreoptPartition = "system"
+ }
for _, install := range dexpreoptRule.Installs() {
// Remove the "/" prefix because the path should be relative to $ANDROID_PRODUCT_OUT.
installDir := strings.TrimPrefix(filepath.Dir(install.To), "/")
+ partition := dexpreoptPartition
if strings.HasPrefix(installDir, partition+"/") {
installDir = strings.TrimPrefix(installDir, partition+"/")
} else {
diff --git a/rust/bindgen.go b/rust/bindgen.go
index 4277753..83a6e95 100644
--- a/rust/bindgen.go
+++ b/rust/bindgen.go
@@ -236,7 +236,8 @@
esc := proptools.NinjaAndShellEscapeList
// Filter out invalid cflags
- for _, flag := range b.ClangProperties.Cflags {
+ cflagsProp := b.ClangProperties.Cflags.GetOrDefault(ctx, nil)
+ for _, flag := range cflagsProp {
if flag == "-x c++" || flag == "-xc++" {
ctx.PropertyErrorf("cflags",
"-x c++ should not be specified in cflags; setting cpp_std specifies this is a C++ header, or change the file extension to '.hpp' or '.hh'")
@@ -248,7 +249,7 @@
}
// Module defined clang flags and include paths
- cflags = append(cflags, esc(b.ClangProperties.Cflags)...)
+ cflags = append(cflags, esc(cflagsProp)...)
for _, include := range b.ClangProperties.Local_include_dirs {
cflags = append(cflags, "-I"+android.PathForModuleSrc(ctx, include).String())
implicits = append(implicits, android.PathForModuleSrc(ctx, include))
diff --git a/rust/image.go b/rust/image.go
index e0d267d..fec6d92 100644
--- a/rust/image.go
+++ b/rust/image.go
@@ -197,21 +197,20 @@
return mod.InVendor() || mod.InProduct()
}
-func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) {
- m := module.(*Module)
+func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant string) {
if variant == android.VendorRamdiskVariation {
- m.MakeAsPlatform()
+ mod.MakeAsPlatform()
} else if variant == android.RecoveryVariation {
- m.MakeAsPlatform()
+ mod.MakeAsPlatform()
} else if strings.HasPrefix(variant, cc.VendorVariation) {
- m.Properties.ImageVariation = cc.VendorVariation
+ mod.Properties.ImageVariation = cc.VendorVariation
if strings.HasPrefix(variant, cc.VendorVariationPrefix) {
- m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.VendorVariationPrefix)
+ mod.Properties.VndkVersion = strings.TrimPrefix(variant, cc.VendorVariationPrefix)
}
} else if strings.HasPrefix(variant, cc.ProductVariation) {
- m.Properties.ImageVariation = cc.ProductVariation
+ mod.Properties.ImageVariation = cc.ProductVariation
if strings.HasPrefix(variant, cc.ProductVariationPrefix) {
- m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.ProductVariationPrefix)
+ mod.Properties.VndkVersion = strings.TrimPrefix(variant, cc.ProductVariationPrefix)
}
}
}
diff --git a/sh/sh_binary.go b/sh/sh_binary.go
index 3a4adc6..48a442d 100644
--- a/sh/sh_binary.go
+++ b/sh/sh_binary.go
@@ -99,6 +99,12 @@
// Make this module available when building for recovery.
Recovery_available *bool
+
+ // The name of the image this module is built for
+ ImageVariation string `blueprint:"mutated"`
+
+ // Suffix for the name of Android.mk entries generated by this module
+ SubName string `blueprint:"mutated"`
}
type TestProperties struct {
@@ -207,15 +213,15 @@
func (s *ShBinary) ImageMutatorBegin(ctx android.BaseModuleContext) {}
func (s *ShBinary) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
- return !s.ModuleBase.InstallInRecovery() && !s.ModuleBase.InstallInRamdisk()
+ return !s.InstallInRecovery() && !s.InstallInRamdisk() && !s.InstallInVendorRamdisk() && !s.ModuleBase.InstallInVendor()
}
func (s *ShBinary) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
- return proptools.Bool(s.properties.Ramdisk_available) || s.ModuleBase.InstallInRamdisk()
+ return proptools.Bool(s.properties.Ramdisk_available) || s.InstallInRamdisk()
}
func (s *ShBinary) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
- return proptools.Bool(s.properties.Vendor_ramdisk_available) || s.ModuleBase.InstallInVendorRamdisk()
+ return proptools.Bool(s.properties.Vendor_ramdisk_available) || s.InstallInVendorRamdisk()
}
func (s *ShBinary) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
@@ -223,14 +229,43 @@
}
func (s *ShBinary) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
- return proptools.Bool(s.properties.Recovery_available) || s.ModuleBase.InstallInRecovery()
+ return proptools.Bool(s.properties.Recovery_available) || s.InstallInRecovery()
}
func (s *ShBinary) ExtraImageVariations(ctx android.BaseModuleContext) []string {
- return nil
+ extraVariations := []string{}
+ if s.InstallInProduct() {
+ extraVariations = append(extraVariations, cc.ProductVariation)
+ }
+ if s.InstallInVendor() {
+ extraVariations = append(extraVariations, cc.VendorVariation)
+ }
+ return extraVariations
}
-func (s *ShBinary) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
+func (s *ShBinary) SetImageVariation(ctx android.BaseModuleContext, variation string) {
+ s.properties.ImageVariation = variation
+}
+
+// Overrides ModuleBase.InstallInRamdisk() so that the install rule respects
+// Ramdisk_available property for ramdisk variant
+func (s *ShBinary) InstallInRamdisk() bool {
+ return s.ModuleBase.InstallInRamdisk() ||
+ (proptools.Bool(s.properties.Ramdisk_available) && s.properties.ImageVariation == android.RamdiskVariation)
+}
+
+// Overrides ModuleBase.InstallInVendorRamdisk() so that the install rule respects
+// Vendor_ramdisk_available property for vendor ramdisk variant
+func (s *ShBinary) InstallInVendorRamdisk() bool {
+ return s.ModuleBase.InstallInVendorRamdisk() ||
+ (proptools.Bool(s.properties.Vendor_ramdisk_available) && s.properties.ImageVariation == android.VendorRamdiskVariation)
+}
+
+// Overrides ModuleBase.InstallInRecovery() so that the install rule respects
+// Recovery_available property for recovery variant
+func (s *ShBinary) InstallInRecovery() bool {
+ return s.ModuleBase.InstallInRecovery() ||
+ (proptools.Bool(s.properties.Recovery_available) && s.properties.ImageVariation == android.RecoveryVariation)
}
func (s *ShBinary) generateAndroidBuildActions(ctx android.ModuleContext) {
@@ -260,11 +295,24 @@
Output: s.outputFilePath,
Input: s.sourceFilePath,
})
+
+ s.properties.SubName = s.GetSubname(ctx)
+
android.SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: []string{s.sourceFilePath.String()}})
ctx.SetOutputFiles(android.Paths{s.outputFilePath}, "")
}
+func (s *ShBinary) GetSubname(ctx android.ModuleContext) string {
+ ret := ""
+ if s.properties.ImageVariation != "" {
+ if s.properties.ImageVariation != cc.VendorVariation {
+ ret = "." + s.properties.ImageVariation
+ }
+ }
+ return ret
+}
+
func (s *ShBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
s.generateAndroidBuildActions(ctx)
installDir := android.PathForModuleInstall(ctx, "bin", proptools.String(s.properties.Sub_dir))
@@ -278,7 +326,7 @@
}
func (s *ShBinary) AndroidMkEntries() []android.AndroidMkEntries {
- return []android.AndroidMkEntries{android.AndroidMkEntries{
+ return []android.AndroidMkEntries{{
Class: "EXECUTABLES",
OutputFile: android.OptionalPathForPath(s.outputFilePath),
Include: "$(BUILD_SYSTEM)/soong_cc_rust_prebuilt.mk",
@@ -289,6 +337,7 @@
entries.SetBoolIfTrue("LOCAL_UNINSTALLABLE_MODULE", !s.Installable())
},
},
+ SubName: s.properties.SubName,
}}
}
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go
index b9b68be..84f20c5 100644
--- a/sysprop/sysprop_library.go
+++ b/sysprop/sysprop_library.go
@@ -49,8 +49,6 @@
android.ModuleBase
properties syspropGenProperties
-
- genSrcjars android.Paths
}
type syspropRustGenRule struct {
@@ -59,7 +57,6 @@
properties rustLibraryProperties
}
-var _ android.OutputFileProducer = (*syspropJavaGenRule)(nil)
var _ rust.SourceProvider = (*syspropRustGenRule)(nil)
var (
@@ -100,6 +97,7 @@
}
})
+ var genSrcjars android.Paths
for _, syspropFile := range android.PathsForModuleSrc(ctx, g.properties.Srcs) {
srcJarFile := android.GenPathWithExt(ctx, "sysprop", syspropFile, "srcjar")
@@ -114,8 +112,10 @@
},
})
- g.genSrcjars = append(g.genSrcjars, srcJarFile)
+ genSrcjars = append(genSrcjars, srcJarFile)
}
+
+ ctx.SetOutputFiles(genSrcjars, "")
}
func (g *syspropJavaGenRule) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -124,15 +124,6 @@
ctx.AddFarVariationDependencies(nil, nil, proptools.String(g.properties.Check_api))
}
-func (g *syspropJavaGenRule) OutputFiles(tag string) (android.Paths, error) {
- switch tag {
- case "":
- return g.genSrcjars, nil
- default:
- return nil, fmt.Errorf("unsupported module reference tag %q", tag)
- }
-}
-
func syspropJavaGenFactory() android.Module {
g := &syspropJavaGenRule{}
g.AddProperties(&g.properties)
diff --git a/ui/build/androidmk_denylist.go b/ui/build/androidmk_denylist.go
index a29f413..bbac2db 100644
--- a/ui/build/androidmk_denylist.go
+++ b/ui/build/androidmk_denylist.go
@@ -19,10 +19,13 @@
)
var androidmk_denylist []string = []string{
+ "bionic/",
"chained_build_config/",
"cts/",
"dalvik/",
"developers/",
+ "development/",
+ "device/sample/",
"frameworks/",
// Do not block other directories in kernel/, see b/319658303.
"kernel/configs/",
@@ -31,6 +34,10 @@
"libcore/",
"libnativehelper/",
"pdk/",
+ "prebuilts/",
+ "sdk/",
+ "test/",
+ "trusty/",
// Add back toolchain/ once defensive Android.mk files are removed
//"toolchain/",
}