diff --git a/README.md b/README.md index 356481b7..9bd1ceeb 100644 --- a/README.md +++ b/README.md @@ -33,24 +33,24 @@ To use the Starlark Bazel Android rules, add the following to your WORKSPACE fil RULES_ANDROID_COMMIT= "0bf3093bd011acd35de3c479c8990dd630d552aa" RULES_ANDROID_SHA = "b75a673a66c157138ab53f4d8612a6e655d38b69bb14207c1a6675f0e10afa61" http_archive( - name = "build_bazel_rules_android", + name = "rules_android", url = "https://github.com/bazelbuild/rules_android/archive/%s.zip" % RULES_ANDROID_COMMIT, sha256 = RULES_ANDROID_SHA, strip_prefix = "rules_android-%s" % RULES_ANDROID_COMMIT, ) - load("@build_bazel_rules_android//:prereqs.bzl", "rules_android_prereqs") + load("@rules_android//:prereqs.bzl", "rules_android_prereqs") rules_android_prereqs() - load("@build_bazel_rules_android//:defs.bzl", "rules_android_workspace") + load("@rules_android//:defs.bzl", "rules_android_workspace") rules_android_workspace() register_toolchains( - "@build_bazel_rules_android//toolchains/android:android_default_toolchain", - "@build_bazel_rules_android//toolchains/android_sdk:android_sdk_tools", + "@rules_android//toolchains/android:android_default_toolchain", + "@rules_android//toolchains/android_sdk:android_sdk_tools", ) Then, in your BUILD files, import and use the rules: - load("@build_bazel_rules_android//rules:rules.bzl", "android_binary", "android_library") + load("@rules_android//rules:rules.bzl", "android_binary", "android_library") android_binary( ... ) diff --git a/WORKSPACE b/WORKSPACE index 7aab8a64..fd043f21 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,4 +1,4 @@ -workspace(name = "build_bazel_rules_android") +workspace(name = "rules_android") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load(":android_sdk_supplemental_repository.bzl", "android_sdk_supplemental_repository") diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod index 540b1256..ce455f6a 100644 --- a/WORKSPACE.bzlmod +++ b/WORKSPACE.bzlmod @@ -1,4 +1,4 @@ -workspace(name = "build_bazel_rules_android") +workspace(name = "rules_android") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") diff --git a/rules/flags/BUILD b/rules/flags/BUILD index d7fcb6ad..f113f078 100644 --- a/rules/flags/BUILD +++ b/rules/flags/BUILD @@ -20,7 +20,7 @@ bzl_library( string_flag( name = "runfiles_root_prefix", - build_setting_default = "build_bazel_rules_android/", + build_setting_default = "rules_android/", visibility = ["//visibility:public"], ) diff --git a/src/tools/ak/rjar/rjar_test.go b/src/tools/ak/rjar/rjar_test.go index 8c296502..7bce7b51 100644 --- a/src/tools/ak/rjar/rjar_test.go +++ b/src/tools/ak/rjar/rjar_test.go @@ -29,7 +29,7 @@ var ( const ( java = "local_jdk/bin/java" - testDataBase = "build_bazel_rules_android/src/tools/ak/rjar/testdata" + testDataBase = "rules_android/src/tools/ak/rjar/testdata" ) func TestCreateRJar(t *testing.T) { diff --git a/src/tools/javatests/com/google/devtools/build/android/sandboxedsdktoolbox/utils/TestData.java b/src/tools/javatests/com/google/devtools/build/android/sandboxedsdktoolbox/utils/TestData.java index fdf96c5f..7da5f1ab 100644 --- a/src/tools/javatests/com/google/devtools/build/android/sandboxedsdktoolbox/utils/TestData.java +++ b/src/tools/javatests/com/google/devtools/build/android/sandboxedsdktoolbox/utils/TestData.java @@ -27,7 +27,7 @@ public final class TestData { public static final Path JAVATESTS_DIR = Path.of( System.getenv("TEST_SRCDIR"), - "/build_bazel_rules_android/src/tools/javatests/"); + "/rules_android/src/tools/javatests/"); /** Reads the contents of a file, assuming its path is absolute. */ public static String readFromAbsolutePath(Path absolutePath) throws Exception { diff --git a/test/bashunit/unittest_test.py b/test/bashunit/unittest_test.py index 2ecc17f1..f5da4f77 100644 --- a/test/bashunit/unittest_test.py +++ b/test/bashunit/unittest_test.py @@ -42,7 +42,7 @@ echo "Writing XML to ${XML_OUTPUT_FILE}" -source "$(rlocation "build_bazel_rules_android/test/bashunit/unittest.bash")" \ +source "$(rlocation "rules_android/test/bashunit/unittest.bash")" \ || { echo "Could not source unittest.bash" >&2; exit 1; } """ diff --git a/test/rules/android_sdk_repository/android_helper.sh b/test/rules/android_sdk_repository/android_helper.sh index 15b49454..fedd9fc5 100644 --- a/test/rules/android_sdk_repository/android_helper.sh +++ b/test/rules/android_sdk_repository/android_helper.sh @@ -25,7 +25,7 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e # --- end runfiles.bash initialization v2 --- -source "$(rlocation build_bazel_rules_android/test/bashunit/unittest.bash)" || \ +source "$(rlocation rules_android/test/bashunit/unittest.bash)" || \ (echo >&2 "Failed to locate bashunit.sh" && exit 1) function set_up() { @@ -42,9 +42,9 @@ function set_up() { } function set_up_rules() { - local android_revision_rule="$(rlocation build_bazel_rules_android/rules/android_revision.bzl)" + local android_revision_rule="$(rlocation rules_android/rules/android_revision.bzl)" - local repo_rule="$(rlocation build_bazel_rules_android/rules/android_sdk_repository/rule.bzl)" + local repo_rule="$(rlocation rules_android/rules/android_sdk_repository/rule.bzl)" local repo_rule_dir="$(dirname "${repo_rule}")" local dest_dir="${TEST_TMPDIR}/android_sdk_repository_src" mkdir -p "${dest_dir}/rules/android_sdk_repository" diff --git a/test/rules/android_sdk_repository/android_sdk_repository_platforms_test.sh b/test/rules/android_sdk_repository/android_sdk_repository_platforms_test.sh index 20eaf84c..5040cd4d 100755 --- a/test/rules/android_sdk_repository/android_sdk_repository_platforms_test.sh +++ b/test/rules/android_sdk_repository/android_sdk_repository_platforms_test.sh @@ -25,13 +25,13 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e # --- end runfiles.bash initialization v2 --- -source "$(rlocation build_bazel_rules_android/test/bashunit/unittest.bash)" || \ +source "$(rlocation rules_android/test/bashunit/unittest.bash)" || \ (echo >&2 "Failed to locate bashunit.sh" && exit 1) ENABLE_PLATFORMS=true # Source and run the actual tests from test_lib.sh -source "$(rlocation build_bazel_rules_android/test/rules/android_sdk_repository/test_lib.sh)" || \ +source "$(rlocation rules_android/test/rules/android_sdk_repository/test_lib.sh)" || \ (echo >&2 "Failed to locate test_lib.sh" && exit 1) run_suite "Android integration tests for SDK (with platforms)" diff --git a/test/rules/android_sdk_repository/android_sdk_repository_test.sh b/test/rules/android_sdk_repository/android_sdk_repository_test.sh index 53d65739..5cfd3300 100755 --- a/test/rules/android_sdk_repository/android_sdk_repository_test.sh +++ b/test/rules/android_sdk_repository/android_sdk_repository_test.sh @@ -25,13 +25,13 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e # --- end runfiles.bash initialization v2 --- -source "$(rlocation build_bazel_rules_android/test/bashunit/unittest.bash)" || \ +source "$(rlocation rules_android/test/bashunit/unittest.bash)" || \ (echo >&2 "Failed to locate bashunit.sh" && exit 1) ENABLE_PLATFORMS=false # Source and run the actual tests from test_lib.sh -source "$(rlocation build_bazel_rules_android/test/rules/android_sdk_repository/test_lib.sh)" || \ +source "$(rlocation rules_android/test/rules/android_sdk_repository/test_lib.sh)" || \ (echo >&2 "Failed to locate test_lib.sh" && exit 1) run_suite "Android integration tests for SDK" diff --git a/test/rules/android_sdk_repository/test_lib.sh b/test/rules/android_sdk_repository/test_lib.sh index c883dbcf..17d24856 100644 --- a/test/rules/android_sdk_repository/test_lib.sh +++ b/test/rules/android_sdk_repository/test_lib.sh @@ -25,10 +25,10 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e # --- end runfiles.bash initialization v2 --- -source "$(rlocation build_bazel_rules_android/test/bashunit/unittest.bash)" || \ +source "$(rlocation rules_android/test/bashunit/unittest.bash)" || \ (echo >&2 "Failed to locate bashunit.sh" && exit 1) -source "$(rlocation build_bazel_rules_android/test/rules/android_sdk_repository/android_helper.sh)" || \ +source "$(rlocation rules_android/test/rules/android_sdk_repository/android_helper.sh)" || \ (echo >&2 "Failed to locate android_helper.sh" && exit 1) # Actual tests for Android Sdk Repository diff --git a/test/utils/integration_demo/demo_test.sh b/test/utils/integration_demo/demo_test.sh index 5e3daaf7..e47690c5 100755 --- a/test/utils/integration_demo/demo_test.sh +++ b/test/utils/integration_demo/demo_test.sh @@ -26,7 +26,7 @@ source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \ { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e # --- end runfiles.bash initialization v2 --- -source "$(rlocation build_bazel_rules_android/test/bashunit/unittest.bash)" || \ +source "$(rlocation rules_android/test/bashunit/unittest.bash)" || \ (echo >&2 "Failed to locate bashunit.sh" && exit 1) function test_bazel_exists() {