summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Jaewoong Jung <jungjw@google.com> 2019-01-04 20:43:50 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-01-04 20:43:50 +0000
commitbf35e33cfb669c0bda26bc1fb60e317a86b7b4d3 (patch)
treeee0e231aabde59cca864167d12a0a06493d3cbce /java/java.go
parent91b38477e214cfe863cddd96ba2a50ee6854d7c2 (diff)
parent38e4fb2ce65fb3503b527f1457587c6c06c15335 (diff)
Merge "Add buildDir to java patch-module paths."
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/java/java.go b/java/java.go
index 71967a867..c02ccd347 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1011,8 +1011,15 @@ func (j *Module) collectBuilderFlags(ctx android.ModuleContext, deps deps) javaB
}
if j.properties.Patch_module != nil && flags.javaVersion == "1.9" {
- patchClasspath := ".:" + flags.classpath.FormJavaClassPath("")
- javacFlags = append(javacFlags, "--patch-module="+String(j.properties.Patch_module)+"="+patchClasspath)
+ // Manually specify build directory in case it is not under the repo root.
+ // (javac doesn't seem to expand into symbolc links when searching for patch-module targets, so
+ // just adding a symlink under the root doesn't help.)
+ patchPaths := ".:" + ctx.Config().BuildDir()
+ classPath := flags.classpath.FormJavaClassPath("")
+ if classPath != "" {
+ patchPaths += ":" + classPath
+ }
+ javacFlags = append(javacFlags, "--patch-module="+String(j.properties.Patch_module)+"="+patchPaths)
}
// systemModules