Merge "Output apkcerts file for android_app_set."
This commit is contained in:
@@ -719,6 +719,7 @@ func (apkSet *AndroidAppSet) AndroidMkEntries() []android.AndroidMkEntries {
|
||||
func(entries *android.AndroidMkEntries) {
|
||||
entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", apkSet.Privileged())
|
||||
entries.SetString("LOCAL_APK_SET_MASTER_FILE", apkSet.masterFile)
|
||||
entries.SetPath("LOCAL_APKCERTS_FILE", apkSet.apkcertsFile)
|
||||
entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", apkSet.properties.Overrides...)
|
||||
},
|
||||
},
|
||||
|
13
java/app.go
13
java/app.go
@@ -79,6 +79,7 @@ type AndroidAppSet struct {
|
||||
properties AndroidAppSetProperties
|
||||
packedOutput android.WritablePath
|
||||
masterFile string
|
||||
apkcertsFile android.ModuleOutPath
|
||||
}
|
||||
|
||||
func (as *AndroidAppSet) Name() string {
|
||||
@@ -130,6 +131,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.
|
||||
@@ -142,16 +144,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()),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
@@ -147,7 +147,7 @@ func TestAndroidAppSet(t *testing.T) {
|
||||
name: "foo",
|
||||
set: "prebuilts/apks/app.apks",
|
||||
prerelease: true,
|
||||
}`)
|
||||
}`)
|
||||
module := ctx.ModuleForTests("foo", "android_common")
|
||||
const packedSplitApks = "foo.zip"
|
||||
params := module.Output(packedSplitApks)
|
||||
@@ -157,6 +157,9 @@ func TestAndroidAppSet(t *testing.T) {
|
||||
if s := params.Args["allow-prereleased"]; s != "true" {
|
||||
t.Errorf("wrong allow-prereleased value: '%s', expected 'true'", s)
|
||||
}
|
||||
if s := params.Args["partition"]; s != "system" {
|
||||
t.Errorf("wrong partition value: '%s', expected 'system'", s)
|
||||
}
|
||||
mkEntries := android.AndroidMkEntriesForTest(t, config, "", module.Module())[0]
|
||||
actualMaster := mkEntries.EntryMap["LOCAL_APK_SET_MASTER_FILE"]
|
||||
expectedMaster := []string{"foo.apk"}
|
||||
|
@@ -120,10 +120,11 @@ var (
|
||||
`${config.ExtractApksCmd} -o "${out}" -allow-prereleased=${allow-prereleased} ` +
|
||||
`-sdk-version=${sdk-version} -abis=${abis} ` +
|
||||
`--screen-densities=${screen-densities} --stem=${stem} ` +
|
||||
`-apkcerts=${apkcerts} -partition=${partition} ` +
|
||||
`${in}`,
|
||||
CommandDeps: []string{"${config.ExtractApksCmd}"},
|
||||
},
|
||||
"abis", "allow-prereleased", "screen-densities", "sdk-version", "stem")
|
||||
"abis", "allow-prereleased", "screen-densities", "sdk-version", "stem", "apkcerts", "partition")
|
||||
|
||||
turbine, turbineRE = remoteexec.StaticRules(pctx, "turbine",
|
||||
blueprint.RuleParams{
|
||||
|
Reference in New Issue
Block a user