Skip to content

Commit

Permalink
Merge branch 'bazel-contrib:main' into abalik-escape-illegal-chars
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-abalik authored Jul 24, 2024
2 parents cfb8828 + 2393517 commit 21b018b
Show file tree
Hide file tree
Showing 25 changed files with 354 additions and 3,085 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.2.1
22 changes: 7 additions & 15 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: bazelbuild/setup-bazelisk@v2

- name: Mount bazel action cache
uses: actions/cache@v2
with:
path: "~/.cache/bazel"
key: bazel

- name: Mount bazel repo cache
uses: actions/cache@v2
- uses: bazel-contrib/[email protected]
with:
path: "~/.cache/bazel-repo"
key: bazel-repo
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: true
# Share repository cache between workflows.
repository-cache: true

- name: bzlmod tests and lints
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: (cd examples/tests_and_lints && bazel --bazelrc=../../.github/workflows/ci.bazelrc test --enable_bzlmod //...)
24 changes: 8 additions & 16 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,16 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: bazelbuild/setup-bazelisk@v2

- name: Mount bazel action cache
uses: actions/cache@v2
with:
path: "~/.cache/bazel"
key: bazel

- name: Mount bazel repo cache
uses: actions/cache@v2
- uses: bazel-contrib/[email protected]
with:
path: "~/.cache/bazel-repo"
key: bazel-repo

# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: true
# Share repository cache between workflows.
repository-cache: true

- name: Run format
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: ./tools/format.sh

- name: Check no changes
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/gazelle_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,14 @@ jobs:
distribution: "zulu"
java-version: "21"

- uses: bazelbuild/setup-bazelisk@v2

- name: Mount bazel action cache
uses: actions/cache@v2
with:
path: "~/.cache/bazel"
key: bazel

- name: Mount bazel repo cache
uses: actions/cache@v2
- uses: bazel-contrib/[email protected]
with:
path: "~/.cache/bazel-repo"
key: bazel-repo
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: true
# Share repository cache between workflows.
repository-cache: true

- name: bzlmod gazelle
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: (cd examples/gazelle && bazelisk --bazelrc=../../.github/workflows/ci.bazelrc run --enable_bzlmod //:gazelle && bazelisk --bazelrc=../../.github/workflows/ci.bazelrc test --enable_bzlmod //...)
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: bazel test //...
env:
# Bazelisk will download bazel to here
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: bazel --bazelrc=.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
- name: Prepare release
run: .github/workflows/release_prep.sh ${{ env.GITHUB_REF_NAME }} > release_notes.txt
Expand Down
24 changes: 8 additions & 16 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,14 @@ jobs:
distribution: "zulu"
java-version: "21"

- uses: bazelbuild/setup-bazelisk@v2

- name: Mount bazel action cache
uses: actions/cache@v2
with:
path: "~/.cache/bazel"
key: bazel

- name: Mount bazel repo cache
uses: actions/cache@v2
- uses: bazel-contrib/[email protected]
with:
path: "~/.cache/bazel-repo"
key: bazel-repo

# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: true
# Share repository cache between workflows.
repository-cache: true

- name: bazel test //... (Java ${{ matrix.java-major-version }})
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: bazelisk --bazelrc=.github/workflows/ci.bazelrc test ${{ matrix.flags }} //...
25 changes: 9 additions & 16 deletions .github/workflows/tests_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,15 @@ jobs:
distribution: "zulu"
java-version: "21"

- uses: bazelbuild/setup-bazelisk@v2

- name: Mount bazel action cache
uses: actions/cache@v2
with:
path: "~/.cache/bazel"
key: bazel

- name: Mount bazel repo cache
uses: actions/cache@v2
- uses: bazel-contrib/[email protected]
with:
path: "~/.cache/bazel-repo"
key: bazel-repo
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: true
# Share repository cache between workflows.
repository-cache: true

- name: bzlmod gazelle
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: bazelisk --bazelrc=.github/workflows/ci.bazelrc test //java/gazelle/...
# Ignoring the handful of tests that are failing without other changes for now
run: bazelisk --bazelrc=.github/workflows/ci.bazelrc test --test_tag_filters=-skip-windows //java/gazelle/...
1 change: 0 additions & 1 deletion .tar-exclude-from-file.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
bin
docs
frozen_deps_install.json
maven_install.json
pmd-ruleset.xml

2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildifier(
visibility = ["//visibility:private"],
)

# gazelle:java_maven_install_file frozen_deps_install.json
# gazelle:java_maven_install_file contrib_rules_jvm_deps_install.json
# gazelle:prefix github.com/bazel-contrib/rules_jvm

# gazelle:repository go_repository name=org_golang_x_tools_go_vcs importpath=golang.org/x/tools/go/vcs
Expand Down
8 changes: 4 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ git_override(

bazel_dep(
name = "protobuf",
version = PROTOBUF_VERSION,
version = "27.2",
repo_name = "com_google_protobuf",
)
bazel_dep(
Expand All @@ -48,7 +48,7 @@ bazel_dep(
)
bazel_dep(
name = "rules_go",
version = "0.43.0",
version = "0.48.1",
repo_name = "io_bazel_rules_go",
)
bazel_dep(
Expand All @@ -57,11 +57,11 @@ bazel_dep(
)
bazel_dep(
name = "rules_jvm_external",
version = "6.0",
version = "6.2",
)
bazel_dep(
name = "rules_proto",
version = "5.3.0-{}".format(PROTOBUF_VERSION),
version = "6.0.2",
)

bazel_dep(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ dependencies are loaded using a call to `maven_install`, but we don't
want to force users to remember to load our own dependencies for
us. Instead, to add a new dependency to the project:

1. Update `frozen_deps` in the `WORKSPACE` file
1. Update `contrib_rules_jvm_deps` in the `MODULE.bazel` file
2. Run `./tools/update-dependencies.sh`
3. Commit the updated files.

Expand Down
70 changes: 0 additions & 70 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -40,76 +40,6 @@ load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS")
load("@rules_jvm_external//:defs.bzl", "maven_install")
load("//third_party:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")

# This only exists to give us a target to use with `./tools/update-dependencies.sh`.
# If you update this, then please re-run that script and commit the changes to repo.
maven_install(
name = "frozen_deps",
artifacts = [
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.errorprone:error_prone_annotations:2.11.0",
"com.google.guava:guava:30.1.1-jre",
"commons-cli:commons-cli:1.5.0",
"io.grpc:grpc-api:1.40.0",
"io.grpc:grpc-core:1.40.0",
"io.grpc:grpc-netty:1.40.0",
"io.grpc:grpc-services:1.40.0",
"io.grpc:grpc-stub:1.40.0",
"org.slf4j:slf4j-simple:1.7.32",
"com.google.googlejavaformat:google-java-format:1.15.0",

# These can be versioned independently of the versions in `repositories.bzl`
# so long as the version numbers are higher.
"org.junit.jupiter:junit-jupiter-engine:5.8.2",
"org.junit.jupiter:junit-jupiter-api:5.8.2",
"org.junit.platform:junit-platform-launcher:1.8.2",
"org.junit.platform:junit-platform-reporting:1.8.2",
"org.junit.vintage:junit-vintage-engine:5.8.2",

# Open Test Alliance for the JVM dep
"org.opentest4j:opentest4j:1.2.0",

# Checkstyle deps
"com.puppycrawl.tools:checkstyle:10.2",

# PMD deps
"net.sourceforge.pmd:pmd-dist:6.55.0",

# Spotbugs deps
# We don't want to force people to use 1.8-beta
# but we can't use the `maven` macros because
# we've not loaded rules yet. Fortunately, the
# expansion is easy :)
{
"group": "com.github.spotbugs",
"artifact": "spotbugs",
"version": "4.7.0",
"exclusions": [
{
"group": "org.slf4j",
"artifact": "slf4j-api",
},
],
},
"org.slf4j:slf4j-api:1.7.32",
"org.slf4j:slf4j-jdk14:1.7.32",

# We explicitly declare a protobuf runtime version
# so that it coincides with the one we use to generate the code.
"com.google.protobuf:protobuf-java:{}".format(PROTOBUF_JAVA_VERSION),
] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
fail_if_repin_required = True,
fetch_sources = True,
generate_compat_repositories = True,
maven_install_json = "@contrib_rules_jvm//:frozen_deps_install.json",
repositories = [
"https://repo1.maven.org/maven2",
],
)

load("@frozen_deps//:defs.bzl", frozen_deps_pmi = "pinned_maven_install")

frozen_deps_pmi()

# These are used for our own tests.
maven_install(
name = "contrib_rules_jvm_tests",
Expand Down
Loading

0 comments on commit 21b018b

Please sign in to comment.