summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2024-11-18 16:26:44 -0800
committer Cole Faust <colefaust@google.com> 2024-11-18 16:26:44 -0800
commitfb8a239e99c73f588720f54382d855c97e8113f1 (patch)
tree5674279ad4f4fe718327fed96577f5654dda5227
parentaea105b74929663cd9766948b521a864941f5cab (diff)
Export javac classes
Errorprone used to ship with its own copy of javac, but now just uses the compiler directly. Errorprone plugins that use javac compiler internal classes need to tell the compiler to export those classes. Bug: 253827323 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I4537a46525e75757b13af5a92dde60c50e5e660a
-rw-r--r--errorprone/Android.bp8
1 files changed, 8 insertions, 0 deletions
diff --git a/errorprone/Android.bp b/errorprone/Android.bp
index b559a15c3a60..1428b8965473 100644
--- a/errorprone/Android.bp
+++ b/errorprone/Android.bp
@@ -31,6 +31,14 @@ java_library_host {
"//external/auto:auto_service_annotations",
],
+ javacflags: [
+ // These exports are needed because this errorprone plugin access some private classes
+ // of the java compiler.
+ "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED",
+ "--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED",
+ ],
+
plugins: [
"//external/auto:auto_service_plugin",
],