Merge "Add property Skip_jarjar_repackage" into main

This commit is contained in:
Zi Wang 2024-03-07 17:44:36 +00:00 committed by Gerrit Code Review
commit 5ae58dcabe

View file

@ -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
}
}
}