Skip to content

Commit 8b73e9f

Browse files
fix docs
1 parent fe83743 commit 8b73e9f

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

docs/kotlin.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ Define java compiler options for `kt_jvm_*` rules with java sources.
3737
<pre>
3838
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_binary")
3939

40-
kt_jvm_binary(<a href="#kt_jvm_binary-name">name</a>, <a href="#kt_jvm_binary-deps">deps</a>, <a href="#kt_jvm_binary-srcs">srcs</a>, <a href="#kt_jvm_binary-data">data</a>, <a href="#kt_jvm_binary-resources">resources</a>, <a href="#kt_jvm_binary-associates">associates</a>, <a href="#kt_jvm_binary-java_stub_template">java_stub_template</a>, <a href="#kt_jvm_binary-javac_opts">javac_opts</a>,
41-
<a href="#kt_jvm_binary-jvm_flags">jvm_flags</a>, <a href="#kt_jvm_binary-kotlinc_opts">kotlinc_opts</a>, <a href="#kt_jvm_binary-main_class">main_class</a>, <a href="#kt_jvm_binary-module_name">module_name</a>, <a href="#kt_jvm_binary-plugins">plugins</a>, <a href="#kt_jvm_binary-resource_jars">resource_jars</a>,
42-
<a href="#kt_jvm_binary-resource_strip_prefix">resource_strip_prefix</a>, <a href="#kt_jvm_binary-runtime_deps">runtime_deps</a>)
40+
kt_jvm_binary(<a href="#kt_jvm_binary-name">name</a>, <a href="#kt_jvm_binary-deps">deps</a>, <a href="#kt_jvm_binary-srcs">srcs</a>, <a href="#kt_jvm_binary-data">data</a>, <a href="#kt_jvm_binary-resources">resources</a>, <a href="#kt_jvm_binary-associates">associates</a>, <a href="#kt_jvm_binary-experimental_report_unused_deps">experimental_report_unused_deps</a>,
41+
<a href="#kt_jvm_binary-experimental_unused_deps_ignored_targets">experimental_unused_deps_ignored_targets</a>, <a href="#kt_jvm_binary-java_stub_template">java_stub_template</a>, <a href="#kt_jvm_binary-javac_opts">javac_opts</a>, <a href="#kt_jvm_binary-jvm_flags">jvm_flags</a>,
42+
<a href="#kt_jvm_binary-kotlinc_opts">kotlinc_opts</a>, <a href="#kt_jvm_binary-main_class">main_class</a>, <a href="#kt_jvm_binary-module_name">module_name</a>, <a href="#kt_jvm_binary-plugins">plugins</a>, <a href="#kt_jvm_binary-resource_jars">resource_jars</a>, <a href="#kt_jvm_binary-resource_strip_prefix">resource_strip_prefix</a>,
43+
<a href="#kt_jvm_binary-runtime_deps">runtime_deps</a>)
4344
</pre>
4445

4546
Builds a Java archive ("jar file"), plus a wrapper shell script with the same name as the rule. The wrapper
@@ -60,6 +61,8 @@ It is appropriate for building workspace utilities. `java_binary` should be pref
6061
| <a id="kt_jvm_binary-data"></a>data | The list of files needed by this rule at runtime. See general comments about `data` at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
6162
| <a id="kt_jvm_binary-resources"></a>resources | A list of files that should be include in a Java jar. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
6263
| <a id="kt_jvm_binary-associates"></a>associates | Kotlin deps who should be considered part of the same module/compilation-unit for the purposes of "internal" access. Such deps must all share the same module space and so a target cannot associate to two deps from two different modules. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
64+
| <a id="kt_jvm_binary-experimental_report_unused_deps"></a>experimental_report_unused_deps | Report unused dependencies If set, overrides the global setting for this target. | String | optional | `""` |
65+
| <a id="kt_jvm_binary-experimental_unused_deps_ignored_targets"></a>experimental_unused_deps_ignored_targets | Unused dependencies ignored targets. Targets listed here will not be reported as unused dependencies, even if they are not used by the target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
6366
| <a id="kt_jvm_binary-java_stub_template"></a>java_stub_template | - | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `"@rules_kotlin//third_party:java_stub_template.txt"` |
6467
| <a id="kt_jvm_binary-javac_opts"></a>javac_opts | Javac options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `None` |
6568
| <a id="kt_jvm_binary-jvm_flags"></a>jvm_flags | A list of flags to embed in the wrapper script generated for running this binary. Note: does not yet support make variable substitution. | List of strings | optional | `[]` |
@@ -137,7 +140,8 @@ kt_jvm_import(
137140
<pre>
138141
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
139142

140-
kt_jvm_library(<a href="#kt_jvm_library-name">name</a>, <a href="#kt_jvm_library-deps">deps</a>, <a href="#kt_jvm_library-srcs">srcs</a>, <a href="#kt_jvm_library-data">data</a>, <a href="#kt_jvm_library-resources">resources</a>, <a href="#kt_jvm_library-associates">associates</a>, <a href="#kt_jvm_library-exported_compiler_plugins">exported_compiler_plugins</a>, <a href="#kt_jvm_library-exports">exports</a>,
143+
kt_jvm_library(<a href="#kt_jvm_library-name">name</a>, <a href="#kt_jvm_library-deps">deps</a>, <a href="#kt_jvm_library-srcs">srcs</a>, <a href="#kt_jvm_library-data">data</a>, <a href="#kt_jvm_library-resources">resources</a>, <a href="#kt_jvm_library-associates">associates</a>, <a href="#kt_jvm_library-experimental_report_unused_deps">experimental_report_unused_deps</a>,
144+
<a href="#kt_jvm_library-experimental_unused_deps_ignored_targets">experimental_unused_deps_ignored_targets</a>, <a href="#kt_jvm_library-exported_compiler_plugins">exported_compiler_plugins</a>, <a href="#kt_jvm_library-exports">exports</a>,
141145
<a href="#kt_jvm_library-java_stub_template">java_stub_template</a>, <a href="#kt_jvm_library-javac_opts">javac_opts</a>, <a href="#kt_jvm_library-kotlinc_opts">kotlinc_opts</a>, <a href="#kt_jvm_library-module_name">module_name</a>, <a href="#kt_jvm_library-neverlink">neverlink</a>, <a href="#kt_jvm_library-plugins">plugins</a>,
142146
<a href="#kt_jvm_library-resource_jars">resource_jars</a>, <a href="#kt_jvm_library-resource_strip_prefix">resource_strip_prefix</a>, <a href="#kt_jvm_library-runtime_deps">runtime_deps</a>)
143147
</pre>
@@ -155,6 +159,8 @@ This rule compiles and links Kotlin and Java sources into a .jar file.
155159
| <a id="kt_jvm_library-data"></a>data | The list of files needed by this rule at runtime. See general comments about `data` at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
156160
| <a id="kt_jvm_library-resources"></a>resources | A list of files that should be include in a Java jar. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
157161
| <a id="kt_jvm_library-associates"></a>associates | Kotlin deps who should be considered part of the same module/compilation-unit for the purposes of "internal" access. Such deps must all share the same module space and so a target cannot associate to two deps from two different modules. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
162+
| <a id="kt_jvm_library-experimental_report_unused_deps"></a>experimental_report_unused_deps | Report unused dependencies If set, overrides the global setting for this target. | String | optional | `""` |
163+
| <a id="kt_jvm_library-experimental_unused_deps_ignored_targets"></a>experimental_unused_deps_ignored_targets | Unused dependencies ignored targets. Targets listed here will not be reported as unused dependencies, even if they are not used by the target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
158164
| <a id="kt_jvm_library-exported_compiler_plugins"></a>exported_compiler_plugins | Exported compiler plugins.<br><br>Compiler plugins listed here will be treated as if they were added in the plugins attribute of any targets that directly depend on this target. Like `java_plugin`s exported_plugins, this is not transitive | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
159165
| <a id="kt_jvm_library-exports"></a>exports | Exported libraries.<br><br>Deps listed here will be made available to other rules, as if the parents explicitly depended on these deps. This is not true for regular (non-exported) deps. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
160166
| <a id="kt_jvm_library-java_stub_template"></a>java_stub_template | - | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `"@rules_kotlin//third_party:java_stub_template.txt"` |
@@ -175,9 +181,10 @@ This rule compiles and links Kotlin and Java sources into a .jar file.
175181
<pre>
176182
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test")
177183

178-
kt_jvm_test(<a href="#kt_jvm_test-name">name</a>, <a href="#kt_jvm_test-deps">deps</a>, <a href="#kt_jvm_test-srcs">srcs</a>, <a href="#kt_jvm_test-data">data</a>, <a href="#kt_jvm_test-resources">resources</a>, <a href="#kt_jvm_test-associates">associates</a>, <a href="#kt_jvm_test-env">env</a>, <a href="#kt_jvm_test-java_stub_template">java_stub_template</a>, <a href="#kt_jvm_test-javac_opts">javac_opts</a>,
179-
<a href="#kt_jvm_test-jvm_flags">jvm_flags</a>, <a href="#kt_jvm_test-kotlinc_opts">kotlinc_opts</a>, <a href="#kt_jvm_test-main_class">main_class</a>, <a href="#kt_jvm_test-module_name">module_name</a>, <a href="#kt_jvm_test-plugins">plugins</a>, <a href="#kt_jvm_test-resource_jars">resource_jars</a>,
180-
<a href="#kt_jvm_test-resource_strip_prefix">resource_strip_prefix</a>, <a href="#kt_jvm_test-runtime_deps">runtime_deps</a>, <a href="#kt_jvm_test-test_class">test_class</a>)
184+
kt_jvm_test(<a href="#kt_jvm_test-name">name</a>, <a href="#kt_jvm_test-deps">deps</a>, <a href="#kt_jvm_test-srcs">srcs</a>, <a href="#kt_jvm_test-data">data</a>, <a href="#kt_jvm_test-resources">resources</a>, <a href="#kt_jvm_test-associates">associates</a>, <a href="#kt_jvm_test-env">env</a>, <a href="#kt_jvm_test-experimental_report_unused_deps">experimental_report_unused_deps</a>,
185+
<a href="#kt_jvm_test-experimental_unused_deps_ignored_targets">experimental_unused_deps_ignored_targets</a>, <a href="#kt_jvm_test-java_stub_template">java_stub_template</a>, <a href="#kt_jvm_test-javac_opts">javac_opts</a>, <a href="#kt_jvm_test-jvm_flags">jvm_flags</a>,
186+
<a href="#kt_jvm_test-kotlinc_opts">kotlinc_opts</a>, <a href="#kt_jvm_test-main_class">main_class</a>, <a href="#kt_jvm_test-module_name">module_name</a>, <a href="#kt_jvm_test-plugins">plugins</a>, <a href="#kt_jvm_test-resource_jars">resource_jars</a>, <a href="#kt_jvm_test-resource_strip_prefix">resource_strip_prefix</a>,
187+
<a href="#kt_jvm_test-runtime_deps">runtime_deps</a>, <a href="#kt_jvm_test-test_class">test_class</a>)
181188
</pre>
182189

183190
Setup a simple kotlin_test.
@@ -198,6 +205,8 @@ Setup a simple kotlin_test.
198205
| <a id="kt_jvm_test-resources"></a>resources | A list of files that should be include in a Java jar. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
199206
| <a id="kt_jvm_test-associates"></a>associates | Kotlin deps who should be considered part of the same module/compilation-unit for the purposes of "internal" access. Such deps must all share the same module space and so a target cannot associate to two deps from two different modules. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
200207
| <a id="kt_jvm_test-env"></a>env | Specifies additional environment variables to set when the target is executed by bazel test. | <a href="https://bazel.build/rules/lib/dict">Dictionary: String -> String</a> | optional | `{}` |
208+
| <a id="kt_jvm_test-experimental_report_unused_deps"></a>experimental_report_unused_deps | Report unused dependencies If set, overrides the global setting for this target. | String | optional | `""` |
209+
| <a id="kt_jvm_test-experimental_unused_deps_ignored_targets"></a>experimental_unused_deps_ignored_targets | Unused dependencies ignored targets. Targets listed here will not be reported as unused dependencies, even if they are not used by the target. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
201210
| <a id="kt_jvm_test-java_stub_template"></a>java_stub_template | - | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `"@rules_kotlin//third_party:java_stub_template.txt"` |
202211
| <a id="kt_jvm_test-javac_opts"></a>javac_opts | Javac options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `None` |
203212
| <a id="kt_jvm_test-jvm_flags"></a>jvm_flags | A list of flags to embed in the wrapper script generated for running this binary. Note: does not yet support make variable substitution. | List of strings | optional | `[]` |
@@ -413,7 +422,7 @@ Define kotlin compiler options.
413422
| <a id="kt_kotlinc_options-x_enable_incremental_compilation"></a>x_enable_incremental_compilation | Enable incremental compilation | Boolean | optional | `False` |
414423
| <a id="kt_kotlinc_options-x_explicit_api_mode"></a>x_explicit_api_mode | Enable explicit API mode for Kotlin libraries. | String | optional | `"off"` |
415424
| <a id="kt_kotlinc_options-x_inline_classes"></a>x_inline_classes | Enable experimental inline classes | Boolean | optional | `False` |
416-
| <a id="kt_kotlinc_options-x_jdk_release"></a>x_jdk_release | Compile against the specified JDK API version, similarly to javac's '-release'. This requires JDK 9 or newer. The supported versions depend on the JDK used; for JDK 17+, the supported versions are 1.8 and 9–21. This also sets the value of '-jvm-target' to be equal to the selected JDK version. | String | optional | `""` |
425+
| <a id="kt_kotlinc_options-x_jdk_release"></a>x_jdk_release | Compile against the specified JDK API version, similarly to javac's '-release'. This requires JDK 9 or newer. The supported versions depend on the JDK used; for JDK 17+, the supported versions are 1.8 and 9–21. This also sets the value of '-jvm-target' to be equal to the selected JDK version. | String | optional | `""` |
417426
| <a id="kt_kotlinc_options-x_jspecify_annotations"></a>x_jspecify_annotations | Controls how JSpecify annotations are treated. Options are 'default', 'ignore', 'warn', and 'strict'. | String | optional | `""` |
418427
| <a id="kt_kotlinc_options-x_jsr_305"></a>x_jsr_305 | Specifies how to handle JSR-305 annotations in Kotlin code. Options are 'default', 'ignore', 'warn', and 'strict'. | String | optional | `""` |
419428
| <a id="kt_kotlinc_options-x_jvm_default"></a>x_jvm_default | Specifies that a JVM default method should be generated for non-abstract Kotlin interface member. | String | optional | `"off"` |
@@ -598,7 +607,7 @@ Call this in the WORKSPACE file to setup the Kotlin rules.
598607
<pre>
599608
load("@rules_kotlin//kotlin:repositories.doc.bzl", "versions")
600609

601-
versions.use_repository(<a href="#versions.use_repository-name">name</a>, <a href="#versions.use_repository-version">version</a>, <a href="#versions.use_repository-rule">rule</a>, <a href="#versions.use_repository-kwargs">kwargs</a>)
610+
versions.use_repository(<a href="#versions.use_repository-name">name</a>, <a href="#versions.use_repository-version">version</a>, <a href="#versions.use_repository-rule">rule</a>, <a href="#versions.use_repository-kwargs">**kwargs</a>)
602611
</pre>
603612

604613

0 commit comments

Comments
 (0)