Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54bdfda2 authored by Roland Levillain's avatar Roland Levillain
Browse files

Use SDK prebuilt 'aapt2' in 'apexer' in source trees without "frameworks/base".

Test: system/apex/apexer/runtests.sh on a master source tree
Test: system/apex/apexer/runtests.sh on a master-art source tree
Bug: 113373927
Bug: 112458021
Change-Id: Ie23eab3f7e4961ebbe011b1fe25ce819f99767a2
parent 2ef8557c
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -81,7 +81,18 @@ var (
func init() {
	pctx.Import("android/soong/common")
	pctx.HostBinToolVariable("apexer", "apexer")
	pctx.HostBinToolVariable("aapt2", "aapt2")
	// ART minimal builds (using the master-art manifest) do not have the "frameworks/base"
	// projects, and hence cannot built 'aapt2'. Use the SDK prebuilt instead.
	hostBinToolVariableWithPrebuilt := func(name, prebuiltDir, tool string) {
		pctx.VariableFunc(name, func(ctx android.PackageVarContext) string {
			if !android.ExistentPathForSource(ctx, "frameworks/base").Valid() {
				return filepath.Join(prebuiltDir, runtime.GOOS, "bin", tool)
			} else {
				return pctx.HostBinToolPath(ctx, tool).String()
			}
		})
	}
	hostBinToolVariableWithPrebuilt("aapt2", "prebuilts/sdk/tools", "aapt2")
	pctx.HostBinToolVariable("avbtool", "avbtool")
	pctx.HostBinToolVariable("e2fsdroid", "e2fsdroid")
	pctx.HostBinToolVariable("merge_zips", "merge_zips")