From 6c36d93cd156e4b42ae921ccb70e4f09356ad3ea Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Tue, 5 Dec 2023 10:30:38 +0000 Subject: [PATCH] Use launcher stub template from bazel This was added in https://github.com/bazelbuild/bazel/pull/12994 (and fixed in https://github.com/bazelbuild/bazel/pull/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. --- MODULE.bazel | 1 - kotlin/internal/jvm/jvm.bzl | 2 +- .../starlark/core/repositories/initialize.release.bzl | 9 --------- src/main/starlark/core/repositories/versions.bzl | 2 -- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 00aed8c92..10c8510d9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -18,7 +18,6 @@ use_repo( "com_github_google_ksp", "com_github_jetbrains_kotlin", "com_github_pinterest_ktlint", - "kt_java_stub_template", "rules_android", ) diff --git a/kotlin/internal/jvm/jvm.bzl b/kotlin/internal/jvm/jvm.bzl index ea2374740..f268a95c8 100644 --- a/kotlin/internal/jvm/jvm.bzl +++ b/kotlin/internal/jvm/jvm.bzl @@ -134,7 +134,7 @@ _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"), ), "_toolchain": attr.label( doc = """The Kotlin JVM Runtime. it's only purpose is to enable the Android native rules to discover the Kotlin diff --git a/src/main/starlark/core/repositories/initialize.release.bzl b/src/main/starlark/core/repositories/initialize.release.bzl index f806af702..15cb4a3f9 100644 --- a/src/main/starlark/core/repositories/initialize.release.bzl +++ b/src/main/starlark/core/repositories/initialize.release.bzl @@ -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", diff --git a/src/main/starlark/core/repositories/versions.bzl b/src/main/starlark/core/repositories/versions.bzl index 38abbe4e4..782ce4589 100644 --- a/src/main/starlark/core/repositories/versions.bzl +++ b/src/main/starlark/core/repositories/versions.bzl @@ -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 = [