diff options
| author | 2017-09-27 17:39:56 -0700 | |
|---|---|---|
| committer | 2017-09-29 14:02:22 -0700 | |
| commit | d689143f1db66193e655651d3190206dc9eb4f82 (patch) | |
| tree | b22247f40e42138bf9f3721e9c2365492ed5daf4 /java/java.go | |
| parent | 86a63ff366f386f9ff29e5092a724faad95b05dd (diff) | |
Move errorprone dependency to compiled classes jar
The resources jar and the combined jar are not always used, so
add the errorprone dependency to the compiled jar.
Test: m -j checkbuild
Change-Id: Iaa10a04347758c676bb704969b86f9442e6c3175
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/java/java.go b/java/java.go index 5b82fb3f9..82dabfaaa 100644 --- a/java/java.go +++ b/java/java.go @@ -377,8 +377,6 @@ func (j *Module) compile(ctx android.ModuleContext) { flags.javaVersion = "${config.DefaultJavaVersion}" } - var extraDeps android.Paths - flags.bootClasspath.AddPaths(deps.bootClasspath) flags.classpath.AddPaths(deps.classpath) @@ -405,28 +403,26 @@ func (j *Module) compile(ctx android.ModuleContext) { deps.srcFileLists = append(deps.srcFileLists, j.ExtraSrcLists...) - var extraJarDeps android.Paths - var jars android.Paths if len(srcFiles) > 0 { - // Compile java sources into .class files - classes := TransformJavaToClasses(ctx, srcFiles, deps.srcFileLists, flags, extraDeps) - if ctx.Failed() { - return - } - + var extraJarDeps android.Paths if ctx.AConfig().IsEnvTrue("RUN_ERROR_PRONE") { // If error-prone is enabled, add an additional rule to compile the java files into // a separate set of classes (so that they don't overwrite the normal ones and require - // a rebuild when error-prone is turned off). Add the classes as a dependency to - // the jar command so the two compiles can run in parallel. + // a rebuild when error-prone is turned off). // TODO(ccross): Once we always compile with javac9 we may be able to conditionally // enable error-prone without affecting the output class files. - errorprone := RunErrorProne(ctx, srcFiles, deps.srcFileLists, flags, extraDeps) + errorprone := RunErrorProne(ctx, srcFiles, deps.srcFileLists, flags, nil) extraJarDeps = append(extraJarDeps, errorprone) } + // Compile java sources into .class files + classes := TransformJavaToClasses(ctx, srcFiles, deps.srcFileLists, flags, extraJarDeps) + if ctx.Failed() { + return + } + jars = append(jars, classes) } |