Skip to content

Commit

Permalink
Move javac check after toolchain check (#16)
Browse files Browse the repository at this point in the history
* Should check javac after checking if toolchain has set it
  • Loading branch information
samwestmoreland authored Aug 26, 2022
1 parent f98438a commit 5fb54f6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion .plzconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ Inherit = True
[Plugin "java"]
Toolchain = //third_party/java:toolchain
JunitRunner = //tools/junit_runner
JavacTool = "javac"

[FeatureFlags]
ExcludeJavaRules = true
6 changes: 3 additions & 3 deletions build_defs/java.build_defs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def java_library(name:str, srcs:list=None, src_dir:str=None, resources:list=[],
javac = CONFIG.JAVA.JAVAC_TOOL
javac_worker = CONFIG.JAVA.JAVAC_WORKER

if not javac and not javac_worker:
fail('Either java.javac_tool or java.javac_worker must be set in the config')

# Override old config if we have a toolchain configured
if toolchain:
javac = f'{toolchain}|javac'
javac_worker = ''

if not javac and not javac_worker:
fail('Either java.javac_tool or java.javac_worker must be set in the config')

if not javac:
javac = CONFIG.JAVA.JAVAC_WORKER
mflag = '--modular' if modular else ''
Expand Down
1 change: 1 addition & 0 deletions example/.plzconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ PreloadSubincludes = ///java//build_defs:java
Target = //plugins:java
Toolchain = //third_party/java:toolchain
JunitRunner = //_please:junit_runner
JavacTool = "javac"

[FeatureFlags]
ExcludeJavaRules = true

0 comments on commit 5fb54f6

Please sign in to comment.