diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 0000000..8482742 --- /dev/null +++ b/.bazelignore @@ -0,0 +1,2 @@ +.github +examples diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d044e22..78c5985 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,3 +16,4 @@ jobs: uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v6 with: release_files: rules_android_ndk-*.tar.gz + bazel_test_command: "cd examples/basic && bazel build java/com/app --android_platforms=//:arm64-v8a" diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh old mode 100644 new mode 100755 index 303d96b..5c47c39 --- a/.github/workflows/release_prep.sh +++ b/.github/workflows/release_prep.sh @@ -22,7 +22,7 @@ cat << EOF 2. Add to your \`MODULE.bazel\` file: \`\`\`starlark -bazel_dep(name = "com_myorg_rules_android_ndk", version = "${TAG:1}") +bazel_dep(name = "rules_android_ndk", version = "${TAG:1}") \`\`\` ## Using WORKSPACE @@ -32,12 +32,12 @@ Paste this snippet into your \`WORKSPACE.bazel\` file: \`\`\`starlark load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( - name = "com_myorg_rules_android_ndk", + name = "rules_android_ndk", sha256 = "${SHA}", strip_prefix = "${PREFIX}", - url = "https://github.com/myorg/rules_android_ndk/releases/download/${TAG}/${ARCHIVE}", + url = "https://github.com/bazelbuild/rules_android_ndk/releases/download/${TAG}/${ARCHIVE}", ) EOF -awk 'f;/--SNIP--/{f=1}' e2e/smoke/WORKSPACE.bazel +awk 'f;/--SNIP--/{f=1}' examples/basic/WORKSPACE echo "\`\`\`" diff --git a/examples/basic/WORKSPACE b/examples/basic/WORKSPACE index a749b6f..a28143f 100644 --- a/examples/basic/WORKSPACE +++ b/examples/basic/WORKSPACE @@ -1,5 +1,3 @@ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - # NDK local_repository( @@ -7,14 +5,10 @@ local_repository( path = "../..", ) -load("@rules_android_ndk//:rules.bzl", "android_ndk_repository") - -android_ndk_repository(name = "androidndk") - -register_toolchains("@androidndk//:all") - # rules_android and Android SDK +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + RULES_ANDROID_COMMIT = "dd7b90c91fdc4edeca90ba9ebffa3c469b426a35" http_archive( @@ -43,3 +37,10 @@ register_toolchains( "@rules_android//toolchains/android:android_default_toolchain", "@rules_android//toolchains/android_sdk:android_sdk_tools", ) + +# --SNIP--: Everything below this lines goes into the example WORKSPACE snippet in the release notes. +load("@rules_android_ndk//:rules.bzl", "android_ndk_repository") + +android_ndk_repository(name = "androidndk") + +register_toolchains("@androidndk//:all")