diff options
| -rw-r--r-- | Android.bp | 1 | ||||
| -rw-r--r-- | android/build_prop.go | 8 | ||||
| -rw-r--r-- | android/config.go | 4 | ||||
| -rw-r--r-- | android/licenses.go | 23 | ||||
| -rw-r--r-- | android/variable.go | 1 | ||||
| -rw-r--r-- | etc/prebuilt_etc.go | 33 | ||||
| -rw-r--r-- | fsgen/filesystem_creator.go | 24 | ||||
| -rw-r--r-- | scripts/gen_build_prop.py | 6 |
8 files changed, 91 insertions, 9 deletions
diff --git a/Android.bp b/Android.bp index d0f97db2a..cbe1c7b3f 100644 --- a/Android.bp +++ b/Android.bp @@ -164,6 +164,7 @@ product_config { name: "product_config", visibility: [ "//build/make/target/product/generic", + "//build/soong/fsgen", ], } diff --git a/android/build_prop.go b/android/build_prop.go index ede93ed20..7c3c50645 100644 --- a/android/build_prop.go +++ b/android/build_prop.go @@ -20,7 +20,7 @@ import ( func init() { ctx := InitRegistrationContext - ctx.RegisterModuleType("build_prop", buildPropFactory) + ctx.RegisterModuleType("build_prop", BuildPropFactory) } type buildPropProperties struct { @@ -65,6 +65,9 @@ func (p *buildPropModule) propFiles(ctx ModuleContext) Paths { return ctx.Config().ProductPropFiles(ctx) } else if partition == "odm" { return ctx.Config().OdmPropFiles(ctx) + } else if partition == "vendor" { + // TODO (b/375500423): Add android-info.txt to prop files + return ctx.Config().VendorPropFiles(ctx) } return nil } @@ -104,6 +107,7 @@ var validPartitions = []string{ "system_ext", "product", "odm", + "vendor", } func (p *buildPropModule) GenerateAndroidBuildActions(ctx ModuleContext) { @@ -187,7 +191,7 @@ func (p *buildPropModule) AndroidMkEntries() []AndroidMkEntries { // build_prop module generates {partition}/build.prop file. At first common build properties are // printed based on Soong config variables. And then prop_files are printed as-is. Finally, // post_process_props tool is run to check if the result build.prop is valid or not. -func buildPropFactory() Module { +func BuildPropFactory() Module { module := &buildPropModule{} module.AddProperties(&module.properties) InitAndroidArchModule(module, DeviceSupported, MultilibCommon) diff --git a/android/config.go b/android/config.go index 1e518406a..feed22f6a 100644 --- a/android/config.go +++ b/android/config.go @@ -2195,6 +2195,10 @@ func (c *config) OdmPropFiles(ctx PathContext) Paths { return PathsForSource(ctx, c.productVariables.OdmPropFiles) } +func (c *config) VendorPropFiles(ctx PathContext) Paths { + return PathsForSource(ctx, c.productVariables.VendorPropFiles) +} + func (c *config) ExtraAllowedDepsTxt() string { return String(c.productVariables.ExtraAllowedDepsTxt) } diff --git a/android/licenses.go b/android/licenses.go index 949d67845..53d055588 100644 --- a/android/licenses.go +++ b/android/licenses.go @@ -15,7 +15,10 @@ package android import ( + "fmt" + "path/filepath" "reflect" + "strings" "sync" "github.com/google/blueprint" @@ -155,7 +158,25 @@ func licensesPropertyGatherer(ctx BottomUpMutatorContext) { } licenses := getLicenses(ctx, m) - ctx.AddVariationDependencies(nil, licensesTag, licenses...) + + var fullyQualifiedLicenseNames []string + for _, license := range licenses { + fullyQualifiedLicenseName := license + if !strings.HasPrefix(license, "//") { + licenseModuleDir := ctx.OtherModuleDir(m) + for licenseModuleDir != "." && !ctx.OtherModuleExists(fmt.Sprintf("//%s:%s", licenseModuleDir, license)) { + licenseModuleDir = filepath.Dir(licenseModuleDir) + } + if licenseModuleDir == "." { + fullyQualifiedLicenseName = license + } else { + fullyQualifiedLicenseName = fmt.Sprintf("//%s:%s", licenseModuleDir, license) + } + } + fullyQualifiedLicenseNames = append(fullyQualifiedLicenseNames, fullyQualifiedLicenseName) + } + + ctx.AddVariationDependencies(nil, licensesTag, fullyQualifiedLicenseNames...) } // Verifies the license and license_kind dependencies are each the correct kind of module. diff --git a/android/variable.go b/android/variable.go index c35294200..6693d9197 100644 --- a/android/variable.go +++ b/android/variable.go @@ -521,6 +521,7 @@ type ProductVariables struct { SystemExtPropFiles []string `json:",omitempty"` ProductPropFiles []string `json:",omitempty"` OdmPropFiles []string `json:",omitempty"` + VendorPropFiles []string `json:",omitempty"` EnableUffdGc *string `json:",omitempty"` diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go index f17a5ded9..ce72fed18 100644 --- a/etc/prebuilt_etc.go +++ b/etc/prebuilt_etc.go @@ -66,6 +66,9 @@ func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("prebuilt_rfsa", PrebuiltRFSAFactory) ctx.RegisterModuleType("prebuilt_renderscript_bitcode", PrebuiltRenderScriptBitcodeFactory) ctx.RegisterModuleType("prebuilt_media_audio", PrebuiltMediaAudioFactory) + ctx.RegisterModuleType("prebuilt_voicepack", PrebuiltVoicepackFactory) + ctx.RegisterModuleType("prebuilt_bin", PrebuiltBinaryFactory) + ctx.RegisterModuleType("prebuilt_wallpaper", PrebuiltWallpaperFactory) ctx.RegisterModuleType("prebuilt_defaults", defaultsFactory) @@ -799,3 +802,33 @@ func PrebuiltMediaAudioFactory() android.Module { android.InitDefaultableModule(module) return module } + +// prebuilt_voicepack installs voice pack files in <partition>/tts directory. +func PrebuiltVoicepackFactory() android.Module { + module := &PrebuiltEtc{} + InitPrebuiltEtcModule(module, "tts") + // This module is device-only + android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon) + android.InitDefaultableModule(module) + return module +} + +// prebuilt_bin installs files in <partition>/bin directory. +func PrebuiltBinaryFactory() android.Module { + module := &PrebuiltEtc{} + InitPrebuiltEtcModule(module, "bin") + // This module is device-only + android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) + android.InitDefaultableModule(module) + return module +} + +// prebuilt_wallpaper installs image files in <partition>/wallpaper directory. +func PrebuiltWallpaperFactory() android.Module { + module := &PrebuiltEtc{} + InitPrebuiltEtcModule(module, "wallpaper") + // This module is device-only + android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibCommon) + android.InitDefaultableModule(module) + return module +} diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go index 39572d4c3..766176d5a 100644 --- a/fsgen/filesystem_creator.go +++ b/fsgen/filesystem_creator.go @@ -139,8 +139,9 @@ func createFsGenState(ctx android.LoadHookContext) *FsGenState { "update_engine_sideload": defaultDepCandidateProps(ctx.Config()), }, "vendor": &map[string]*depCandidateProps{ - "fs_config_files_vendor": defaultDepCandidateProps(ctx.Config()), - "fs_config_dirs_vendor": defaultDepCandidateProps(ctx.Config()), + "fs_config_files_vendor": defaultDepCandidateProps(ctx.Config()), + "fs_config_dirs_vendor": defaultDepCandidateProps(ctx.Config()), + generatedModuleName(ctx.Config(), "vendor-build.prop"): defaultDepCandidateProps(ctx.Config()), }, "odm": newMultilibDeps(), "product": newMultilibDeps(), @@ -481,6 +482,25 @@ func (f *filesystemCreator) createPartition(ctx android.LoadHookContext, partiti module = ctx.CreateModule(filesystem.FilesystemFactory, baseProps, fsProps) } module.HideFromMake() + if partitionType == "vendor" { + // Create a build prop for vendor + vendorBuildProps := &struct { + Name *string + Vendor *bool + Stem *string + Product_config *string + }{ + Name: proptools.StringPtr(generatedModuleName(ctx.Config(), "vendor-build.prop")), + Vendor: proptools.BoolPtr(true), + Stem: proptools.StringPtr("build.prop"), + Product_config: proptools.StringPtr(":product_config"), + } + vendorBuildProp := ctx.CreateModule( + android.BuildPropFactory, + vendorBuildProps, + ) + vendorBuildProp.HideFromMake() + } return true } diff --git a/scripts/gen_build_prop.py b/scripts/gen_build_prop.py index df9e98d1e..e0686ed19 100644 --- a/scripts/gen_build_prop.py +++ b/scripts/gen_build_prop.py @@ -524,7 +524,6 @@ def build_system_ext_prop(args): build_prop(args, gen_build_info=False, gen_common_build_props=True, variables=variables) -''' def build_vendor_prop(args): config = args.config @@ -541,7 +540,6 @@ def build_vendor_prop(args): ] build_prop(args, gen_build_info=False, gen_common_build_props=True, variables=variables) -''' def build_product_prop(args): config = args.config @@ -608,8 +606,8 @@ def main(): build_odm_prop(args) case "product": build_product_prop(args) - # case "vendor": # NOT IMPLEMENTED - # build_vendor_prop(args) + case "vendor": + build_vendor_prop(args) case _: sys.exit(f"not supported partition {args.partition}") |