From 66bd92a1045f3f1db7f24083c11f3ea70da912fe Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Thu, 12 Oct 2023 10:34:59 -0700 Subject: [PATCH] Fix Android support when running the entire test suite --- MODULE.bazel | 4 ++++ WORKSPACE.bzlmod | 7 +++++++ WORKSPACE.dev.bazel | 8 ++++++++ WORKSPACE.release.bazel | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+) diff --git a/MODULE.bazel b/MODULE.bazel index 89ce440fa..78ad1b69b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -24,6 +24,10 @@ use_repo( 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") + # Development dependencies bazel_dep(name = "rules_jvm_external", version = "5.3") diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index e69de29bb..61cd645f8 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -0,0 +1,7 @@ +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +load("@rules_android//android:rules.bzl", "android_sdk_repository") + +maybe( + android_sdk_repository, + name = "androidsdk", +) \ No newline at end of file diff --git a/WORKSPACE.dev.bazel b/WORKSPACE.dev.bazel index 768b3e4ed..2f001f706 100644 --- a/WORKSPACE.dev.bazel +++ b/WORKSPACE.dev.bazel @@ -22,3 +22,11 @@ load("//kotlin:repositories.bzl", "kotlin_repositories") kotlin_repositories() register_toolchains("@rules_kotlin//kotlin/internal:default_toolchain") + +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +load("@rules_android//android:rules.bzl", "android_sdk_repository") + +maybe( + android_sdk_repository, + name = "androidsdk", +) diff --git a/WORKSPACE.release.bazel b/WORKSPACE.release.bazel index 09ff933e1..2f001f706 100644 --- a/WORKSPACE.release.bazel +++ b/WORKSPACE.release.bazel @@ -12,3 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. workspace(name = "rules_kotlin") + +load("//src/main/starlark/core/repositories:download.bzl", "kt_download_local_dev_dependencies") + +kt_download_local_dev_dependencies() + +load("//kotlin:repositories.bzl", "kotlin_repositories") + +kotlin_repositories() + +register_toolchains("@rules_kotlin//kotlin/internal:default_toolchain") + +load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") +load("@rules_android//android:rules.bzl", "android_sdk_repository") + +maybe( + android_sdk_repository, + name = "androidsdk", +)