summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2018-09-06 17:30:28 +0100
committerTobias Thierer <tobiast@google.com>2018-09-06 17:33:57 +0100
commit8fb36157292db01854fbfa40815e0a37db6332e1 (patch)
tree6eb0b744d57417d5d8daeac6115ad7568f809812
parent08d7a208e8c8b6e23d7949d5ce9bc06cb5bea538 (diff)
Fix compilation when targeting OpenJDK 9.
CL [1] added a new compilation target that uses internal API that is now in the jdk.compiler module and is not exported (it is subject to removal without notice in future versions of OpenJDK). The fact that these packages are not exported suggests that a replacement API is already available, but I don't know the details. For now, this CL uses javac command-line flags to export these packages, which fixes compilation. Since the commit message from CL [1] implies that the entire tool can be removed once bug 77284273 is fixed, a longer-term solution should not be required. [1] https://android-review.googlesource.com/c/platform/frameworks/base/+/745655 commit bad89e5e5b171a71e42d7c738ec97a39747e4318 Test: The following breaks before but not after this CL: EXPERIMENTAL_USE_OPENJDK9=true make unsupportedappusage-annotation-processor Bug: 113853502 Change-Id: I24b77af9262891428a01e2eccc18fa3a5c3b3bc9
-rw-r--r--tools/processors/unsupportedappusage/Android.bp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/processors/unsupportedappusage/Android.bp b/tools/processors/unsupportedappusage/Android.bp
index 98f3c955a2d2..1aca3edfab88 100644
--- a/tools/processors/unsupportedappusage/Android.bp
+++ b/tools/processors/unsupportedappusage/Android.bp
@@ -11,5 +11,15 @@ java_library_host {
"guava",
"unsupportedappusage-annotation"
],
+ openjdk9: {
+ javacflags: [
+ "--add-modules=jdk.compiler",
+ "--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
+ "--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED",
+ "--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
+ "--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
+ ],
+ },
+
use_tools_jar: true,
}