diff options
| author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-03-21 19:21:02 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-03-21 19:21:02 +0000 |
| commit | 2f39f7dacdfff393dd57405e819b9b048bfdac31 (patch) | |
| tree | d57bc1287b163df35496118d9f95b41cd5cfa9b6 /java/java.go | |
| parent | 6014299148476a2b0f15ce733b39666d1e40819e (diff) | |
| parent | 9bb9bfb349efa3e03c351bb0ce3bb1e4de013ab4 (diff) | |
Merge "Don't pass static libs to r8"
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/java/java.go b/java/java.go index 895ce7af1..ddef34d2c 100644 --- a/java/java.go +++ b/java/java.go @@ -421,9 +421,25 @@ func sdkDeps(ctx android.BottomUpMutatorContext, sdkContext android.SdkContext, } type deps struct { - classpath classpath - java9Classpath classpath - bootClasspath classpath + // 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 errorProneProcessorPath classpath processorClasses []string @@ -1458,7 +1474,10 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { if ctx.OtherModuleHasProvider(module, JavaInfoProvider) { dep := ctx.OtherModuleProvider(module, JavaInfoProvider).(JavaInfo) switch tag { - case libTag, staticLibTag: + case libTag: + flags.classpath = append(flags.classpath, dep.HeaderJars...) + flags.dexClasspath = append(flags.dexClasspath, dep.HeaderJars...) + case staticLibTag: flags.classpath = append(flags.classpath, dep.HeaderJars...) case bootClasspathTag: flags.bootClasspath = append(flags.bootClasspath, dep.HeaderJars...) |
