-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Bazel: update rules_kotlin to 2.1.3
#19385
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
misc/bazel/registry/modules/rules_kotlin/2.1.3-codeql.1/MODULE.bazel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| module( | ||
| name = "rules_kotlin", | ||
| version = "2.1.3-codeql.1", | ||
| compatibility_level = 1, | ||
| repo_name = "rules_kotlin", | ||
| ) | ||
|
|
||
| bazel_dep(name = "platforms", version = "0.0.11") | ||
| bazel_dep(name = "bazel_skylib", version = "1.7.1") | ||
| bazel_dep(name = "rules_java", version = "7.2.0") | ||
| bazel_dep(name = "rules_python", version = "0.23.1") | ||
| bazel_dep(name = "rules_cc", version = "0.0.8") | ||
| bazel_dep(name = "rules_android", version = "0.1.1") | ||
|
|
||
| rules_kotlin_extensions = use_extension( | ||
| "//src/main/starlark/core/repositories:bzlmod_setup.bzl", | ||
| "rules_kotlin_extensions", | ||
| ) | ||
| use_repo( | ||
| rules_kotlin_extensions, | ||
| "com_github_google_ksp", | ||
| "com_github_jetbrains_kotlin", | ||
| "com_github_pinterest_ktlint", | ||
| "kotlinx_serialization_core_jvm", | ||
| "kotlinx_serialization_json", | ||
| "kotlinx_serialization_json_jvm", | ||
| ) | ||
|
|
||
| register_toolchains("//kotlin/internal:default_toolchain") | ||
|
|
||
| # TODO(bencodes) We should be able to remove this once rules_android has rolled out official Bzlmod support | ||
| remote_android_extensions = use_extension("@bazel_tools//tools/android:android_extensions.bzl", "remote_android_tools_extensions") | ||
| use_repo(remote_android_extensions, "android_gmaven_r8", "android_tools") | ||
|
|
||
| bazel_dep(name = "rules_proto", version = "5.3.0-21.7") |
32 changes: 32 additions & 0 deletions
32
...stry/modules/rules_kotlin/2.1.3-codeql.1/patches/codeql_add_language_version_option.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| diff --git a/src/main/starlark/core/options/opts.kotlinc.bzl b/src/main/starlark/core/options/opts.kotlinc.bzl | ||
| index 76df826..ef2d6ca 100644 | ||
| --- a/src/main/starlark/core/options/opts.kotlinc.bzl | ||
| +++ b/src/main/starlark/core/options/opts.kotlinc.bzl | ||
| @@ -33,6 +33,11 @@ def _map_jdk_release_to_flag(version): | ||
| return None | ||
| return ["-Xjdk-release=%s" % version] | ||
|
|
||
| +def _map_language_version_to_flag(version): | ||
| + if not version: | ||
| + return None | ||
| + return ["-language-version=%s" % version, "-api-version=%s" % version] | ||
| + | ||
| _KOPTS_ALL = { | ||
| "warn": struct( | ||
| args = dict( | ||
| @@ -429,6 +434,15 @@ _KOPTS_ALL = { | ||
| value_to_flag = None, | ||
| map_value_to_flag = _map_jdk_release_to_flag, | ||
| ), | ||
| + "language_version": struct( | ||
| + args = dict( | ||
| + default = "1.9", | ||
| + doc = "-language-version", | ||
| + ), | ||
| + type = attr.string, | ||
| + value_to_flag = None, | ||
| + map_value_to_flag = _map_language_version_to_flag, | ||
| + ), | ||
| } | ||
|
|
||
| def _merge(key, rule_defined): |
16 changes: 16 additions & 0 deletions
16
...bazel/registry/modules/rules_kotlin/2.1.3-codeql.1/patches/codeql_do_not_emit_jdeps.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| Emitting jdeps is broken for the 2.0.0 kotlin extractor, and we don't need those files. | ||
| Patching it here rather than passing `--@rules_kotlin//kotlin/settings:jvm_emit_jdeps=false` | ||
| allows us to not have to specify that option (and therefore pull in `rules_kotlin`) in `semmle-code`. | ||
| diff --git a/kotlin/settings/BUILD.bazel b/kotlin/settings/BUILD.bazel | ||
| index 2c93c11..f352b80 100644 | ||
| --- a/kotlin/settings/BUILD.bazel | ||
| +++ b/kotlin/settings/BUILD.bazel | ||
| @@ -25,7 +25,7 @@ release_archive( | ||
| # Flag that controls the emission of jdeps files during kotlin jvm compilation. | ||
| bool_flag( | ||
| name = "jvm_emit_jdeps", | ||
| - build_setting_default = True, # Upstream default behavior | ||
| + build_setting_default = False, | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
9 changes: 9 additions & 0 deletions
9
misc/bazel/registry/modules/rules_kotlin/2.1.3-codeql.1/source.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "integrity": "sha256-4USKVrJGJAeyaI3qht9cN1s2oJkb1HjC3dlMlxaBJeI=", | ||
| "url": "https://github.com/bazelbuild/rules_kotlin/releases/download/v2.1.3/rules_kotlin-v2.1.3.tar.gz", | ||
| "patches": { | ||
| "codeql_do_not_emit_jdeps.patch": "sha256-1ir4Aio1SICxnj1wafQ0GefT/m7bwn2n+SQwq19V3A8=", | ||
| "codeql_add_language_version_option.patch": "sha256-F7RthnrO6kJlCNcQ76L1Utqll2OwyeFZ/HmT82NwgB4=" | ||
| }, | ||
| "patch_strip": 1 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need the old one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right,
semmle-codedoes not userules_kotlin, so we don't really need to keep the old one around. Ifsemmle-codedid use it we could keep it around until the next bump, but no need here.