Skip to content

Commit

Permalink
Use launcher stub template from bazel
Browse files Browse the repository at this point in the history
This was added in bazelbuild/bazel#12994 (and
fixed in bazelbuild/bazel#13790).

This has been included in all Bazel releases since 5.0.0, which is the
minimum supported Bazel version of rules_kotlin according to https://github.com/bazelbuild/rules_kotlin/blob/master/README.md

This prevents having a build-time dependency on access to
raw.githubusercontent.com.
  • Loading branch information
illicitonion committed Dec 5, 2023
1 parent 66c9b48 commit fa2ed1a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use_repo(
"com_github_google_ksp",
"com_github_jetbrains_kotlin",
"com_github_pinterest_ktlint",
"kt_java_stub_template",
"rules_android",
)

Expand Down
3 changes: 2 additions & 1 deletion kotlin/internal/jvm/jvm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ _implicit_deps = {
),
"_java_stub_template": attr.label(
cfg = "exec",
default = Label("@kt_java_stub_template//file"),
default = Label("@bazel_tools//tools/java:java_stub_template.txt"),
allow_single_file = True,
),
"_toolchain": attr.label(
doc = """The Kotlin JVM Runtime. it's only purpose is to enable the Android native rules to discover the Kotlin
Expand Down
9 changes: 0 additions & 9 deletions src/main/starlark/core/repositories/initialize.release.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ def kotlin_repositories(
strip_version = ksp_compiler_release.version,
)

http_file(
name = "kt_java_stub_template",
urls = [("https://raw.githubusercontent.com/bazelbuild/bazel/" +
versions.BAZEL_JAVA_LAUNCHER_VERSION +
"/src/main/java/com/google/devtools/build/lib/bazel/rules/java/" +
"java_stub_template.txt")],
sha256 = versions.BAZEL_JAVA_LAUNCHER_SHA,
)

maybe(
http_file,
name = "com_github_pinterest_ktlint",
Expand Down
2 changes: 0 additions & 2 deletions src/main/starlark/core/repositories/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ versions = struct(
"https://github.com/bazelbuild/stardoc/releases/download/{version}/stardoc-{version}.tar.gz",
],
),
BAZEL_JAVA_LAUNCHER_VERSION = "6.2.1",
BAZEL_JAVA_LAUNCHER_SHA = "78e29525872594ffc783c825f428b3e61d4f3e632f46eaa64f004b2814c4a612",
PINTEREST_KTLINT = version(
version = "0.49.1",
url_templates = [
Expand Down

0 comments on commit fa2ed1a

Please sign in to comment.