From 94858239ada74037858610507a6f1ab2cb732b74 Mon Sep 17 00:00:00 2001 From: Corbin McNeely-Smith <58151731+restingbull@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:39:21 -0500 Subject: [PATCH] [stardoc] Update stardoc to 7.0.0 Of special note: > The Markdown renderer now uses Google EscapeVelocity instead of Apache Velocity for templating. The templating engines are almost compatible, with the exception of escapes in string literals: if in your template you had a string literal with a character escape, you would need to expand it. [Release Notes for 0.6.0](https://github.com/bazelbuild/stardoc/releases/tag/0.6.0) "almost", indeed. :/ fixes #1203 --- MODULE.bazel | 2 +- docs/kotlin.md | 165 ++++++++++++++++++----------------- kotlin/doc-templates/rule.vm | 10 ++- 3 files changed, 94 insertions(+), 83 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 3ae063e51..fc6af554b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -89,7 +89,7 @@ maven.install( use_repo(maven, "kotlin_rules_maven", "unpinned_kotlin_rules_maven") bazel_dep(name = "rules_pkg", version = "0.7.0") -bazel_dep(name = "stardoc", version = "0.5.6", repo_name = "io_bazel_stardoc") +bazel_dep(name = "stardoc", version = "0.7.0", repo_name = "io_bazel_stardoc") bazel_dep(name = "rules_proto", version = "5.3.0-21.7") bazel_dep(name = "rules_testing", version = "0.5.0", dev_dependency = True) diff --git a/docs/kotlin.md b/docs/kotlin.md index 041385140..ca17676ce 100755 --- a/docs/kotlin.md +++ b/docs/kotlin.md @@ -32,9 +32,8 @@ kt_javac_options(name, name, associates, data, deps, javac_opts, jvm_flags, kotlinc_opts, main_class, - module_name, plugins, resource_jars, resource_strip_prefix, resources, runtime_deps, - srcs) +kt_jvm_binary(name, deps, srcs, data, resources, associates, javac_opts, jvm_flags, kotlinc_opts, + main_class, module_name, plugins, resource_jars, resource_strip_prefix, runtime_deps) Builds a Java archive ("jar file"), plus a wrapper shell script with the same name as the rule. The wrapper @@ -51,20 +50,20 @@ kt_jvm_binary(name, name | A unique name for this target. | Name | required | | -|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. | List of labels | optional | [] | -|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). | List of labels | optional | [] | -|deps | A list of dependencies of this rule.See general comments about deps at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | List of labels | optional | [] | -|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. | Label | optional | None | -|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 | [] | -|kotlinc_opts | Kotlinc options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | Label | optional | None | +|deps | A list of dependencies of this rule.See general comments about `deps` at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | List of labels | optional | [] | +|srcs | The list of source files that are processed to create the target, this can contain both Java and Kotlin files. Java analysis occurs first so Kotlin classes may depend on Java classes in the same compilation unit. | List of labels | optional | [] | +|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). | List of labels | optional | [] | +|resources | A list of files that should be include in a Java jar. | List of labels | optional | [] | +|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. | List of labels | optional | [] | +|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. | Label | optional | None | +|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 | [] | +|kotlinc_opts | Kotlinc options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | Label | optional | None | |main_class | Name of class with main() method to use as entry point. | String | required | | -|module_name | The name of the module, if not provided the module name is derived from the label. --e.g., //some/package/path:label_name is translated to some_package_path-label_name. | String | optional | "" | +|module_name | The name of the module, if not provided the module name is derived from the label. --e.g., `//some/package/path:label_name` is translated to `some_package_path-label_name`. | String | optional | "" | |plugins | - | List of labels | optional | [] | -|resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | List of labels | optional | [] | -|resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as src/main/resources or src/test/resources or kotlin will have stripping applied by convention. | String | optional | "" | -|resources | A list of files that should be include in a Java jar. | List of labels | optional | [] | -|runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | List of labels | optional | [] | -|srcs | The list of source files that are processed to create the target, this can contain both Java and Kotlin files. Java analysis occurs first so Kotlin classes may depend on Java classes in the same compilation unit. | List of labels | optional | [] | +|resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | List of labels | optional | [] | +|resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention. | String | optional | "" | +|runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | List of labels | optional | [] | @@ -117,19 +116,19 @@ kt_jvm_import(name, exported_compiler_plugins | Exported compiler plugins.

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. Unlike java_plugins' exported_plugins, this is not transitive | List of labels | optional | [] | |exports | Exported libraries.

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. | List of labels | optional | [] | |jar | The jar listed here is equivalent to an export attribute. | Label | optional | None | -|jars | The jars listed here are equavalent to an export attribute. The label should be either to a single class jar, or one or more filegroup labels. The filegroups, when resolved, must contain only one jar containing classes, and (optionally) one peer file containing sources, named <jarname>-sources.jar.

DEPRECATED - please use jar and srcjar attributes. | List of labels | optional | [] | +|jars | The jars listed here are equavalent to an export attribute. The label should be either to a single class jar, or one or more filegroup labels. The filegroups, when resolved, must contain only one jar containing classes, and (optionally) one peer file containing sources, named `-sources.jar`.

DEPRECATED - please use `jar` and `srcjar` attributes. | List of labels | optional | [] | |neverlink | If true only use this library for compilation and not at runtime. | Boolean | optional | False | |runtime_deps | Additional runtime deps. | List of labels | optional | [] | -|srcjar | The sources for the class jar. | Label | optional | //third_party:empty.jar | +|srcjar | The sources for the class jar. | Label | optional | "@rules_kotlin//third_party:empty.jar" | ## kt_jvm_library -kt_jvm_library(name, associates, data, deps, exported_compiler_plugins, exports, javac_opts, - kotlinc_opts, module_name, neverlink, plugins, resource_jars, resource_strip_prefix, - resources, runtime_deps, srcs) +kt_jvm_library(name, deps, srcs, data, resources, associates, exported_compiler_plugins, exports, + javac_opts, kotlinc_opts, module_name, neverlink, plugins, resource_jars, + resource_strip_prefix, runtime_deps) This rule compiles and links Kotlin and Java sources into a .jar file. @@ -141,29 +140,29 @@ kt_jvm_library(name, name | A unique name for this target. | Name | required | | -|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. | List of labels | optional | [] | -|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). | List of labels | optional | [] | -|deps | A list of dependencies of this rule.See general comments about deps at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | List of labels | optional | [] | -|exported_compiler_plugins | Exported compiler plugins.

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. Unlike java_plugins exported_plugins, this is not transitive | List of labels | optional | [] | +|deps | A list of dependencies of this rule.See general comments about `deps` at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | List of labels | optional | [] | +|srcs | The list of source files that are processed to create the target, this can contain both Java and Kotlin files. Java analysis occurs first so Kotlin classes may depend on Java classes in the same compilation unit. | List of labels | optional | [] | +|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). | List of labels | optional | [] | +|resources | A list of files that should be include in a Java jar. | List of labels | optional | [] | +|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. | List of labels | optional | [] | +|exported_compiler_plugins | Exported compiler plugins.

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. Unlike `java_plugin`s exported_plugins, this is not transitive | List of labels | optional | [] | |exports | Exported libraries.

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. | List of labels | optional | [] | -|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. | Label | optional | None | -|kotlinc_opts | Kotlinc options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | Label | optional | None | -|module_name | The name of the module, if not provided the module name is derived from the label. --e.g., //some/package/path:label_name is translated to some_package_path-label_name. | String | optional | "" | +|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. | Label | optional | None | +|kotlinc_opts | Kotlinc options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | Label | optional | None | +|module_name | The name of the module, if not provided the module name is derived from the label. --e.g., `//some/package/path:label_name` is translated to `some_package_path-label_name`. | String | optional | "" | |neverlink | If true only use this library for compilation and not at runtime. | Boolean | optional | False | |plugins | - | List of labels | optional | [] | -|resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | List of labels | optional | [] | -|resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as src/main/resources or src/test/resources or kotlin will have stripping applied by convention. | String | optional | "" | -|resources | A list of files that should be include in a Java jar. | List of labels | optional | [] | -|runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | List of labels | optional | [] | -|srcs | The list of source files that are processed to create the target, this can contain both Java and Kotlin files. Java analysis occurs first so Kotlin classes may depend on Java classes in the same compilation unit. | List of labels | optional | [] | +|resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | List of labels | optional | [] | +|resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention. | String | optional | "" | +|runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | List of labels | optional | [] | ## kt_jvm_test -kt_jvm_test(name, associates, data, deps, env, javac_opts, jvm_flags, kotlinc_opts, main_class, - module_name, plugins, resource_jars, resource_strip_prefix, resources, runtime_deps, srcs, +kt_jvm_test(name, deps, srcs, data, resources, associates, env, javac_opts, jvm_flags, kotlinc_opts, + main_class, module_name, plugins, resource_jars, resource_strip_prefix, runtime_deps, test_class) @@ -180,21 +179,21 @@ kt_jvm_test(name, name | A unique name for this target. | Name | required | | -|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. | List of labels | optional | [] | -|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). | List of labels | optional | [] | -|deps | A list of dependencies of this rule.See general comments about deps at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | List of labels | optional | [] | +|deps | A list of dependencies of this rule.See general comments about `deps` at [Attributes common to all build rules](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes). | List of labels | optional | [] | +|srcs | The list of source files that are processed to create the target, this can contain both Java and Kotlin files. Java analysis occurs first so Kotlin classes may depend on Java classes in the same compilation unit. | List of labels | optional | [] | +|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). | List of labels | optional | [] | +|resources | A list of files that should be include in a Java jar. | List of labels | optional | [] | +|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. | List of labels | optional | [] | |env | Specifies additional environment variables to set when the target is executed by bazel test. | Dictionary: String -> String | optional | {} | -|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. | Label | optional | None | -|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 | [] | -|kotlinc_opts | Kotlinc options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | Label | optional | None | +|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. | Label | optional | None | +|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 | [] | +|kotlinc_opts | Kotlinc options to be used when compiling this target. These opts if provided will be used instead of the ones provided to the toolchain. | Label | optional | None | |main_class | - | String | optional | "com.google.testing.junit.runner.BazelTestRunner" | -|module_name | The name of the module, if not provided the module name is derived from the label. --e.g., //some/package/path:label_name is translated to some_package_path-label_name. | String | optional | "" | +|module_name | The name of the module, if not provided the module name is derived from the label. --e.g., `//some/package/path:label_name` is translated to `some_package_path-label_name`. | String | optional | "" | |plugins | - | List of labels | optional | [] | -|resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | List of labels | optional | [] | -|resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as src/main/resources or src/test/resources or kotlin will have stripping applied by convention. | String | optional | "" | -|resources | A list of files that should be include in a Java jar. | List of labels | optional | [] | -|runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | List of labels | optional | [] | -|srcs | The list of source files that are processed to create the target, this can contain both Java and Kotlin files. Java analysis occurs first so Kotlin classes may depend on Java classes in the same compilation unit. | List of labels | optional | [] | +|resource_jars | Set of archives containing Java resources. If specified, the contents of these jars are merged into the output jar. | List of labels | optional | [] | +|resource_strip_prefix | The path prefix to strip from Java resources, files residing under common prefix such as `src/main/resources` or `src/test/resources` or `kotlin` will have stripping applied by convention. | String | optional | "" | +|runtime_deps | Libraries to make available to the final binary or test at runtime only. Like ordinary deps, these will appear on the runtime classpath, but unlike them, not on the compile-time classpath. | List of labels | optional | [] | |test_class | The Java class to be loaded by the test runner. | String | optional | "" | @@ -208,9 +207,9 @@ kt_jvm_test(name, name, android_rules_enabled, editorconfig, experimental_rules_enabled) - - Used to configure ktlint. - + + Used to configure ktlint. + `ktlint` can be configured to use a `.editorconfig`, as documented at https://github.com/pinterest/ktlint/#editorconfig @@ -230,7 +229,7 @@ ktlint_config(name, name, config, srcs) +ktlint_fix(name, srcs, config) Lint Kotlin files and automatically fix them as needed @@ -242,15 +241,15 @@ ktlint_fix(name, con | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | |name | A unique name for this target. | Name | required | | -|config | ktlint_config to use | Label | optional | None | |srcs | Source files to review and fix | List of labels | required | | +|config | ktlint_config to use | Label | optional | None | ## ktlint_test -ktlint_test(name, config, srcs) +ktlint_test(name, srcs, config) Lint Kotlin files, and fail if the linter raises errors. @@ -262,8 +261,8 @@ ktlint_test(name, | Name | Description | Type | Mandatory | Default | | :------------- | :------------- | :------------- | :------------- | :------------- | |name | A unique name for this target. | Name | required | | -|config | ktlint_config to use | Label | optional | None | |srcs | Source files to lint | List of labels | required | | +|config | ktlint_config to use | Label | optional | None | @@ -274,7 +273,7 @@ ktlint_test(name, ## kt_compiler_plugin -kt_compiler_plugin(name, compile_phase, deps, id, options, stubs_phase, target_embedded_compiler) +kt_compiler_plugin(name, deps, compile_phase, id, options, stubs_phase, target_embedded_compiler) Define a plugin for the Kotlin compiler to run. The plugin can then be referenced in the `plugins` attribute @@ -316,12 +315,12 @@ kt_compiler_plugin(name, name | A unique name for this target. | Name | required | | -|compile_phase | Runs the compiler plugin during kotlin compilation. Known examples: allopen, sam_with_reciever | Boolean | optional | True | |deps | The list of libraries to be added to the compiler's plugin classpath | List of labels | optional | [] | +|compile_phase | Runs the compiler plugin during kotlin compilation. Known examples: `allopen`, `sam_with_reciever` | Boolean | optional | True | |id | The ID of the plugin | String | required | | -|options | Dictionary of options to be passed to the plugin. Supports the following template values:

- {generatedClasses}: directory for generated class output - {temp}: temporary directory, discarded between invocations - {generatedSources}: directory for generated source output - {classpath} : replaced with a list of jars separated by the filesystem appropriate separator. | Dictionary: String -> String | optional | {} | +|options | Dictionary of options to be passed to the plugin. Supports the following template values:

- `{generatedClasses}`: directory for generated class output - `{temp}`: temporary directory, discarded between invocations - `{generatedSources}`: directory for generated source output - `{classpath}` : replaced with a list of jars separated by the filesystem appropriate separator. | Dictionary: String -> String | optional | {} | |stubs_phase | Runs the compiler plugin in kapt stub generation. | Boolean | optional | True | -|target_embedded_compiler | Plugin was compiled against the embeddable kotlin compiler. These plugins expect shaded kotlinc dependencies, and will fail when running against a non-embeddable compiler. | Boolean | optional | False | +|target_embedded_compiler | Plugin was compiled against the embeddable kotlin compiler. These plugins expect shaded kotlinc dependencies, and will fail when running against a non-embeddable compiler. | Boolean | optional | False | @@ -447,7 +446,7 @@ kt_ksp_plugin(name, deps | The list of libraries to be added to the compiler's plugin classpath | List of labels | optional | [] | |generates_java | Runs Java compilation action for plugin generating Java output. | Boolean | optional | False | |processor_class | The fully qualified class name that the Java compiler uses as an entry point to the annotation processor. | String | required | | -|target_embedded_compiler | Plugin was compiled against the embeddable kotlin compiler. These plugins expect shaded kotlinc dependencies, and will fail when running against a non-embeddable compiler. | Boolean | optional | False | +|target_embedded_compiler | Plugin was compiled against the embeddable kotlin compiler. These plugins expect shaded kotlinc dependencies, and will fail when running against a non-embeddable compiler. | Boolean | optional | False | @@ -456,12 +455,10 @@ kt_ksp_plugin(name, name, deps, options, plugin) - - - Configurations for kt_compiler_plugin, ksp_plugin, and java_plugin. - - This allows setting options and dependencies independently from the initial plugin definition. + + Configurations for kt_compiler_plugin, ksp_plugin, and java_plugin. + This allows setting options and dependencies independently from the initial plugin definition. **ATTRIBUTES** @@ -480,6 +477,8 @@ kt_plugin_cfg(name, name, language_version, api_version, jvm_target, experimental_use_abi_jars, experimental_strict_kotlin_deps, experimental_report_unused_deps, experimental_reduce_classpath_mode, experimental_multiplex_workers, javac_options, @@ -494,17 +493,17 @@ Define the Kotlin toolchain. | Name | Description | Default Value | | :------------- | :------------- | :------------- | | name |

-

| none | -| language_version |

-

| None | -| api_version |

-

| None | -| jvm_target |

-

| None | -| experimental_use_abi_jars |

-

| False | -| experimental_strict_kotlin_deps |

-

| None | -| experimental_report_unused_deps |

-

| None | -| experimental_reduce_classpath_mode |

-

| None | -| experimental_multiplex_workers |

-

| None | -| javac_options |

-

| Label("//kotlin/internal:default_javac_options") | -| kotlinc_options |

-

| Label("//kotlin/internal:default_kotlinc_options") | -| jacocorunner |

-

| None | +| language_version |

-

| `None` | +| api_version |

-

| `None` | +| jvm_target |

-

| `None` | +| experimental_use_abi_jars |

-

| `False` | +| experimental_strict_kotlin_deps |

-

| `None` | +| experimental_report_unused_deps |

-

| `None` | +| experimental_reduce_classpath_mode |

-

| `None` | +| experimental_multiplex_workers |

-

| `None` | +| javac_options |

-

| `Label("@rules_kotlin//kotlin/internal:default_javac_options")` | +| kotlinc_options |

-

| `Label("@rules_kotlin//kotlin/internal:default_kotlinc_options")` | +| jacocorunner |

-

| `None` | @@ -512,6 +511,8 @@ Define the Kotlin toolchain. ## kt_register_toolchains
+load("@rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
+
 kt_register_toolchains()
 
@@ -528,6 +529,8 @@ This macro registers the kotlin toolchain. ## kotlin_repositories
+load("@rules_kotlin//kotlin:repositories.doc.bzl", "kotlin_repositories")
+
 kotlin_repositories(is_bzlmod, compiler_repository_name, ksp_repository_name, compiler_release,
                     ksp_compiler_release)
 
@@ -539,11 +542,11 @@ Call this in the WORKSPACE file to setup the Kotlin rules. | Name | Description | Default Value | | :------------- | :------------- | :------------- | -| is_bzlmod |

-

| False | -| compiler_repository_name | for the kotlinc compiler repository. | "com_github_jetbrains_kotlin" | -| ksp_repository_name |

-

| "com_github_google_ksp" | -| compiler_release | version provider from versions.bzl. | struct() | -| ksp_compiler_release | (internal) version provider from versions.bzl. | struct() | +| is_bzlmod |

-

| `False` | +| compiler_repository_name | for the kotlinc compiler repository. | `"com_github_jetbrains_kotlin"` | +| ksp_repository_name |

-

| `"com_github_google_ksp"` | +| compiler_release | version provider from versions.bzl. | `struct(sha256 = "ef578730976154fd2c5968d75af8c2703b3de84a78dffe913f670326e149da3b", url_templates = ["https://github.com/JetBrains/kotlin/releases/download/v{version}/kotlin-compiler-{version}.zip"], version = "2.0.0")` | +| ksp_compiler_release | (internal) version provider from versions.bzl. | `struct(sha256 = "84100aed5b63effa992ce6574b3ba47d2dbb78529752daa4c181e203117ba7de", url_templates = ["https://github.com/google/ksp/releases/download/{version}/artifacts.zip"], version = "2.0.0-1.0.21")` | @@ -551,7 +554,9 @@ Call this in the WORKSPACE file to setup the Kotlin rules. ## versions.use_repository
-versions.use_repository(name, version, rule, kwargs)
+load("@rules_kotlin//kotlin:repositories.doc.bzl", "versions")
+
+versions.use_repository(name, version, rule, **kwargs)
 
diff --git a/kotlin/doc-templates/rule.vm b/kotlin/doc-templates/rule.vm index 9025a374b..1f68a4885 100644 --- a/kotlin/doc-templates/rule.vm +++ b/kotlin/doc-templates/rule.vm @@ -6,7 +6,10 @@ ${util.ruleSummary($ruleName, $ruleInfo)} ## find common nonzero indent #set($chomp=0) -#foreach ($ln in $ruleInfo.docString.split("\n")) +## > Stardoc 6.0.0 The Markdown renderer now uses Google EscapeVelocity instead of Apache Velocity for templating. +## No more \n in templating rules. :/ +#foreach ($ln in $ruleInfo.docString.split(" +")) #if ($ln.length() > 0) #foreach ($c in [0..$ln.length()]) #if (!$ln.substring(0, $c).trim().isEmpty()) @@ -22,7 +25,10 @@ ${util.ruleSummary($ruleName, $ruleInfo)} #end ## print lines, removing common indent. -#foreach ($ln in $ruleInfo.docString.split("\n")) +## > Stardoc 6.0.0 The Markdown renderer now uses Google EscapeVelocity instead of Apache Velocity for templating. +## No more \n in templating rules. :/ +#foreach ($ln in $ruleInfo.docString.split(" +")) #if ($ln.length() >= $chomp && $ln.substring(0, $chomp).trim().isEmpty()) ${ln.substring($chomp)} #else