-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up boilerplate for rules_android BCR
These files were largely copied from [email protected]. PiperOrigin-RevId: 655607429 Change-Id: I3551c06dff48fb6f3251bb9c59932ba38b59cec4
- Loading branch information
1 parent
f270005
commit 62d1a4f
Showing
8 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fixedReleaser: | ||
login: ahumesky | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"homepage": "https://github.com/bazelbuild/rules_android", | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"github": "ahumesky", | ||
"name": "ahumesky" | ||
}, | ||
{ | ||
"email": "[email protected]", | ||
"github": "ted-xie", | ||
"name": "tedx" | ||
} | ||
], | ||
"repository": [ | ||
"github:bazelbuild/rules_android" | ||
], | ||
"versions": [], | ||
"yanked_versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
bcr_test_module: | ||
module_path: examples/basicapp | ||
matrix: | ||
platform: ["ubuntu2004", "macos", "windows"] | ||
bazel: ["7.2.1", "rolling"] | ||
tasks: | ||
run_test_module: | ||
name: "Verify build targets with bzlmod" | ||
platform: ${{ platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- "//java/com/basicapp:basic_app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"integrity": "", | ||
"strip_prefix": "rules_android-{TAG}", | ||
"url": "https://github.com/bazelbuild/rules_android/archive/refs/tags/{TAG}.tar.gz" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file contains Bazel settings to apply on CI only. | ||
# It is referenced with a --bazelrc option in the call to bazel in ci.yaml | ||
|
||
# Debug where options came from | ||
build --announce_rc | ||
# This directory is configured in GitHub actions to be persisted between runs. | ||
# We do not enable the repository cache to cache downloaded external artifacts | ||
# as these are generally faster to download again than to fetch them from the | ||
# GitHub actions cache. | ||
build --disk_cache=~/.cache/bazel | ||
# Don't rely on test logs being easily accessible from the test runner, | ||
# though it makes the log noisier. | ||
test --test_output=errors | ||
# Allows tests to run bazelisk-in-bazel, since this is the cache folder used | ||
test --test_env=XDG_CACHE_HOME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Cut a release whenever a new tag is pushed to the repo. | ||
# You should use an annotated tag, like `git tag -a v1.2.3` | ||
# and put the release notes into the commit message for the tag. | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v6 | ||
with: | ||
release_files: rules_android-*.tar.gz | ||
bazel_test_command: "cd examples/basicapp && bazel build java/com/basicapp:basic_app" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env bash | ||
# Copyright 2024 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -o errexit -o nounset -o pipefail | ||
|
||
# Set by GH actions, see | ||
# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables | ||
TAG=${GITHUB_REF_NAME} | ||
# The prefix is chosen to match what GitHub generates for source archives | ||
# This guarantees that users can easily switch from a released artifact to a source archive | ||
# with minimal differences in their code (e.g. strip_prefix remains the same) | ||
PREFIX="rules_android-${TAG:1}" | ||
ARCHIVE="rules_android-$TAG.tar.gz" | ||
|
||
# NB: configuration for 'git archive' is in /.gitattributes | ||
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE | ||
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}') | ||
|
||
cat << EOF | ||
## Using Bzlmod with Bazel 6 or greater | ||
1. (Bazel 6 only) Enable with \`common --enable_bzlmod\` in \`.bazelrc\`. | ||
2. Add to your \`MODULE.bazel\` file: | ||
\`\`\`starlark | ||
bazel_dep(name = "rules_android", version = "${TAG:1}") | ||
\`\`\` | ||
## Using WORKSPACE | ||
Paste this snippet into your \`WORKSPACE.bazel\` file: | ||
\`\`\`starlark | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
http_archive( | ||
name = "rules_android", | ||
sha256 = "${SHA}", | ||
strip_prefix = "${PREFIX}", | ||
url = "https://github.com/bazelbuild/rules_android/releases/download/${TAG}/${ARCHIVE}", | ||
) | ||
EOF | ||
|
||
awk 'f;/--SNIP--/{f=1}' examples/basicapp/WORKSPACE | ||
echo "\`\`\`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters