Merge "Remove support for stripping dex."

This commit is contained in:
Nicolas Geoffray
2019-10-22 09:48:06 +00:00
committed by Gerrit Code Review
6 changed files with 8 additions and 224 deletions

View File

@@ -1149,13 +1149,7 @@ func TestAndroidAppImport_Presigned(t *testing.T) {
variant.MaybeOutput("dexpreopt/oat/arm64/package.odex").Rule == nil {
t.Errorf("can't find dexpreopt outputs")
}
// Make sure stripping wasn't done.
stripRule := variant.Output("dexpreopt/foo.apk")
if !strings.HasPrefix(stripRule.RuleParams.Command, "cp -f") {
t.Errorf("unexpected, non-skipping strip command: %q", stripRule.RuleParams.Command)
}
// Make sure signing was skipped and aligning was done instead.
// Make sure signing was skipped and aligning was done.
if variant.MaybeOutput("signed/foo.apk").Rule != nil {
t.Errorf("signing rule shouldn't be included.")
}

View File

@@ -40,13 +40,9 @@ type dexpreopter struct {
type DexpreoptProperties struct {
Dex_preopt struct {
// If false, prevent dexpreopting and stripping the dex file from the final jar. Defaults to
// true.
// If false, prevent dexpreopting. Defaults to true.
Enabled *bool
// If true, never strip the dex files from the final jar when dexpreopting. Defaults to false.
No_stripping *bool
// If true, generate an app image (.art file) for this module.
App_image *bool
@@ -136,8 +132,6 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
dexLocation := android.InstallPathToOnDevicePath(ctx, d.installPath)
strippedDexJarFile := android.PathForModuleOut(ctx, "dexpreopt", dexJarFile.Base())
var profileClassListing android.OptionalPath
var profileBootListing android.OptionalPath
profileIsTextListing := false
@@ -191,10 +185,6 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
ForceCreateAppImage: BoolDefault(d.dexpreoptProperties.Dex_preopt.App_image, false),
PresignedPrebuilt: d.isPresignedPrebuilt,
NoStripping: Bool(d.dexpreoptProperties.Dex_preopt.No_stripping),
StripInputPath: dexJarFile,
StripOutputPath: strippedDexJarFile.OutputPath,
}
dexpreoptRule, err := dexpreopt.GenerateDexpreoptRule(ctx, global, dexpreoptConfig)
@@ -207,13 +197,5 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Mo
d.builtInstalled = dexpreoptRule.Installs().String()
stripRule, err := dexpreopt.GenerateStripRule(global, dexpreoptConfig)
if err != nil {
ctx.ModuleErrorf("error generating dexpreopt strip rule: %s", err.Error())
return dexJarFile
}
stripRule.Build(pctx, ctx, "dexpreopt_strip", "dexpreopt strip")
return strippedDexJarFile
return dexJarFile
}