-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure everything into the bazel-contrib/template structure
- Loading branch information
Showing
120 changed files
with
5,569 additions
and
1,008 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
lint-tests/ | ||
lint-examples/ | ||
e2e/ | ||
examples/ |
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 |
---|---|---|
@@ -1 +1,4 @@ | ||
common --experimental_google_legacy_api | ||
# Required until this is the default; expected in Bazel 7 | ||
common --enable_bzlmod | ||
|
||
try-import %workspace%/.bazelrc.user |
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 |
---|---|---|
@@ -1 +1 @@ | ||
6.0.0 | ||
6.4.0 |
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,9 @@ | ||
# Bazel Central Registry | ||
|
||
When the ruleset is released, we want it to be published to the | ||
Bazel Central Registry automatically: | ||
<https://registry.bazel.build> | ||
|
||
This folder contains configuration files to automate the publish step. | ||
See <https://github.com/bazel-contrib/publish-to-bcr/blob/main/templates/README.md> | ||
for authoritative documentation about these files. |
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,6 @@ | ||
# See https://github.com/bazel-contrib/publish-to-bcr#a-note-on-release-automation | ||
# for guidance about whether to uncomment this section: | ||
# | ||
# fixedReleaser: | ||
# login: my_github_handle | ||
# 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,7 @@ | ||
{ | ||
"homepage": "https://github.com/bencodes/rules_android_lint", | ||
"maintainers": [], | ||
"repository": ["github:bencodes/rules_android_lint"], | ||
"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,10 @@ | ||
bcr_test_module: | ||
module_path: "e2e/smoke" | ||
matrix: | ||
platform: ["debian10", "macos", "ubuntu2004", "windows"] | ||
tasks: | ||
run_tests: | ||
name: "Run test module" | ||
platform: ${{ platform }} | ||
test_targets: | ||
- "//..." |
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": "**leave this alone**", | ||
"strip_prefix": "{REPO}-{VERSION}", | ||
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_android_lint-{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 @@ | ||
docs/*.md linguist-generated=true |
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
load("@buildifier_prebuilt//:rules.bzl", "buildifier") | ||
|
||
buildifier( | ||
name = "buildifier.check", | ||
exclude_patterns = ["./.git/*"], | ||
lint_mode = "warn", | ||
mode = "diff", | ||
) | ||
|
||
buildifier( | ||
name = "buildifier.fix", | ||
disabled_rewrites = [ | ||
"label", | ||
], | ||
exclude_patterns = ["./.git/*"], | ||
lint_mode = "fix", | ||
) |
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 @@ | ||
name: Buildifier | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: buildifier | ||
run: bazel run --enable_bzlmod //.github/workflows:buildifier.check |
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,61 @@ | ||
name: CI | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109 | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout the sources" | ||
uses: actions/checkout@v4 | ||
- name: "Install JDK 11" | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
- name: Mount bazel caches | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/bazel | ||
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }} | ||
restore-keys: bazel-cache- | ||
- name: "Setup Bazelisk" | ||
uses: bazelbuild/setup-bazelisk@v2 | ||
- name: "Running tests //..." | ||
run: bazel test //... --enable_bzlmod=true | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Checkout the sources" | ||
uses: actions/checkout@v4 | ||
- name: "Install JDK 11" | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: "zulu" | ||
java-version: "11" | ||
- name: Mount bazel caches | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/bazel | ||
key: bazel-cache-${{ hashFiles('**/BUILD.bazel', '**/*.bzl', 'WORKSPACE') }} | ||
restore-keys: bazel-cache- | ||
- name: "Setup Bazelisk" | ||
uses: bazelbuild/setup-bazelisk@v2 | ||
- name: "Running integration tests examples/simple-android" | ||
working-directory: examples/simple-android | ||
run: bazel test //... --enable_bzlmod=true |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
# 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*.*.*" | ||
|
||
jobs: | ||
release: | ||
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v4 | ||
with: | ||
release_files: rules_android_lint-*.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,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o nounset -o pipefail | ||
|
||
# Don't include examples in the distribution artifact, to reduce size. | ||
# You may want to add additional exclusions for folders or files that users don't need. | ||
# NB: this mechanism relies on a `git archive` feature, which is much simpler and less | ||
# error-prone than using Bazel to build a release artifact from sources in the repository. | ||
# See https://git-scm.com/docs/git-archive#ATTRIBUTES | ||
echo >>.git/info/attributes "examples export-ignore" | ||
|
||
# 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 | ||
PREFIX="rules_android_lint-${TAG:1}" | ||
ARCHIVE="rules_android_lint-$TAG.tar.gz" | ||
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE | ||
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}') | ||
|
||
cat << EOF | ||
## Using Bzlmod with Bazel 6 | ||
1. Enable with \`common --enable_bzlmod\` in \`.bazelrc\`. | ||
2. Add to your \`MODULE.bazel\` file: | ||
\`\`\`starlark | ||
bazel_dep(name = "rules_android_lint", 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_lint", | ||
sha256 = "${SHA}", | ||
strip_prefix = "${PREFIX}", | ||
url = "https://github.com/bencodes/rules_android_lint/releases/download/${TAG}/${ARCHIVE}", | ||
) | ||
EOF | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,4 @@ | ||
|
||
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,bazel | ||
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,bazel | ||
|
||
### Bazel ### | ||
# gitignore template for Bazel build system | ||
# website: https://bazel.build/ | ||
|
||
# Ignore all bazel-* symlinks. There is no full list since this can change | ||
# based on the name of the directory bazel is cloned into. | ||
/bazel-* | ||
|
||
# Bazel Intellij | ||
/.ijwb/ | ||
# Bazel Android Studio | ||
/.aswb/ | ||
|
||
### VisualStudioCode ### | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
*.code-workspace | ||
|
||
### VisualStudioCode Patch ### | ||
# Ignore all local history of files | ||
.history | ||
|
||
trace.profile.gz | ||
bazel-* | ||
.bazelrc.user | ||
.idea/ | ||
.ijwb/ |
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,35 @@ | ||
# See CONTRIBUTING.md for instructions. | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
# Commitizen runs in commit-msg stage | ||
# but we don't want to run the other hooks on commit messages | ||
default_stages: [commit] | ||
|
||
# Use a slightly older version of node by default | ||
# as the default uses a very new version of GLIBC | ||
default_language_version: | ||
node: 16.18.0 | ||
|
||
repos: | ||
# Check formatting and lint for starlark code | ||
- repo: https://github.com/keith/pre-commit-buildifier | ||
rev: 6.1.0.1 | ||
hooks: | ||
- id: buildifier | ||
- id: buildifier-lint | ||
# Enforce that commit messages allow for later changelog generation | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v2.18.0 | ||
hooks: | ||
# Requires that commitizen is already installed | ||
- id: commitizen | ||
stages: [commit-msg] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v2.4.0" | ||
hooks: | ||
- id: prettier | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: end-of-file-fixer |
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 @@ | ||
docs/*.md |
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,11 @@ | ||
load("@rules_kotlin//kotlin:lint.bzl", "ktlint_config") | ||
|
||
exports_files(["maven_install.json"]) | ||
|
||
ktlint_config( | ||
name = "editorconfig", | ||
android_rules_enabled = False, | ||
editorconfig = "//:.editorconfig", | ||
experimental_rules_enabled = False, | ||
visibility = ["//visibility:public"], | ||
) |
Oops, something went wrong.