diff options
author | 2022-03-17 11:12:32 -0700 | |
---|---|---|
committer | 2022-03-18 20:48:27 +0000 | |
commit | 9bb9bfb349efa3e03c351bb0ce3bb1e4de013ab4 (patch) | |
tree | 61d1be19176804a62075cf22711d1c57e37e9b14 /java/builder.go | |
parent | 3f57c6a2c89a73bc554c10bb05f0c443fcb38081 (diff) |
Don't pass static libs to r8
r8 gets the static libs in the program jar, it shouldn't also get
them as library jars. Keep a separate classpath for dexing that
includes libs but not static_libs.
Bug: 222468116
Test: m checkbuild
Test: TestD8
Test: TestR8
Change-Id: Icca3393f496cbcadcc633f3b156761e6c145f975
Diffstat (limited to 'java/builder.go')
-rw-r--r-- | java/builder.go | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/java/builder.go b/java/builder.go index e64a61f5c..c48e3faa5 100644 --- a/java/builder.go +++ b/java/builder.go @@ -247,16 +247,33 @@ func init() { } type javaBuilderFlags struct { - javacFlags string - bootClasspath classpath - classpath classpath + javacFlags string + + // bootClasspath is the list of jars that form the boot classpath (generally the java.* and + // android.* classes) for tools that still use it. javac targeting 1.9 or higher uses + // systemModules and java9Classpath instead. + bootClasspath classpath + + // classpath is the list of jars that form the classpath for javac and kotlinc rules. It + // contains header jars for all static and non-static dependencies. + classpath classpath + + // dexClasspath is the list of jars that form the classpath for d8 and r8 rules. It contains + // header jars for all non-static dependencies. Static dependencies have already been + // combined into the program jar. + dexClasspath classpath + + // java9Classpath is the list of jars that will be added to the classpath when targeting + // 1.9 or higher. It generally contains the android.* classes, while the java.* classes + // are provided by systemModules. java9Classpath classpath - processorPath classpath - processors []string - systemModules *systemModules - aidlFlags string - aidlDeps android.Paths - javaVersion javaVersion + + processorPath classpath + processors []string + systemModules *systemModules + aidlFlags string + aidlDeps android.Paths + javaVersion javaVersion errorProneExtraJavacFlags string errorProneProcessorPath classpath |