Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rules_android to 0.5.1 #1205

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
common --enable_bzlmod=true
common --experimental_google_legacy_api

common:rbe --java_runtime_version=11
common:rbe --tool_java_runtime_version=11
Expand Down
5 changes: 2 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "7.2.0")
bazel_dep(name = "rules_python", version = "0.23.1")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_android", version = "0.1.1")
bazel_dep(name = "rules_android", version = "0.5.1")

rules_kotlin_extensions = use_extension("//src/main/starlark/core/repositories:bzlmod_setup.bzl", "rules_kotlin_extensions")
use_repo(
Expand Down Expand Up @@ -48,7 +47,7 @@ use_repo(remote_android_extensions, "android_gmaven_r8", "android_tools")
# TODO(bencodes) A bunch of these dependencies need to be marked as dev_dependencies but before we can do that
# we need to sort out a few cases around how these rules are consumed in various ways.

bazel_dep(name = "rules_jvm_external", version = "5.3")
bazel_dep(name = "rules_jvm_external", version = "6.2")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
Expand Down
3 changes: 1 addition & 2 deletions MODULE.release.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "7.2.0")
bazel_dep(name = "rules_python", version = "0.23.1")
bazel_dep(name = "rules_cc", version = "0.0.8")
bazel_dep(name = "rules_android", version = "0.1.1")
bazel_dep(name = "rules_android", version = "0.5.1")

rules_kotlin_extensions = use_extension(
"//src/main/starlark/core/repositories:bzlmod_setup.bzl",
Expand Down
3 changes: 2 additions & 1 deletion examples/android/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
common --lockfile_mode=off
test --test_output=all
common --experimental_google_legacy_api
test --test_output=all
4 changes: 2 additions & 2 deletions examples/android/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module(name = "android-example")
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")

bazel_dep(name = "rules_android", version = "0.1.1")
bazel_dep(name = "rules_android", version = "0.5.1")
bazel_dep(name = "bazel_skylib", version = "1.2.1")
bazel_dep(name = "rules_robolectric", version = "4.10.3", repo_name = "robolectric")
bazel_dep(name = "rules_java", version = "6.4.0")
bazel_dep(name = "platforms", version = "0.0.7")
bazel_dep(name = "rules_kotlin", version = "1.9.5")
bazel_dep(name = "rules_jvm_external", version = "5.3")
bazel_dep(name = "rules_jvm_external", version = "6.2")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
Expand Down
6 changes: 3 additions & 3 deletions examples/android/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ maven_install(

http_archive(
name = "rules_android",
sha256 = versions.ANDROID.SHA,
strip_prefix = "rules_android-%s" % versions.ANDROID.VERSION,
urls = ["https://github.com/bazelbuild/rules_android/archive/v%s.zip" % versions.ANDROID.VERSION],
sha256 = versions.ANDROID.sha256,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use `versions.use_repository(name = "rules_android", rule=http_archive, version =version.ANDROID)

strip_prefix = "rules_android-%s" % versions.ANDROID.version,
urls = [url.format(version = versions.ANDROID.version) for url in versions.ANDROID.url_templates],
)

load(
Expand Down
6 changes: 3 additions & 3 deletions examples/anvil/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ kt_register_toolchains()

http_archive(
name = "rules_android",
sha256 = versions.ANDROID.SHA,
strip_prefix = "rules_android-%s" % versions.ANDROID.VERSION,
urls = ["https://github.com/bazelbuild/rules_android/archive/v%s.zip" % versions.ANDROID.VERSION],
sha256 = versions.ANDROID.sha256,
strip_prefix = "rules_android-%s" % versions.ANDROID.version,
urls = [url.format(version = versions.ANDROID.version) for url in versions.ANDROID.url_templates],
)

load("@rules_android//android:rules.bzl", "android_sdk_repository")
Expand Down
6 changes: 3 additions & 3 deletions examples/associates/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ load("@rules_kotlin//src/main/starlark/core/repositories:versions.bzl", "version

http_archive(
name = "rules_android",
sha256 = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
strip_prefix = "rules_android-0.1.1",
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
sha256 = versions.ANDROID.sha256,
strip_prefix = "rules_android-%s" % versions.version.version,
urls = [url.format(version = versions.ANDROID.version) for url in versions.ANDROID.url_templates],
)

http_archive(
Expand Down
6 changes: 3 additions & 3 deletions examples/deps/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ maven_install(

http_archive(
name = "rules_android",
sha256 = versions.ANDROID.SHA,
strip_prefix = "rules_android-%s" % versions.ANDROID.VERSION,
urls = ["https://github.com/bazelbuild/rules_android/archive/v%s.zip" % versions.ANDROID.VERSION],
sha256 = versions.ANDROID.sha256,
strip_prefix = "rules_android-%s" % versions.ANDROID.version,
urls = [url.format(version = versions.ANDROID.version) for url in versions.ANDROID.url_templates],
)

load(
Expand Down
6 changes: 3 additions & 3 deletions examples/jetpack_compose/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ http_archive(

http_archive(
name = "rules_android",
sha256 = versions.ANDROID.SHA,
strip_prefix = "rules_android-%s" % versions.ANDROID.VERSION,
urls = ["https://github.com/bazelbuild/rules_android/archive/v%s.zip" % versions.ANDROID.VERSION],
sha256 = versions.ANDROID.sha256,
strip_prefix = "rules_android-%s" % versions.ANDROID.version,
urls = [url.format(version = versions.ANDROID.version) for url in versions.ANDROID.url_templates],
)

load("@rules_android//android:rules.bzl", "android_sdk_repository")
Expand Down
2 changes: 1 addition & 1 deletion examples/multiplex/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use_repo(remote_android_extensions, "android_gmaven_r8", "android_tools")

bazel_dep(name = "rules_java", version = "6.4.0")
bazel_dep(name = "rules_kotlin", version = "1.9.5")
bazel_dep(name = "rules_jvm_external", version = "5.3")
bazel_dep(name = "rules_jvm_external", version = "6.2")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
Expand Down
1 change: 1 addition & 0 deletions examples/plugin/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --experimental_google_legacy_api
1 change: 1 addition & 0 deletions examples/trivial/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --experimental_google_legacy_api
15 changes: 3 additions & 12 deletions examples/trivial/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
module(name = "trival-example")

bazel_dep(
name = "rules_java",
version = "6.4.0",
)
bazel_dep(
name = "rules_kotlin",
version = "1.9.5",
)
bazel_dep(
name = "rules_jvm_external",
version = "5.3",
)
bazel_dep(name = "rules_java", version = "6.4.0")
bazel_dep(name = "rules_kotlin", version = "1.9.5")
bazel_dep(name = "rules_jvm_external", version = "6.2")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
Expand Down
6 changes: 3 additions & 3 deletions src/main/starlark/core/repositories/download.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def kt_download_local_dev_dependencies():

rules_stardoc_repository(
name = "rules_android",
sha256 = versions.ANDROID.SHA,
strip_prefix = "rules_android-%s" % versions.ANDROID.VERSION,
urls = versions.ANDROID.URLS,
sha256 = versions.ANDROID.sha256,
strip_prefix = "rules_android-%s" % versions.ANDROID.version,
urls = [url.format(version = versions.ANDROID.version) for url in versions.ANDROID.url_templates],
starlark_packages = [
"android",
],
Expand Down
8 changes: 4 additions & 4 deletions src/main/starlark/core/repositories/initialize.release.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def kotlin_repositories(
return

maybe(
http_archive,
http_file,
name = "rules_android",
sha256 = versions.ANDROID.SHA,
strip_prefix = "rules_android-%s" % versions.ANDROID.VERSION,
urls = versions.ANDROID.URLS,
sha256 = versions.ANDROID.sha256,
strip_prefix = "rules_android-%s" % versions.ANDROID.version,
urls = [url.format(version = versions.ANDROID.version) for url in versions.ANDROID.url_templates],
)

versions.use_repository(
Expand Down
14 changes: 8 additions & 6 deletions src/main/starlark/core/repositories/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ versions = struct(
SKYLIB_SHA = "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
PROTOBUF_VERSION = "3.11.3",
PROTOBUF_SHA = "cf754718b0aa945b00550ed7962ddc167167bd922b842199eeb6505e6f344852",
RULES_JVM_EXTERNAL_TAG = "5.3",
RULES_JVM_EXTERNAL_SHA = "d31e369b854322ca5098ea12c69d7175ded971435e55c18dd9dd5f29cc5249ac",
RULES_JVM_EXTERNAL_TAG = "6.2",
RULES_JVM_EXTERNAL_SHA = "808cb5c30b5f70d12a2a745a29edc46728fd35fa195c1762a596b63ae9cebe05",
RULES_PROTO = version(
version = "5.3.0-21.7",
sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
Expand Down Expand Up @@ -74,10 +74,12 @@ versions = struct(
],
sha256 = "84100aed5b63effa992ce6574b3ba47d2dbb78529752daa4c181e203117ba7de",
),
ANDROID = struct(
VERSION = "0.1.1",
SHA = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
URLS = ["https://github.com/bazelbuild/rules_android/archive/v%s.zip" % "0.1.1"],
ANDROID = version(
version = "0.5.1",
url_templates = [
"https://github.com/bazelbuild/rules_android/releases/download/v{version}/rules_android-v{version}.tar.gz",
],
sha256 = "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d",
),
# To update: https://github.com/bazelbuild/bazel-toolchains#latest-bazel-and-latest-ubuntu-1604-container
RBE = struct(
Expand Down