feat(presets): java bazelrc options (#947)

* feat(presets): java bazelrc options

* chore: improved comments
This commit is contained in:
Alex Eagle 2024-10-04 08:34:34 -07:00 committed by GitHub
parent f479afd502
commit 1b4d9a7f04
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,27 @@
# Aspect recommended Bazel flags when using rules_java and rules_jvm_external
# Pin java versions to desired language level
# See https://bazel.build/docs/bazel-and-java#java-versions
# and https://en.wikipedia.org/wiki/Java_version_history
# What version of Java are the source files in this repo?
# See https://bazel.build/docs/user-manual#java-language-version
common --java_language_version=17
# The Java language version used to build tools that are executed during a build
# See https://bazel.build/docs/user-manual#tool-java-language-version
common --tool_java_language_version=17
# The version of JVM to use to execute the code and run the tests.
# NB: The default value is local_jdk which is non-hermetic.
# See https://bazel.build/docs/user-manual#java-runtime-version
common --java_runtime_version=remotejdk_17
# The version of JVM used to execute tools that are needed during a build.
# See https://bazel.build/docs/user-manual#tool-java-runtime-version
common --tool_java_runtime_version=remotejdk_17
# Repository rules, such as rules_jvm_external: put Bazel's JDK on the path.
# Avoids non-hermeticity from dependency on a JAVA_HOME pointing at a system JDK
# see https://github.com/bazelbuild/rules_jvm_external/issues/445
common --repo_env=JAVA_HOME=../bazel_tools/jdk

View File

@ -27,7 +27,7 @@ the `presets` attribute.
| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="write_aspect_bazelrc_presets-name"></a>name | a unique name for this target | none |
| <a id="write_aspect_bazelrc_presets-presets"></a>presets | a list of preset names to keep up-to-date | `["bazel6", "bazel7", "ci", "convenience", "correctness", "debug", "javascript", "performance"]` |
| <a id="write_aspect_bazelrc_presets-presets"></a>presets | a list of preset names to keep up-to-date | `["bazel6", "bazel7", "ci", "convenience", "correctness", "debug", "java", "javascript", "performance"]` |
| <a id="write_aspect_bazelrc_presets-kwargs"></a>kwargs | Additional arguments to pass to `write_source_files` | none |

View File

@ -12,6 +12,7 @@ ALL_PRESETS = [
"convenience",
"correctness",
"debug",
"java",
"javascript",
"performance",
]