aboutsummaryrefslogtreecommitdiffstats
path: root/java/app.go
diff options
context:
space:
mode:
authorJaewoong Jung <jungjw@google.com>2020-06-29 19:18:44 -0700
committerJaewoong Jung <jungjw@google.com>2020-06-30 10:00:22 -0700
commit8bec026e3ad643fa5c8a65e8e75df6138518e340 (patch)
tree0c929d9b05252f2ad8059964d62f8583ed8a1447 /java/app.go
parentc4422106a7cf4731e27d664646bc0d57ad3f37fa (diff)
downloadbuild_soong-8bec026e3ad643fa5c8a65e8e75df6138518e340.tar.gz
build_soong-8bec026e3ad643fa5c8a65e8e75df6138518e340.tar.bz2
build_soong-8bec026e3ad643fa5c8a65e8e75df6138518e340.zip
Output apkcerts file for android_app_set.
Soong and Make have no ways to figure out what splits will be outputted from a given android_app_set, so it's impossible for them to provide full PACKAGES.$(LOCAL_MODULE).CERTIFICATE entries, which are required to build a final apkcerts.txt. This change makes extract_apks produce apkcerts.txt files for each input modules instead. The Make-side counterpart of this change merges all local apkcerts.txt into a final one. Fixes: 160119159 Test: main_test.go Test: m apkcerts-list Change-Id: I321e80fd636a955213761f56a3ac64bfe7f7f7c0
Diffstat (limited to 'java/app.go')
-rwxr-xr-xjava/app.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/java/app.go b/java/app.go
index e2e3a53d..3f12e91c 100755
--- a/java/app.go
+++ b/java/app.go
@@ -78,6 +78,7 @@ type AndroidAppSet struct {
properties AndroidAppSetProperties
packedOutput android.WritablePath
masterFile string
+ apkcertsFile android.ModuleOutPath
}
func (as *AndroidAppSet) Name() string {
@@ -129,6 +130,7 @@ func SupportedAbis(ctx android.ModuleContext) []string {
func (as *AndroidAppSet) GenerateAndroidBuildActions(ctx android.ModuleContext) {
as.packedOutput = android.PathForModuleOut(ctx, ctx.ModuleName()+".zip")
+ as.apkcertsFile = android.PathForModuleOut(ctx, "apkcerts.txt")
// 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.
@@ -141,16 +143,19 @@ func (as *AndroidAppSet) GenerateAndroidBuildActions(ctx android.ModuleContext)
// TODO(asmundak): do we support device features
ctx.Build(pctx,
android.BuildParams{
- Rule: extractMatchingApks,
- Description: "Extract APKs from APK set",
- Output: as.packedOutput,
- Inputs: android.Paths{as.prebuilt.SingleSourcePath(ctx)},
+ Rule: extractMatchingApks,
+ Description: "Extract APKs from APK set",
+ Output: as.packedOutput,
+ ImplicitOutput: as.apkcertsFile,
+ Inputs: android.Paths{as.prebuilt.SingleSourcePath(ctx)},
Args: map[string]string{
"abis": strings.Join(SupportedAbis(ctx), ","),
"allow-prereleased": strconv.FormatBool(proptools.Bool(as.properties.Prerelease)),
"screen-densities": screenDensities,
"sdk-version": ctx.Config().PlatformSdkVersion(),
"stem": as.BaseModuleName(),
+ "apkcerts": as.apkcertsFile.String(),
+ "partition": as.PartitionTag(ctx.DeviceConfig()),
},
})
}