diff options
author | Colin Cross <ccross@android.com> | 2017-10-23 18:12:27 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-10-24 16:01:44 -0700 |
commit | 5c6ecc179f0dfc1026a65531bcf923bbfe4ac1e9 (patch) | |
tree | 2f13337dd7bcac58b7573cd681e4bc38a8d62b87 /java | |
parent | 17ae970a92a8e822631279ea8ff430a46d0735cf (diff) | |
download | build_soong-5c6ecc179f0dfc1026a65531bcf923bbfe4ac1e9.tar.gz build_soong-5c6ecc179f0dfc1026a65531bcf923bbfe4ac1e9.tar.bz2 build_soong-5c6ecc179f0dfc1026a65531bcf923bbfe4ac1e9.zip |
Don't panic in turbine with no classes
ALLOW_MISSING_DEPENDENCIES=true can cause missing dependencies to be
hidden from GenerateAndroidBuildActions, which is triggering the
len(jars) == 0 check in compileJavaHeader. For the
ALLOW_MISSING_DEPENDENCIES=true case the check is unnecessary, as the
build rules will be replaced with runtime errors. On the off chance
the check would have been hit in a real build, allow merge_zips to
create an empty zip file if it is asked to.
Test: m ALLOW_MISSING_DEPENDENCIES=true
Change-Id: I3171f921d51229ddf38a1a647d32566658c673fa
Diffstat (limited to 'java')
-rw-r--r-- | java/java.go | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/java/java.go b/java/java.go index 26514f33..1f7ba65a 100644 --- a/java/java.go +++ b/java/java.go @@ -689,15 +689,11 @@ func (j *Module) compileJavaHeader(ctx android.ModuleContext, srcFiles android.P var headerJar android.Path jars = append(jars, deps.staticHeaderJars...) - if len(jars) == 0 { - panic("The turbine.jar is empty without any sources and static libs.") - } else { - // we cannot skip the combine step for now if there is only one jar - // since we have to strip META-INF/TRANSITIVE dir from turbine.jar - combinedJar := android.PathForModuleOut(ctx, "turbine-combined", jarName) - TransformJarsToJar(ctx, combinedJar, "for turbine", jars, android.OptionalPath{}, false, []string{"META-INF"}) - headerJar = combinedJar - } + // we cannot skip the combine step for now if there is only one jar + // since we have to strip META-INF/TRANSITIVE dir from turbine.jar + combinedJar := android.PathForModuleOut(ctx, "turbine-combined", jarName) + TransformJarsToJar(ctx, combinedJar, "for turbine", jars, android.OptionalPath{}, false, []string{"META-INF"}) + headerJar = combinedJar if j.properties.Jarjar_rules != nil { jarjar_rules := android.PathForModuleSrc(ctx, *j.properties.Jarjar_rules) |