Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[toolchains] Add native.toolchain arguments to define_kt_toolchain #1213

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/kotlin.md
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ kt_plugin_cfg(<a href="#kt_plugin_cfg-name">name</a>, <a href="#kt_plugin_cfg-de
define_kt_toolchain(<a href="#define_kt_toolchain-name">name</a>, <a href="#define_kt_toolchain-language_version">language_version</a>, <a href="#define_kt_toolchain-api_version">api_version</a>, <a href="#define_kt_toolchain-jvm_target">jvm_target</a>, <a href="#define_kt_toolchain-experimental_use_abi_jars">experimental_use_abi_jars</a>,
<a href="#define_kt_toolchain-experimental_strict_kotlin_deps">experimental_strict_kotlin_deps</a>, <a href="#define_kt_toolchain-experimental_report_unused_deps">experimental_report_unused_deps</a>,
<a href="#define_kt_toolchain-experimental_reduce_classpath_mode">experimental_reduce_classpath_mode</a>, <a href="#define_kt_toolchain-experimental_multiplex_workers">experimental_multiplex_workers</a>, <a href="#define_kt_toolchain-javac_options">javac_options</a>,
<a href="#define_kt_toolchain-kotlinc_options">kotlinc_options</a>, <a href="#define_kt_toolchain-jacocorunner">jacocorunner</a>)
<a href="#define_kt_toolchain-kotlinc_options">kotlinc_options</a>, <a href="#define_kt_toolchain-jacocorunner">jacocorunner</a>, <a href="#define_kt_toolchain-exec_compatible_with">exec_compatible_with</a>, <a href="#define_kt_toolchain-target_compatible_with">target_compatible_with</a>,
<a href="#define_kt_toolchain-target_settings">target_settings</a>)
</pre>

Define the Kotlin toolchain.
Expand All @@ -505,6 +506,9 @@ Define the Kotlin toolchain.
| <a id="define_kt_toolchain-javac_options"></a>javac_options | <p align="center"> - </p> | <code>Label("//kotlin/internal:default_javac_options")</code> |
| <a id="define_kt_toolchain-kotlinc_options"></a>kotlinc_options | <p align="center"> - </p> | <code>Label("//kotlin/internal:default_kotlinc_options")</code> |
| <a id="define_kt_toolchain-jacocorunner"></a>jacocorunner | <p align="center"> - </p> | <code>None</code> |
| <a id="define_kt_toolchain-exec_compatible_with"></a>exec_compatible_with | <p align="center"> - </p> | <code>None</code> |
| <a id="define_kt_toolchain-target_compatible_with"></a>target_compatible_with | <p align="center"> - </p> | <code>None</code> |
| <a id="define_kt_toolchain-target_settings"></a>target_settings | <p align="center"> - </p> | <code>None</code> |


<a id="kt_register_toolchains"></a>
Expand Down
8 changes: 7 additions & 1 deletion kotlin/internal/toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ def define_kt_toolchain(
experimental_multiplex_workers = None,
javac_options = Label("//kotlin/internal:default_javac_options"),
kotlinc_options = Label("//kotlin/internal:default_kotlinc_options"),
jacocorunner = None):
jacocorunner = None,
exec_compatible_with = None,
target_compatible_with = None,
target_settings = None):
"""Define the Kotlin toolchain."""
impl_name = name + "_impl"

Expand Down Expand Up @@ -330,6 +333,9 @@ def define_kt_toolchain(
toolchain_type = _TOOLCHAIN_TYPE,
toolchain = impl_name,
visibility = ["//visibility:public"],
exec_compatible_with = exec_compatible_with or [],
target_compatible_with = target_compatible_with or [],
target_settings = target_settings or [],
)

def kt_configure_toolchains():
Expand Down
5 changes: 5 additions & 0 deletions scripts/generate_docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

bazel build //kotlin:stardoc || fail "docs did not generate"

cp -f bazel-bin/kotlin/kotlin.md docs/ || fail "couldn't copy"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to include this in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes it easier to update the docs.

4 changes: 1 addition & 3 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ if test ! -d examples; then
fi

# generate stardoc
bazel build //kotlin:stardoc || fail "docs did not generate"

cp -f bazel-bin/kotlin/kotlin.md docs/ || fail "couldn't copy"
source scripts/generate_docs

bazel test //...:all || fail "tests failed"

Expand Down