diff --git a/java/base.go b/java/base.go index f11e30dc2..d8ccec6c6 100644 --- a/java/base.go +++ b/java/base.go @@ -95,6 +95,9 @@ type CommonProperties struct { // if not blank, used as prefix to generate repackage rule Jarjar_prefix *string + // if set to true, skip the jarjar repackaging + Skip_jarjar_repackage *bool + // If not blank, set the java version passed to javac as -source and -target Java_version *string @@ -1101,11 +1104,13 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath jarjarProviderData := j.collectJarJarRules(ctx) if jarjarProviderData != nil { android.SetProvider(ctx, JarJarProvider, *jarjarProviderData) - text := getJarJarRuleText(jarjarProviderData) - if text != "" { - ruleTextFile := android.PathForModuleOut(ctx, "repackaged-jarjar", "repackaging.txt") - android.WriteFileRule(ctx, ruleTextFile, text) - j.repackageJarjarRules = ruleTextFile + if !proptools.Bool(j.properties.Skip_jarjar_repackage) { + text := getJarJarRuleText(jarjarProviderData) + if text != "" { + ruleTextFile := android.PathForModuleOut(ctx, "repackaged-jarjar", "repackaging.txt") + android.WriteFileRule(ctx, ruleTextFile, text) + j.repackageJarjarRules = ruleTextFile + } } }