Replace aapt support with aapt2

Use aapt2 instead of aapt to compile Android app resources.
Also generate all files into srcjars instead of individual
sources.

Test: m checkbuild
Change-Id: I5a67991a0daf0017e8159b46fcff7d5564a91468
This commit is contained in:
Colin Cross
2017-11-22 16:19:37 -08:00
parent 0875c52de7
commit 3bc7ffa59b
10 changed files with 498 additions and 198 deletions

View File

@@ -175,7 +175,12 @@ func saveToConfigFile(config jsonConfigurable, filename string) error {
func TestConfig(buildDir string, env map[string]string) Config {
config := &config{
ProductVariables: productVariables{
DeviceName: stringPtr("test_device"),
DeviceName: stringPtr("test_device"),
Platform_sdk_version: intPtr(26),
AAPTConfig: &[]string{"normal", "large", "xlarge", "hdpi", "xhdpi", "xxhdpi"},
AAPTPreferredConfig: stringPtr("xhdpi"),
AAPTCharacteristics: stringPtr("nosdcard"),
AAPTPrebuiltDPI: &[]string{"xhdpi", "xxhdpi"},
},
buildDir: buildDir,
@@ -417,12 +422,11 @@ func (c *config) DeviceUsesClang() bool {
return true
}
func (c *config) ResourceOverlays() []SourcePath {
return nil
}
func (c *config) PlatformVersion() string {
return "M"
func (c *config) ResourceOverlays() []string {
if c.ProductVariables.ResourceOverlays == nil {
return nil
}
return *c.ProductVariables.ResourceOverlays
}
func (c *config) PlatformSdkVersionInt() int {
@@ -445,6 +449,10 @@ func (c *config) DefaultAppTargetSdkInt() int {
}
}
func (c *config) AppsDefaultVersionName() string {
return String(c.ProductVariables.AppsDefaultVersionName)
}
// Codenames that are active in the current lunch target.
func (c *config) PlatformVersionActiveCodenames() []string {
return c.ProductVariables.Platform_version_active_codenames
@@ -466,10 +474,6 @@ func (c *config) PlatformVersionCombinedCodenames() []string {
return combined
}
func (c *config) BuildNumber() string {
return "000000"
}
func (c *config) ProductAAPTConfig() []string {
return *c.ProductVariables.AAPTConfig
}