Skip to content

Commit

Permalink
Remove Android tools from @bazel_tools and various Android dependen…
Browse files Browse the repository at this point in the history
…cies.

RELNOTES: `@bazel_tools//tools/android` no longer exists. Use https://github.com/bazelbuild/rules_android instead.
PiperOrigin-RevId: 682346563
Change-Id: I016dd7d10ce4dbde363f498eb2b4498769c7e1ad
  • Loading branch information
ahumesky authored and copybara-github committed Oct 4, 2024
1 parent 1023f4f commit ef1a21f
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 1,443 deletions.
36 changes: 0 additions & 36 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -389,39 +389,3 @@ register_toolchains("@local_config_winsdk//:all")
register_toolchains("//src/main/res:empty_rc_toolchain")

register_toolchains("@graalvm_toolchains//:gvm")

# =========================================
# Android tools dependencies
# =========================================

maven_android = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven_android.install(
name = "maven_android",
artifacts = [
"androidx.databinding:databinding-compiler:3.4.0-alpha10",
"com.android.tools.build:builder:7.1.3",
"com.android.tools.build:manifest-merger:30.1.3",
"com.android.tools:sdk-common:30.1.3",
"com.android.tools:annotations:30.1.3",
"com.android.tools.layoutlib:layoutlib-api:30.1.3",
"com.android.tools:common:30.1.3",
"com.android.tools:repository:30.1.3",
],
# Don't forget to change this to back to True before submitting your change.
fail_if_repin_required = True,
lock_file = "//src/tools/android:maven_android_install.json",
repositories = [
"https://dl.google.com/android/maven2",
"https://repo1.maven.org/maven2",
],
)
use_repo(maven_android, "maven_android", "unpinned_maven_android")

bazel_android_deps = use_extension("//:extensions.bzl", "bazel_android_deps")
use_repo(bazel_android_deps, "desugar_jdk_libs")

remote_android_extensions = use_extension("//tools/android:android_extensions.bzl", "remote_android_tools_extensions")
use_repo(remote_android_extensions, "android_gmaven_r8", "android_tools")

android_sdk_proxy_extensions = use_extension("//tools/android:android_extensions.bzl", "android_sdk_proxy_extensions")
use_repo(android_sdk_proxy_extensions, "android_external")
976 changes: 4 additions & 972 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions scripts/bootstrap/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,6 @@ EOF
mkdir -p ${BAZEL_TOOLS_REPO}/tools/python
link_file "${PWD}/tools/python/BUILD.tools" "${BAZEL_TOOLS_REPO}/tools/python/BUILD"

# Create @bazel_tools/tools/android/BUILD
mkdir -p ${BAZEL_TOOLS_REPO}/tools/android
link_file "${PWD}/tools/android/BUILD.tools" "${BAZEL_TOOLS_REPO}/tools/android/BUILD"
link_children "${PWD}" tools/android "${BAZEL_TOOLS_REPO}"

# Create the rest of @bazel_tools//tools/...
link_children "${PWD}" tools/cpp "${BAZEL_TOOLS_REPO}"
mv -f ${BAZEL_TOOLS_REPO}/tools/cpp/BUILD.tools ${BAZEL_TOOLS_REPO}/tools/cpp/BUILD
Expand Down
5 changes: 1 addition & 4 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ rule_size_test(
# WARNING: Only adjust the number in `expect` if you are intentionally
# adding or removing embedded tools. Know that the more embedded tools there
# are in Bazel, the bigger the binary becomes and the slower Bazel starts.
expect = 431,
expect = 416,
margin = 5, # percentage
)

Expand Down Expand Up @@ -374,7 +374,6 @@ filegroup(
"//src/test/testdata/test_tls_certificate",
"//src/test/tools:srcs",
"//src/test/tools/bzlmod:srcs",
"//src/tools/android:srcs",
"//src/tools/bzlmod:srcs",
"//src/tools/diskcache:srcs",
"//src/tools/execlog:srcs",
Expand Down Expand Up @@ -591,8 +590,6 @@ filegroup(
name = "test_repos",
srcs = [
requirement("bazel-runfiles"), # Fetching the hermetic Python toolchain.
"@android_gmaven_r8//jar:file",
"@android_tools//:all_android_tools_deploy.jar",
"@bazel_skylib//:WORKSPACE",
"@protobuf//:LICENSE",
"@remote_coverage_tools//:all_lcov_merger_lib",
Expand Down
6 changes: 0 additions & 6 deletions src/MODULE.tools
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ register_toolchains("@local_config_sh//:local_sh_toolchain")
remote_coverage_tools_extension = use_extension("//tools/test:extensions.bzl", "remote_coverage_tools_extension")
use_repo(remote_coverage_tools_extension, "remote_coverage_tools")

remote_android_extensions = use_extension("//tools/android:android_extensions.bzl", "remote_android_tools_extensions")
use_repo(remote_android_extensions, "android_gmaven_r8", "android_tools")

android_sdk_proxy_extensions = use_extension("//tools/android:android_extensions.bzl", "android_sdk_proxy_extensions")
use_repo(android_sdk_proxy_extensions, "android_external")

# Used by bazel mod tidy (see BazelModTidyFunction).
buildozer_binary = use_extension("@buildozer//:buildozer_binary.bzl", "buildozer_binary")
use_repo(buildozer_binary, "buildozer_binary")
Expand Down
5 changes: 0 additions & 5 deletions third_party/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ filegroup(
srcs = [],
)

alias(
name = "android-annotations",
actual = "@maven_android//:com_android_tools_annotations",
)

alias(
name = "apache_commons_collections",
actual = "@maven//:commons_collections_commons_collections",
Expand Down
2 changes: 0 additions & 2 deletions tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ filegroup(
exclude = ["fastutil.proguard"],
) + [
"//tools/allowlists:srcs",
"//tools/android:embedded_tools",
"//tools/bash:embedded_tools",
"//tools/build_defs:embedded_tools",
"//tools/build_rules:embedded_tools_srcs",
Expand Down Expand Up @@ -79,7 +78,6 @@ filegroup(
name = "bzl_srcs",
srcs = [
"//tools:build_defs.bzl",
"//tools/android:bzl_srcs",
"//tools/build_defs:bzl_srcs",
"//tools/build_rules:bzl_srcs",
"//tools/cpp:bzl_srcs",
Expand Down
15 changes: 0 additions & 15 deletions tools/android/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,6 @@ filegroup(
],
)

filegroup(
name = "embedded_tools",
srcs = glob(
["*"],
exclude = [
"*_test.py",
"*_test.sh",
"*~",
".*",
],
) + [
"//tools/android/emulator:embedded_tools",
],
)

platform(
name = "arm64-v8a",
constraint_values = [
Expand Down
Loading

0 comments on commit ef1a21f

Please sign in to comment.