Merge "Allow apex module to have android_app_set as its constituent." am: a5c94e1409 am: 342b4810a7

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1318079

Change-Id: If27ef9b94e59620abcf2ef1179f51c2e5ca9b10f
This commit is contained in:
Treehugger Robot
2020-06-05 06:22:41 +00:00
committed by Automerger Merge Worker
6 changed files with 135 additions and 58 deletions

View File

@@ -96,6 +96,14 @@ func (as *AndroidAppSet) Privileged() bool {
return Bool(as.properties.Privileged)
}
func (as *AndroidAppSet) OutputFile() android.Path {
return as.packedOutput
}
func (as *AndroidAppSet) MasterFile() string {
return as.masterFile
}
var TargetCpuAbi = map[string]string{
"arm": "ARMEABI_V7A",
"arm64": "ARM64_V8A",
@@ -120,7 +128,7 @@ func SupportedAbis(ctx android.ModuleContext) []string {
}
func (as *AndroidAppSet) GenerateAndroidBuildActions(ctx android.ModuleContext) {
as.packedOutput = android.PathForModuleOut(ctx, "extracted.zip")
as.packedOutput = android.PathForModuleOut(ctx, ctx.ModuleName()+".zip")
// We are assuming here that the master file in the APK
// set has `.apk` suffix. If it doesn't the build will fail.
// APK sets containing APEX files are handled elsewhere.
@@ -145,18 +153,6 @@ func (as *AndroidAppSet) GenerateAndroidBuildActions(ctx android.ModuleContext)
"stem": ctx.ModuleName(),
},
})
// TODO(asmundak): add this (it's wrong now, will cause copying extracted.zip)
/*
var installDir android.InstallPath
if Bool(as.properties.Privileged) {
installDir = android.PathForModuleInstall(ctx, "priv-app", as.BaseModuleName())
} else if ctx.InstallInTestcases() {
installDir = android.PathForModuleInstall(ctx, as.BaseModuleName(), ctx.DeviceConfig().DeviceArch())
} else {
installDir = android.PathForModuleInstall(ctx, "app", as.BaseModuleName())
}
ctx.InstallFile(installDir, as.masterFile", as.packedOutput)
*/
}
// android_app_set extracts a set of APKs based on the target device
@@ -335,7 +331,7 @@ type Certificate struct {
presigned bool
}
var presignedCertificate = Certificate{presigned: true}
var PresignedCertificate = Certificate{presigned: true}
func (c Certificate) AndroidMkString() string {
if c.presigned {
@@ -1491,7 +1487,7 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext
// Sign or align the package if package has not been preprocessed
if a.preprocessed {
a.outputFile = srcApk
a.certificate = presignedCertificate
a.certificate = PresignedCertificate
} else if !Bool(a.properties.Presigned) {
// If the certificate property is empty at this point, default_dev_cert must be set to true.
// Which makes processMainCert's behavior for the empty cert string WAI.
@@ -1511,7 +1507,7 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext
alignedApk := android.PathForModuleOut(ctx, "zip-aligned", apkFilename)
TransformZipAlign(ctx, alignedApk, dexOutput)
a.outputFile = alignedApk
a.certificate = presignedCertificate
a.certificate = PresignedCertificate
}
// TODO: Optionally compress the output apk.