diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-10-31 23:39:24 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-31 23:39:24 +0000 |
commit | 76530ec6f7597a477785cb9ae8e7821a18c0bca9 (patch) | |
tree | acee6b99bc59a822afb1ddb8bd84727ba7c37faf | |
parent | 33c252c2f14d61175a6b4e2c4d5b3461d53b0df8 (diff) | |
parent | face4e4563c1694c51b98a6c80f6fd0dbe2c3581 (diff) | |
download | build_soong-76530ec6f7597a477785cb9ae8e7821a18c0bca9.tar.gz build_soong-76530ec6f7597a477785cb9ae8e7821a18c0bca9.tar.bz2 build_soong-76530ec6f7597a477785cb9ae8e7821a18c0bca9.zip |
Merge "Import AAPT-related product variables from make"
-rw-r--r-- | android/config.go | 16 | ||||
-rw-r--r-- | android/variable.go | 21 | ||||
-rw-r--r-- | java/app.go | 4 |
3 files changed, 31 insertions, 10 deletions
diff --git a/android/config.go b/android/config.go index d83bf0a9..56d0a39e 100644 --- a/android/config.go +++ b/android/config.go @@ -468,16 +468,20 @@ func (c *config) BuildNumber() string { return "000000" } -func (c *config) ProductAaptConfig() []string { - return []string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"} +func (c *config) ProductAAPTConfig() []string { + return *c.ProductVariables.AAPTConfig } -func (c *config) ProductAaptPreferredConfig() string { - return "xhdpi" +func (c *config) ProductAAPTPreferredConfig() string { + return *c.ProductVariables.AAPTPreferredConfig } -func (c *config) ProductAaptCharacteristics() string { - return "nosdcard" +func (c *config) ProductAAPTCharacteristics() string { + return *c.ProductVariables.AAPTCharacteristics +} + +func (c *config) ProductAAPTPrebuiltDPI() []string { + return *c.ProductVariables.AAPTPrebuiltDPI } func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath { diff --git a/android/variable.go b/android/variable.go index 16a6b11c..4b3925cc 100644 --- a/android/variable.go +++ b/android/variable.go @@ -132,6 +132,17 @@ type productVariables struct { CrossHostArch *string `json:",omitempty"` CrossHostSecondaryArch *string `json:",omitempty"` + ResourceOverlays *[]string `json:",omitempty"` + EnforceRROTargets *[]string `json:",omitempty"` + EnforceRROExcludedOverlays *[]string `json:",omitempty"` + + AAPTCharacteristics *string `json:",omitempty"` + AAPTConfig *[]string `json:",omitempty"` + AAPTPreferredConfig *string `json:",omitempty"` + AAPTPrebuiltDPI *[]string `json:",omitempty"` + + AppsDefaultVersionName *string `json:",omitempty"` + Allow_missing_dependencies *bool `json:",omitempty"` Unbundled_build *bool `json:",omitempty"` Brillo *bool `json:",omitempty"` @@ -203,8 +214,14 @@ func (v *productVariables) SetDefaultConfig() { DeviceSecondaryArchVariant: stringPtr("armv7-a-neon"), DeviceSecondaryCpuVariant: stringPtr("denver"), DeviceSecondaryAbi: &[]string{"armeabi-v7a"}, - Malloc_not_svelte: boolPtr(false), - Safestack: boolPtr(false), + + AAPTConfig: &[]string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"}, + AAPTPreferredConfig: stringPtr("xhdpi"), + AAPTCharacteristics: stringPtr("nosdcard"), + AAPTPrebuiltDPI: &[]string{"xhdpi", "xxhdpi"}, + + Malloc_not_svelte: boolPtr(false), + Safestack: boolPtr(false), } if runtime.GOOS == "linux" { diff --git a/java/app.go b/java/app.go index e8028a0d..c2e9214b 100644 --- a/java/app.go +++ b/java/app.go @@ -102,7 +102,7 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { if !hasProduct { aaptPackageFlags = append(aaptPackageFlags, - "--product "+ctx.AConfig().ProductAaptCharacteristics()) + "--product "+ctx.AConfig().ProductAAPTCharacteristics()) } a.exportPackage = CreateExportPackage(ctx, aaptPackageFlags, aaptDeps) ctx.CheckbuildFile(a.exportPackage) @@ -132,7 +132,7 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { if !hasProduct { aaptPackageFlags = append(aaptPackageFlags, - "--product "+ctx.AConfig().ProductAaptCharacteristics()) + "--product "+ctx.AConfig().ProductAAPTCharacteristics()) } certificate := a.appProperties.Certificate |