From cb086cdb73b53b4d13a77a56cad8e5879da0b01e Mon Sep 17 00:00:00 2001 From: Sanjay Vasandani Date: Thu, 5 Sep 2024 10:43:06 -0700 Subject: [PATCH] build!: Update rules_kotlin dep to 1.9.6. (#7) BREAKING CHANGE: Kotlin language version updated to 2.0 --- MODULE.bazel | 8 ++- MODULE.bazel.lock | 110 +++++++++--------------------------- kotlin/BUILD.bazel | 8 ++- kotlin/internal/library.bzl | 2 - 4 files changed, 38 insertions(+), 90 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index b1b8a25..b68e00e 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,9 +3,9 @@ module( repo_name = "wfa_rules_kotlin_jvm", ) -KOTLIN_RELEASE_VERSION = "1.8.22" +KOTLIN_RELEASE_VERSION = "2.0.0" # Compatible with rules_kotlin version. -KOTLINX_COROUTINES_VERSION = "1.7.3" +KOTLINX_COROUTINES_VERSION = "1.8.1" GRPC_JAVA_VERSION = "1.60.2" @@ -27,7 +27,7 @@ bazel_dep( ) bazel_dep( name = "rules_kotlin", - version = "1.9.0", + version = "1.9.6", ) bazel_dep( name = "rules_jvm_external", @@ -82,3 +82,5 @@ http_file( version = GRPC_JAVA_VERSION, ), ) + +register_toolchains("//kotlin:kotlin_toolchain") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 8fcbaae..59c6dc6 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -48,6 +48,7 @@ "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", "https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39", "https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", "https://bcr.bazel.build/modules/rules_java/7.6.5/MODULE.bazel": "481164be5e02e4cab6e77a36927683263be56b7e36fef918b458d7a8a1ebadb1", "https://bcr.bazel.build/modules/rules_java/7.9.1/MODULE.bazel": "1cc411a23b701d89a87c15219a62fa27cef122509577054f11b1d3b502fbe537", @@ -57,7 +58,8 @@ "https://bcr.bazel.build/modules/rules_jvm_external/6.0/MODULE.bazel": "37c93a5a78d32e895d52f86a8d0416176e915daabd029ccb5594db422e87c495", "https://bcr.bazel.build/modules/rules_jvm_external/6.0/source.json": "73cc8818203a182e7374adf137f428d276190b2e2bef3022c231990cf0e594aa", "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59", - "https://bcr.bazel.build/modules/rules_kotlin/1.9.0/source.json": "e4e8566acbfc02cc701c169d756ee99bca1c395a0d1dc69293a21a5ef14cac43", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", "https://bcr.bazel.build/modules/rules_license/0.0.7/source.json": "355cc5737a0f294e560d52b1b7a6492d4fff2caf0bef1a315df5a298fca2d34a", @@ -163,7 +165,7 @@ "@@rules_jvm_external~//:extensions.bzl%maven": { "general": { "bzlTransitiveDigest": "aME0tyUxYd+PGhICmzT9zEnIgZNf05hZhsfDD5v0JXM=", - "usagesDigest": "BnzWBsX1QYe7sijvj1OnuvWbE6oZUorBcsh2Cb0wm0M=", + "usagesDigest": "G7+e3zl5UOoUonlj7qb9CR70XrEseqZxTv5aT7q2ILk=", "recordedFileInputs": { "@@rules_jvm_external~//rules_jvm_external_deps_install.json": "cafb5d2d8119391eb2b322ce3840d3352ea82d496bdb8cbd4b6779ec4d044dda" }, @@ -529,54 +531,6 @@ "downloaded_file_path": "v1/io/netty/netty-transport/4.1.94.Final/netty-transport-4.1.94.Final.jar" } }, - "kotlin_rules_maven": { - "bzlFile": "@@rules_jvm_external~//:coursier.bzl", - "ruleClassName": "coursier_fetch", - "attributes": { - "user_provided_name": "kotlin_rules_maven", - "repositories": [ - "{ \"repo_url\": \"https://maven-central.storage.googleapis.com/repos/central/data/\" }", - "{ \"repo_url\": \"https://maven.google.com\" }", - "{ \"repo_url\": \"https://repo1.maven.org/maven2\" }" - ], - "artifacts": [ - "{ \"group\": \"com.google.code.findbugs\", \"artifact\": \"jsr305\", \"version\": \"3.0.2\" }", - "{ \"group\": \"junit\", \"artifact\": \"junit\", \"version\": \"4.13-beta-3\" }", - "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java\", \"version\": \"3.6.0\" }", - "{ \"group\": \"com.google.protobuf\", \"artifact\": \"protobuf-java-util\", \"version\": \"3.6.0\" }", - "{ \"group\": \"com.google.guava\", \"artifact\": \"guava\", \"version\": \"27.1-jre\" }", - "{ \"group\": \"com.google.truth\", \"artifact\": \"truth\", \"version\": \"0.45\" }", - "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service\", \"version\": \"1.0.1\" }", - "{ \"group\": \"com.google.auto.service\", \"artifact\": \"auto-service-annotations\", \"version\": \"1.0.1\" }", - "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value\", \"version\": \"1.10.1\" }", - "{ \"group\": \"com.google.auto.value\", \"artifact\": \"auto-value-annotations\", \"version\": \"1.10.1\" }", - "{ \"group\": \"com.google.dagger\", \"artifact\": \"dagger\", \"version\": \"2.43.2\" }", - "{ \"group\": \"com.google.dagger\", \"artifact\": \"dagger-compiler\", \"version\": \"2.43.2\" }", - "{ \"group\": \"com.google.dagger\", \"artifact\": \"dagger-producers\", \"version\": \"2.43.2\" }", - "{ \"group\": \"javax.annotation\", \"artifact\": \"javax.annotation-api\", \"version\": \"1.3.2\" }", - "{ \"group\": \"javax.inject\", \"artifact\": \"javax.inject\", \"version\": \"1\" }", - "{ \"group\": \"org.pantsbuild\", \"artifact\": \"jarjar\", \"version\": \"1.7.2\" }", - "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"atomicfu-js\", \"version\": \"0.15.2\" }", - "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"kotlinx-serialization-runtime\", \"version\": \"1.0-M1-1.4.0-rc\" }" - ], - "fail_on_missing_checksum": true, - "fetch_sources": true, - "fetch_javadoc": false, - "excluded_artifacts": [], - "generate_compat_repositories": false, - "version_conflict_policy": "default", - "override_targets": {}, - "strict_visibility": false, - "strict_visibility_value": [ - "@@//visibility:private" - ], - "resolve_timeout": 600, - "use_starlark_android_rules": false, - "aar_import_bzl_label": "@build_bazel_rules_android//android:rules.bzl", - "duplicate_version_warning": "warn", - "ignore_empty_files": false - } - }, "io_netty_netty_common_4_1_94_Final": { "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_file", @@ -1119,12 +1073,12 @@ ], "artifacts": [ "{ \"group\": \"io.grpc\", \"artifact\": \"protoc-gen-grpc-kotlin\", \"version\": \"1.4.1\", \"classifier\": \"jdk8\" }", - "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-test\", \"version\": \"1.8.22\", \"testonly\": true }", - "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-stdlib\", \"version\": \"1.8.22\" }", - "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-stdlib-common\", \"version\": \"1.8.22\" }", - "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-reflect\", \"version\": \"1.8.22\" }", - "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"kotlinx-coroutines-core\", \"version\": \"1.7.3\" }", - "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"kotlinx-coroutines-core-jvm\", \"version\": \"1.7.3\" }", + "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-test\", \"version\": \"2.0.0\", \"testonly\": true }", + "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-stdlib\", \"version\": \"2.0.0\" }", + "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-stdlib-common\", \"version\": \"2.0.0\" }", + "{ \"group\": \"org.jetbrains.kotlin\", \"artifact\": \"kotlin-reflect\", \"version\": \"2.0.0\" }", + "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"kotlinx-coroutines-core\", \"version\": \"1.8.1\" }", + "{ \"group\": \"org.jetbrains.kotlinx\", \"artifact\": \"kotlinx-coroutines-core-jvm\", \"version\": \"1.8.1\" }", "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-api\", \"version\": \"1.60.2\" }", "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-protobuf\", \"version\": \"1.60.2\" }", "{ \"group\": \"io.grpc\", \"artifact\": \"grpc-stub\", \"version\": \"1.60.2\" }", @@ -1485,8 +1439,8 @@ }, "@@rules_kotlin~//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "HEEa2807W1hMMbUfqsZEgS3IyuR2PxPE8mEPkwu03Bs=", - "usagesDigest": "NVenRWDvHRhBixN7Qd3DonxYCvo8Bzu7GU5tHat0wps=", + "bzlTransitiveDigest": "l//eFZVgEUHSUfuQ1zQw9uxmcJku8ikraA2fv/2Pyh0=", + "usagesDigest": "NXmdQOmIAdsAdtLv3dhkX8UQ+0st9iQ0EkR28lUNdHc=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, "envVariables": {}, @@ -1506,31 +1460,29 @@ "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", "ruleClassName": "http_file", "attributes": { - "sha256": "2b3f6f674a944d25bb8d283c3539947bbe86074793012909a55de4b771f74bcc", + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", "urls": [ - "https://github.com/pinterest/ktlint/releases/download/0.49.1/ktlint" + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" ], "executable": true } }, - "buildkite_config": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", + "com_github_jetbrains_kotlin": { + "bzlFile": "@@rules_kotlin~//src/main/starlark/core/repositories:compiler.bzl", + "ruleClassName": "kotlin_capabilities_repository", "attributes": { - "urls": [ - "https://storage.googleapis.com/rbe-toolchain/bazel-configs/rbe-ubuntu1604/latest/rbe_default.tar" - ] + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" } }, - "com_github_jetbrains_kotlin": { + "com_github_jetbrains_kotlin_git": { "bzlFile": "@@rules_kotlin~//src/main/starlark/core/repositories:compiler.bzl", - "ruleClassName": "kotlin_compiler_repository", + "ruleClassName": "kotlin_compiler_git_repository", "attributes": { "urls": [ - "https://github.com/JetBrains/kotlin/releases/download/v1.9.10/kotlin-compiler-1.9.10.zip" + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" ], - "sha256": "7d74863deecf8e0f28ea54c3735feab003d0eac67e8d3a791254b16889c20342", - "compiler_version": "1.9.10" + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" } }, "com_github_google_ksp": { @@ -1538,20 +1490,10 @@ "ruleClassName": "ksp_compiler_plugin_repository", "attributes": { "urls": [ - "https://github.com/google/ksp/releases/download/1.9.10-1.0.13/artifacts.zip" - ], - "sha256": "5b0b1179e8af40877d9d5929ec0260afb104956eabf2f23bb5568cfd6c20b37b", - "strip_version": "1.9.10-1.0.13" - } - }, - "kt_java_stub_template": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_file", - "attributes": { - "urls": [ - "https://raw.githubusercontent.com/bazelbuild/bazel/6.2.1/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt" + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" ], - "sha256": "78e29525872594ffc783c825f428b3e61d4f3e632f46eaa64f004b2814c4a612" + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" } } }, diff --git a/kotlin/BUILD.bazel b/kotlin/BUILD.bazel index 69e6969..8b48f42 100644 --- a/kotlin/BUILD.bazel +++ b/kotlin/BUILD.bazel @@ -1,4 +1,4 @@ -load("@rules_kotlin//kotlin:core.bzl", "kt_kotlinc_options") +load("@rules_kotlin//kotlin:core.bzl", "define_kt_toolchain", "kt_kotlinc_options") package(default_visibility = ["//visibility:public"]) @@ -7,3 +7,9 @@ kt_kotlinc_options( include_stdlibs = "none", x_optin = ["kotlin.RequiresOptIn"], ) + +define_kt_toolchain( + name = "kotlin_toolchain", + jvm_target = "11", + kotlinc_options = ":default_opts", +) diff --git a/kotlin/internal/library.bzl b/kotlin/internal/library.bzl index 7b5d7c8..07104ce 100644 --- a/kotlin/internal/library.bzl +++ b/kotlin/internal/library.bzl @@ -28,7 +28,6 @@ def kt_jvm_library( name, deps = None, exports = None, - kotlinc_opts = Label("//kotlin:default_opts"), **kwargs): deps = deps or [] exports = exports or [] @@ -37,6 +36,5 @@ def kt_jvm_library( name = name, deps = deps + _STDLIBS, exports = exports + _STDLIBS, - kotlinc_opts = kotlinc_opts, **kwargs )