Skip to content

Commit

Permalink
[toolchains] Add native.toolchain arguments to define_kt_toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
restingbull committed Sep 6, 2024
1 parent e39c952 commit 172496b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
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"
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

0 comments on commit 172496b

Please sign in to comment.