blob: b8d14cf35f924cdccf36272115b8d1bc37e7e1d0 [file] [log] [blame]
# This package contains an external repository that the Android rules
# depend on at runtime. This is an interim solution to extract dependencies
# out from the Bazel binary to minimize its size. The final goal is to
# extract all Android rules and tools out of Bazel and into rules_android
# and tools_android.
load("@rules_pkg//:pkg.bzl", "pkg_tar")
filegroup(
name = "srcs",
srcs = [
"BUILD.android_tools",
"BUILD.bazel",
"WORKSPACE.android_tools",
"upload_android_tools.sh",
],
visibility = [
"//tools/android:__pkg__",
],
)
# :android_tools creates a tarball containing the outputs of this genrule.
genrule(
name = "strip_android_tools_suffix",
srcs = [
"BUILD.android_tools",
"WORKSPACE.android_tools",
],
outs = [
"BUILD",
"WORKSPACE",
],
cmd = """
cp $(location BUILD.android_tools) $(location BUILD) && \
cp $(location WORKSPACE.android_tools) $(location WORKSPACE)
""",
tags = [
"manual",
"no_windows",
],
)
genrule(
name = "desugar_jdk_libs",
srcs = ["@desugar_jdk_libs"],
outs = ["desugar_jdk_libs.jar"],
cmd = "cp $< $@",
)
pkg_tar(
name = "android_tools",
srcs = [
"BUILD",
"WORKSPACE",
":desugar_jdk_libs.jar",
"//src/java_tools/import_deps_checker/java/com/google/devtools/build/importdeps:ImportDepsChecker_deploy.jar",
"//src/tools/android/java/com/google/devtools/build/android:all_android_tools_deploy.jar",
],
extension = "tar.gz",
visibility = ["//src/test/shell/bazel:__subpackages__"],
)
sh_binary(
name = "upload_android_tools",
srcs = ["upload_android_tools.sh"],
data = ["android_tools.tar.gz"],
)