summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2017-12-21 13:52:58 -0800
committer Colin Cross <ccross@android.com> 2017-12-21 14:29:56 -0800
commit7b60cdd6e5d81ae6e929d61898f4faefb1ddb8e2 (patch)
tree0502e07303b6875ca72bb65362f8b32b870ebbc9 /java/java.go
parentc5de1b6cb2e5b111ba725aa79beeff6b5d4493f4 (diff)
Strip module-info.class files when combining jars
Combining static jars from dependencies may bring in module-info.class files, which don't make sense once multiple modules have been combined, and sometimes confuse downstream tools like desugar. Strip them out like make does when combining jars. Test: m checkbuild Change-Id: I560c5acfcc6e1be9adf604c22cf200581f92f702
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index 302bf78a5..dbf202a00 100644
--- a/java/java.go
+++ b/java/java.go
@@ -781,6 +781,9 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
if len(jars) == 1 && !manifest.Valid() {
// Optimization: skip the combine step if there is nothing to do
+ // TODO(ccross): this leaves any module-info.class files, but those should only come from
+ // prebuilt dependencies until we support modules in the platform build, so there shouldn't be
+ // any if len(jars) == 1.
outputFile = jars[0]
} else {
combinedJar := android.PathForModuleOut(ctx, "combined", jarName)