Skip to content

Commit

Permalink
Migrate bazel-common from WORKSPACE to Bzlmod and bump bazel version …
Browse files Browse the repository at this point in the history
…to 7.3.1.

Fixes #165, #189.

PiperOrigin-RevId: 682420602
  • Loading branch information
chaoren authored and Google Java Core Libraries committed Oct 4, 2024
1 parent 9f81752 commit e2204d6
Show file tree
Hide file tree
Showing 39 changed files with 4,541 additions and 910 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.1
7.3.1
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
runs-on: ubuntu-latest
env:
# Used by bazelisk: https://github.com/bazelbuild/bazelisk
USE_BAZEL_VERSION: '5.4.1'
USE_BAZEL_VERSION: '7.3.1'
steps:
- name: 'Check out repository'
uses: actions/checkout@v2
- name: 'Cache Bazel dependencies'
uses: actions/[email protected]
with:
path: ~/.cache/bazel/*/*/external
key: bazel-${{ hashFiles('workspace_defs.bzl') }}
key: bazel-${{ hashFiles('MODULE.bazel') }}
restore-keys: |
bazel-
- name: 'Test'
Expand Down
123 changes: 123 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Copyright (C) 2024 The Google Bazel Common Authors.
#
# 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.

module(name = "google_bazel_common")

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "rules_java", version = "7.12.1")
bazel_dep(name = "rules_jvm_external", version = "6.4")

GUAVA_VERSION = "33.3.1-jre"

AUTO_SERVICE_VERSION = "1.1.1"

AUTO_VALUE_VERSION = "1.10.4"

ERROR_PRONE_VERSION = "2.22.0"

BYTE_BUDDY_VERSION = "1.14.9"

TRUTH_VERSION = "1.4.4"

GRPC_VERSION = "1.66.0"

CHECKER_FRAMEWORK_VERSION = "2.5.3"

ASM_VERSION = "9.6"

LOG4J2_VERSION = "2.17.2"

INCAP_VERSION = "0.2"

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
artifacts = [
"javax.annotation:jsr250-api:1.0",
"com.google.code.findbugs:jsr305:3.0.1",
"javax.inject:javax.inject:1",
"javax.inject:javax.inject-tck:1",
"com.google.guava:guava:" + GUAVA_VERSION,
"com.google.guava:guava-testlib:" + GUAVA_VERSION,
"com.google.guava:failureaccess:1.0.1",
"com.google.guava:guava-beta-checker:1.0",
"com.google.errorprone:javac-shaded:9-dev-r4023-3",
"com.google.googlejavaformat:google-java-format:1.18.1",
"com.google.auto:auto-common:1.2.2",
"com.google.auto.factory:auto-factory:1.0.1",
"com.google.auto.service:auto-service:" + AUTO_SERVICE_VERSION,
"com.google.auto.service:auto-service-annotations:" + AUTO_SERVICE_VERSION,
"com.google.auto.value:auto-value:" + AUTO_VALUE_VERSION,
"com.google.auto.value:auto-value-annotations:" + AUTO_VALUE_VERSION,
"com.google.errorprone:error_prone_annotation:" + ERROR_PRONE_VERSION,
"com.google.errorprone:error_prone_annotations:" + ERROR_PRONE_VERSION,
"com.google.errorprone:error_prone_check_api:" + ERROR_PRONE_VERSION,
"junit:junit:4.13.2",
"com.google.testing.compile:compile-testing:0.21.0",
"net.bytebuddy:byte-buddy:" + BYTE_BUDDY_VERSION,
"net.bytebuddy:byte-buddy-agent:" + BYTE_BUDDY_VERSION,
"org.mockito:mockito-core:2.28.2",
"org.hamcrest:hamcrest-core:1.3",
"org.objenesis:objenesis:1.0",
"com.google.truth:truth:" + TRUTH_VERSION,
# TODO: b/113905249 - Remove this: All its contents have moved into `truth`.
"com.google.truth.extensions:truth-java8-extension:" + TRUTH_VERSION,
"com.squareup:javapoet:1.13.0",
"io.grpc:grpc-api:" + GRPC_VERSION,
"io.grpc:grpc-core:" + GRPC_VERSION,
"io.grpc:grpc-netty:" + GRPC_VERSION,
"io.grpc:grpc-context:" + GRPC_VERSION,
"io.grpc:grpc-protobuf:" + GRPC_VERSION,
"io.grpc:grpc-stub:" + GRPC_VERSION,
"io.grpc:grpc-all:" + GRPC_VERSION,
"com.google.protobuf:protobuf-java:3.24.4",
"org.checkerframework:checker-compat-qual:" + CHECKER_FRAMEWORK_VERSION,
"org.checkerframework:checker-qual:" + CHECKER_FRAMEWORK_VERSION,
"org.checkerframework:javacutil:" + CHECKER_FRAMEWORK_VERSION,
"org.checkerframework:dataflow:" + CHECKER_FRAMEWORK_VERSION,
"org.jspecify:jspecify:1.0.0",
"org.ow2.asm:asm:" + ASM_VERSION,
"org.ow2.asm:asm-tree:" + ASM_VERSION,
"org.ow2.asm:asm-commons:" + ASM_VERSION,
"org.codehaus.plexus:plexus-utils:3.0.20",
"org.codehaus.plexus:plexus-classworlds:2.5.2",
"org.codehaus.plexus:plexus-component-annotations:1.5.5",
"org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.0",
"org.eclipse.sisu:org.eclipse.sisu.inject:0.3.0",
"org.apache.maven:maven-artifact:3.3.3",
"org.apache.maven:maven-model:3.3.3",
"org.apache.maven:maven-plugin-api:3.3.3",
"javax.enterprise:cdi-api:1.0",
"org.pantsbuild:jarjar:1.7.2",
"org.apache.ant:ant:1.9.6",
"org.apache.ant:ant-launcher:1.9.6",
"log4j:log4j:1.2.15",
"org.apache.logging.log4j:log4j-api:" + LOG4J2_VERSION,
"org.apache.logging.log4j:log4j-core:" + LOG4J2_VERSION,
"org.apache.bcel:bcel:6.7.0",
"com.googlecode.java-diff-utils:diffutils:1.3.0",
"org.slf4j:slf4j-api:1.7.14",
"net.ltgt.gradle.incap:incap:" + INCAP_VERSION,
"net.ltgt.gradle.incap:incap-processor:" + INCAP_VERSION,
"com.google.common.inject:inject-common:1.0",
],
fail_if_repin_required = True,
lock_file = "//:maven_install.json",
repositories = [
"https://bazel-mirror.storage.googleapis.com/repo1.maven.org/maven2/",
"https://repo1.maven.org/maven2/",
"http://maven.ibiblio.org/maven2/", # link seems to be dead?
],
strict_visibility = True,
)
use_repo(maven, "maven")
Loading

0 comments on commit e2204d6

Please sign in to comment.