Merge "Add property Skip_jarjar_repackage" into main am: 5ae58dcabe

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2990064

Change-Id: I13b797f2505b772a602fa467808d9ce51afb7888
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Zi Wang 2024-03-08 18:47:49 +00:00 committed by Automerger Merge Worker
commit ddeca6128e

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