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

@@ -15,6 +15,8 @@
package config
import (
"path/filepath"
"runtime"
"strings"
_ "github.com/google/blueprint/bootstrap"
@@ -130,4 +132,20 @@ func init() {
})
pctx.HostJavaToolVariable("JacocoCLIJar", "jacoco-cli.jar")
hostBinToolVariableWithPrebuilt := func(name, prebuiltDir, tool string) {
pctx.VariableFunc(name, func(config android.Config) (string, error) {
if config.UnbundledBuild() || config.IsPdkBuild() {
return filepath.Join(prebuiltDir, runtime.GOOS, "bin", tool), nil
} else {
if path, err := pctx.HostBinToolPath(config, tool); err != nil {
return "", err
} else {
return path.String(), nil
}
}
})
}
hostBinToolVariableWithPrebuilt("Aapt2Cmd", "prebuilt/sdk/tools", "aapt2")
}