Extract classes out of jarjar jar for static java libraries
jarjar modifies the .class files in a jar, when using static java
library dependencies we need to use the modified class files and
not the ones that javac produced. If jarjar is enabled, use
the prebuilt jar extractor to get the classes out of classes-jarjar.jar
and export them through j.classJarSpecs.
Change-Id: Ia2854f1c26d630da12cab7c421007aad4f793ecd
diff --git a/java/java.go b/java/java.go
index 07bbc11..2d1aaa5 100644
--- a/java/java.go
+++ b/java/java.go
@@ -283,9 +283,6 @@
return
}
- j.classJarSpecs = classJarSpecs
- j.resourceJarSpecs = resourceJarSpecs
-
if j.properties.Jarjar_rules != "" {
jarjar_rules := filepath.Join(common.ModuleSrcDir(ctx), j.properties.Jarjar_rules)
// Transform classes-full-debug.jar into classes-jarjar.jar
@@ -293,8 +290,13 @@
if ctx.Failed() {
return
}
+
+ classes, _ := TransformPrebuiltJarToClasses(ctx, outputFile)
+ classJarSpecs = []jarSpec{classes}
}
+ j.resourceJarSpecs = resourceJarSpecs
+ j.classJarSpecs = classJarSpecs
j.classpathFile = outputFile
if j.properties.Dex && len(srcFiles) > 0 {