Merge "Do not run zipalign when building APK."

This commit is contained in:
Alex Klyubin 2015-12-07 22:08:14 +00:00 committed by Gerrit Code Review
commit 3595a6aea8
1 changed files with 2 additions and 24 deletions

View File

@ -56,14 +56,6 @@ var (
},
"aaptFlags")
zipalign = pctx.StaticRule("zipalign",
blueprint.RuleParams{
Command: `$zipalignCmd -f $zipalignFlags 4 $in $out`,
CommandDeps: []string{"$zipalignCmd"},
Description: "zipalign $out",
},
"zipalignFlags")
signapk = pctx.StaticRule("signapk",
blueprint.RuleParams{
Command: `java -jar $signapkCmd $certificates $in $out`,
@ -87,9 +79,6 @@ func init() {
pctx.VariableFunc("aaptCmd", func(c interface{}) (string, error) {
return c.(common.Config).HostBinTool("aapt")
})
pctx.VariableFunc("zipalignCmd", func(c interface{}) (string, error) {
return c.(common.Config).HostBinTool("zipalign")
})
pctx.VariableFunc("signapkCmd", func(c interface{}) (string, error) {
return c.(common.Config).HostJavaTool("signapk.jar")
})
@ -147,7 +136,7 @@ func CreateAppPackage(ctx common.AndroidModuleContext, flags []string, jarFile s
},
})
signedApk := filepath.Join(common.ModuleOutDir(ctx), "signed.apk")
outputFile := filepath.Join(common.ModuleOutDir(ctx), "package.apk")
var certificateArgs []string
for _, c := range certificates {
@ -156,23 +145,12 @@ func CreateAppPackage(ctx common.AndroidModuleContext, flags []string, jarFile s
ctx.Build(pctx, blueprint.BuildParams{
Rule: signapk,
Outputs: []string{signedApk},
Outputs: []string{outputFile},
Inputs: []string{resourceApk},
Args: map[string]string{
"certificates": strings.Join(certificateArgs, " "),
},
})
outputFile := filepath.Join(common.ModuleOutDir(ctx), "package.apk")
ctx.Build(pctx, blueprint.BuildParams{
Rule: zipalign,
Outputs: []string{outputFile},
Inputs: []string{signedApk},
Args: map[string]string{
"zipalignFlags": "",
},
})
return outputFile
}