Skip to content

Commit

Permalink
Switch to upstream rules_kotlin Kotlin 1.5 support in Bazel
Browse files Browse the repository at this point in the history
Previously we had this hacked together ourselves in a patch we applied.
  • Loading branch information
robinlinden committed Feb 22, 2022
1 parent 54545f6 commit cf39253
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 86 deletions.
17 changes: 8 additions & 9 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,12 @@ http_archive(
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
)

RULES_KOTLIN_TAG = "cbc4ced96a6685236c398cc2554fa4abefec1087"
RULES_KOTLIN_TAG = "v1.5.0"

http_archive(
name = "io_bazel_rules_kotlin",
patch_args = ["-p1"],
patches = ["//bazel/io_bazel_rules_kotlin:kotlin-1.5-support.patch"],
sha256 = "a8512943dc3f779ca39e887b39fbd4ad4771d7aaf446c69a9d352712b72f2c22",
strip_prefix = "rules_kotlin-%s" % RULES_KOTLIN_TAG,
url = "https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % RULES_KOTLIN_TAG,
sha256 = "12d22a3d9cbcf00f2e2d8f0683ba87d3823cb8c7f6837568dd7e48846e023307",
url = "https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % RULES_KOTLIN_TAG,
)

RULES_SCALA_TAG = "73c0dbb55d1ab2905c3d97923efc415623f67ac6"
Expand Down Expand Up @@ -256,12 +253,14 @@ load("@robolectric//bazel:robolectric.bzl", "robolectric_repositories")

robolectric_repositories()

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")

kt_register_toolchains()
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")

kotlin_repositories()

load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")

kt_register_toolchains()

load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories")
load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains")
load("@io_bazel_rules_scala//scala_proto:scala_proto.bzl", "scala_proto_repositories")
Expand Down
2 changes: 1 addition & 1 deletion atox/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")

kt_android_library(
name = "atox",
Expand Down
Empty file.
71 changes: 0 additions & 71 deletions bazel/io_bazel_rules_kotlin/kotlin-1.5-support.patch

This file was deleted.

3 changes: 2 additions & 1 deletion core/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library", "kt_jvm_test")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test")
load("@rules_android//android:rules.bzl", "android_library", "android_local_test")

android_library(
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/db/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_java//java:defs.bzl", "java_library", "java_plugin")

kt_android_library(
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/repository/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")

kt_android_library(
name = "repository",
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/vo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")

kt_android_library(
name = "vo",
Expand Down
3 changes: 2 additions & 1 deletion domain/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library", "kt_jvm_test")
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test")
load("@rules_android//android:rules.bzl", "android_library")
load("@rules_java//java:defs.bzl", "java_import")

Expand Down

0 comments on commit cf39253

Please sign in to comment.