Add apex_set module.

apex_set takes an .apks file that contains a set of prebuilt apexes with
different configurations. It uses extract_apks to select and install the
best matching one for the current target.

Bug: 153456259
Test: apex_test.go
Test: com.android.media.apks
Change-Id: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Merged-In: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
This commit is contained in:
Jaewoong Jung
2020-05-14 14:15:24 -07:00
parent 4de27a5757
commit 8cf307e754
7 changed files with 488 additions and 56 deletions

View File

@@ -96,16 +96,16 @@ func (as *AndroidAppSet) Privileged() bool {
return Bool(as.properties.Privileged)
}
var targetCpuAbi = map[string]string{
var TargetCpuAbi = map[string]string{
"arm": "ARMEABI_V7A",
"arm64": "ARM64_V8A",
"x86": "X86",
"x86_64": "X86_64",
}
func supportedAbis(ctx android.ModuleContext) []string {
func SupportedAbis(ctx android.ModuleContext) []string {
abiName := func(archVar string, deviceArch string) string {
if abi, found := targetCpuAbi[deviceArch]; found {
if abi, found := TargetCpuAbi[deviceArch]; found {
return abi
}
ctx.ModuleErrorf("Invalid %s: %s", archVar, deviceArch)
@@ -138,7 +138,7 @@ func (as *AndroidAppSet) GenerateAndroidBuildActions(ctx android.ModuleContext)
Output: as.packedOutput,
Inputs: android.Paths{as.prebuilt.SingleSourcePath(ctx)},
Args: map[string]string{
"abis": strings.Join(supportedAbis(ctx), ","),
"abis": strings.Join(SupportedAbis(ctx), ","),
"allow-prereleased": strconv.FormatBool(proptools.Bool(as.properties.Prerelease)),
"screen-densities": screenDensities,
"sdk-version": ctx.Config().PlatformSdkVersion(),