Skip to content

Commit

Permalink
Migrate to Bzlmod
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 627072320
  • Loading branch information
l46kok authored and copybara-github committed Apr 22, 2024
1 parent 95cb753 commit f030854
Show file tree
Hide file tree
Showing 38 changed files with 212 additions and 245 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ bazel-cel-java
bazel-out
bazel-testlogs

MODULE.bazel*

# IntelliJ IDEA
.idea
*.iml
Expand All @@ -30,3 +28,6 @@ target

# Temporary output dir for artifacts
mvn-artifacts

*.swp
*.lock
83 changes: 83 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright 2024 Google LLC
#
# 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
#
# https://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 = "cel_java"
)

bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "rules_jvm_external", version = "6.0")
bazel_dep(name = "protobuf", repo_name="com_google_protobuf", version = "23.1")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "rules_license", version = "0.0.8")
bazel_dep(name = "rules_java", version = "7.4.0")
bazel_dep(name = "cel-spec", repo_name="cel_spec", version = "0.14.0")

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")

maven.install(
# keep sorted
artifacts = [
"com.google.api.grpc:proto-google-common-protos:2.27.0",
"com.google.auto.value:auto-value-annotations:1.10.4",
"com.google.auto.value:auto-value:1.10.4",
"com.google.code.findbugs:annotations:3.0.1",
"com.google.errorprone:error_prone_annotations:2.23.0",
"com.google.guava:guava-testlib:33.0.0-jre",
"com.google.guava:guava:33.0.0-jre",
"com.google.protobuf:protobuf-java-util:3.24.4",
"com.google.protobuf:protobuf-java:3.24.4",
"com.google.re2j:re2j:1.7",
"com.google.testparameterinjector:test-parameter-injector:1.15",
"com.google.truth.extensions:truth-java8-extension:1.4.0",
"com.google.truth.extensions:truth-proto-extension:1.4.0",
"com.google.truth:truth:1.4.0",
"org.antlr:antlr4-runtime:4.11.1",
"org.jspecify:jspecify:0.2.0",
"org.threeten:threeten-extra:1.7.2",
],
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
use_repo(maven, "maven")

non_module_dependencies = use_extension("//:repositories.bzl", "non_module_dependencies")
use_repo(non_module_dependencies, "antlr4_jar")
use_repo(non_module_dependencies, "bazel_common")

# Note: We aren't able to use Bazel Central Registry for googleapis
# until https://github.com/bazelbuild/rules_jvm_external/issues/1048 is resolved.
GOOGLE_APIS_VERSION = "d73a41615b101c34c58b3534c2cc7ee1d89cccb0"

bazel_dep(name = "com_google_googleapis", version = GOOGLE_APIS_VERSION)
archive_override(
module_name = "com_google_googleapis",
integrity = "sha256-sOd1u3SXtn/7CtnH6dxze8ZEkSkRsOJHTusK/STVi0c=",
patch_strip = 1,
patches = [
# See https://github.com/bazelbuild/rules_go/issues/3685
"googleapis_add_bzlmod_support.patch"
],
strip_prefix = "googleapis-" + GOOGLE_APIS_VERSION,
urls = [
"https://github.com/googleapis/googleapis/archive/%s.zip" % GOOGLE_APIS_VERSION
],
)

switched_rules = use_extension("@com_google_googleapis//:extensions.bzl", "switched_rules")
switched_rules.use_languages(java = True)
use_repo(switched_rules, "com_google_googleapis_imports")

172 changes: 0 additions & 172 deletions WORKSPACE

This file was deleted.

4 changes: 2 additions & 2 deletions bundle/src/test/java/dev/cel/bundle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ java_library(
testonly = True,
srcs = glob(["*Test.java"]),
deps = [
"//:auto_value",
"//:java_truth",
":auto_value",
":java_truth",
"//bundle:cel",
"//checker",
"//checker:checker_legacy_environment",
Expand Down
14 changes: 7 additions & 7 deletions checker/src/main/java/dev/cel/checker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ java_library(
tags = [
],
deps = [
"//:auto_value",
":auto_value",
"//common/annotations",
"//common/internal:file_descriptor_converter",
"//common/types",
Expand All @@ -64,12 +64,12 @@ java_library(
tags = [
],
deps = [
":auto_value",
":cel_ident_decl",
":checker_builder",
":checker_legacy_environment",
":proto_type_mask",
":type_provider_legacy_impl",
"//:auto_value",
"//common",
"//common:compiler_common",
"//common:options",
Expand Down Expand Up @@ -112,7 +112,7 @@ java_library(
tags = [
],
deps = [
"//:auto_value",
":auto_value",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
Expand All @@ -127,7 +127,7 @@ java_library(
tags = [
],
deps = [
"//:auto_value",
":auto_value",
"//common/annotations",
"//common/ast",
"//common/ast:expr_converter",
Expand All @@ -145,8 +145,8 @@ java_library(
tags = [
],
deps = [
":auto_value",
":checker_legacy_environment",
"//:auto_value",
"//common/annotations",
"//common/types",
"//common/types:cel_types",
Expand All @@ -164,8 +164,8 @@ java_library(
tags = [
],
deps = [
":auto_value",
":cel_ident_decl",
"//:auto_value",
"//common:compiler_common",
"//common:features",
"//common:options",
Expand Down Expand Up @@ -194,7 +194,7 @@ java_library(
tags = [
],
deps = [
"//:auto_value",
":auto_value",
"//common/types",
"//common/types:type_providers",
"@maven//:com_google_errorprone_error_prone_annotations",
Expand Down
4 changes: 2 additions & 2 deletions checker/src/test/java/dev/cel/checker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ java_library(
resources = ["//checker/src/test/resources:baselines"],
deps = [
# "//java/com/google/testing/testsize:annotations",
"//:auto_value",
":auto_value",
"//checker",
"//checker:cel_ident_decl",
"//checker:checker_builder",
Expand Down Expand Up @@ -45,7 +45,7 @@ java_library(
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:org_jspecify_jspecify",
"@maven//:junit_junit",
"//:java_truth",
":java_truth",
"@maven//:com_google_truth_extensions_truth_proto_extension",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@maven//:com_google_api_grpc_proto_google_common_protos",
Expand Down
Loading

0 comments on commit f030854

Please sign in to comment.