aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-04-10 17:05:07 -0700
committerColin Cross <ccross@android.com>2015-04-10 17:49:44 -0700
commit2097830df79aa14ebe581f477406a34e6f5cb7e9 (patch)
tree91f9399ffa2d3801a3333716cf007491965e01f0 /java
parent9b6826f7cf654f3f7e947bd65448ef318f14278f (diff)
downloadbuild_soong-2097830df79aa14ebe581f477406a34e6f5cb7e9.tar.gz
build_soong-2097830df79aa14ebe581f477406a34e6f5cb7e9.tar.bz2
build_soong-2097830df79aa14ebe581f477406a34e6f5cb7e9.zip
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
Diffstat (limited to 'java')
-rw-r--r--java/java.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/java/java.go b/java/java.go
index 07bbc117..2d1aaa53 100644
--- a/java/java.go
+++ b/java/java.go
@@ -283,9 +283,6 @@ func (j *javaBase) GenerateJavaBuildActions(ctx common.AndroidModuleContext) {
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 @@ func (j *javaBase) GenerateJavaBuildActions(ctx common.AndroidModuleContext) {
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 {