Allow all necessary tools to be sourced from Java toolchain#29
Merged
chrisnovakovic merged 5 commits intoplease-build:masterfrom Dec 15, 2023
Merged
Conversation
Certain Java build rules provided by this plugin accept and make use of a Java toolchain outputted by `java_toolchain` in order to compile Java code (via `javac`) and run test JARs (via `java`). Extend the rules so that all JDK tools that they depend upon can be provided by a Java toolchain; in practice the only additional tool that the toolchain needs to provide is jlink (for `java_runtime_image`). This adds two new plugin configuration options, `JavaTool` and `RunSelfExecutablesWithJavaTool`. The former is used whenever the `java` binary is required and no toolchain is defined. The latter controls whether this tool is invoked as part of the preamble in self-executable JARs outputted by `java_binary`; if this is enabled, none of the build commands executed by (or outputs from) the rules in this plugin require a JRE or JDK to be present in the system path, although self-executable JARs will need to be run with `java -jar` if they are moved outside of the Please repo. This option causes breaking changes when enabled and is therefore disabled by default.
79644ae to
e3f182d
Compare
chrisnovakovic
commented
Dec 15, 2023
| @@ -1,5 +1,5 @@ | |||
| [Please] | |||
| version = 17.0.0-beta.6 | |||
| version = 17.4.0-beta.10 | |||
Contributor
Author
There was a problem hiding this comment.
Version bump required for the new get_entry_points built-in function in Please.
peterebden
approved these changes
Dec 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Certain Java build rules provided by this plugin accept and make use of a Java toolchain outputted by
java_toolchainin order to compile Java code (viajavac) and run test JARs (viajava). Extend the rules so that all JDK tools that they depend upon can be provided by a Java toolchain; in practice the only additional tool that the toolchain needs to provide is jlink (forjava_runtime_image), although jlink was added in Java 9 which means thatjava_runtime_imageis only usable with ajava_toolchainthat provides JDK 9 or newer. There's a run-time check for this in the build rule.This adds two new plugin configuration options,
JavaToolandRunSelfExecutablesWithJavaTool. The former is used whenever thejavabinary is required and no toolchain is defined. The latter controls whether this tool is invoked as part of the preamble in self-executable JARs outputted byjava_binary; if this is enabled, none of the build commands executed by (or outputs from) the rules in this plugin require a JRE or JDK to be present in the system path, although self-executable JARs will need to be run withjava -jarif they are moved outside of the Please repo. This option causes breaking changes when enabled and is therefore disabled by default.