Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bzlmod migration #326

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod

# Remove after https://github.com/bazelbuild/rules_jvm_external/issues/1048 is fixed
build --host_cxxopt=-std=c++14
3 changes: 3 additions & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
7.3.2
# 6.5.0
# Pinned until https://github.com/bazelbuild/rules_jvm_external/issues/1048 is fixed
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
69 changes: 69 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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.7.1")
bazel_dep(name = "rules_jvm_external", version = "6.4")
bazel_dep(name = "protobuf", version = "29.0-rc1", repo_name = "com_google_protobuf")
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a", repo_name = "com_google_googleapis")
bazel_dep(name = "rules_pkg", version = "0.10.1")
bazel_dep(name = "rules_license", version = "1.0.0")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "grpc-java", version = "1.66.0")
bazel_dep(name = "rules_java", version = "7.12.1")

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")

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

# run 'bazel run @unpinned_maven//:pin' after updating versions below to generate a new lock file.
maven.install(
# keep sorted
artifacts = [
"com.google.auto.value:auto-value:1.11.0",
"com.google.auto.value:auto-value-annotations:1.11.0",
"com.google.code.findbugs:annotations:3.0.1",
"com.google.errorprone:error_prone_annotations:2.33.0",
"com.google.guava:guava:33.3.1-jre",
"com.google.guava:guava-testlib:33.3.1-jre",
"com.google.protobuf:protobuf-java:4.29.0-RC1",
"com.google.protobuf:protobuf-java-util:4.29.0-RC1",
"com.google.re2j:re2j:1.7",
"com.google.testparameterinjector:test-parameter-injector:1.18",
"com.google.truth.extensions:truth-java8-extension:1.4.4",
"com.google.truth.extensions:truth-proto-extension:1.4.4",
"com.google.truth:truth:1.4.4",
"org.antlr:antlr4-runtime:4.11.1",
"org.jspecify:jspecify:1.0.0",
"org.threeten:threeten-extra:1.8.0",
"org.yaml:snakeyaml:2.2",
],
fail_if_repin_required = True,
lock_file = "//:maven_install.json",
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
)
use_repo(maven, "maven", "unpinned_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")
use_repo(non_module_dependencies, "cel_spec")
184 changes: 0 additions & 184 deletions WORKSPACE

This file was deleted.

2 changes: 1 addition & 1 deletion bundle/src/main/java/dev/cel/bundle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ java_library(
"//parser:macro",
"//parser:parser_builder",
"//runtime",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@maven//:com_google_code_findbugs_annotations",
"@maven//:com_google_errorprone_error_prone_annotations",
Expand Down
2 changes: 1 addition & 1 deletion bundle/src/test/java/dev/cel/bundle/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ java_library(
"//parser:macro",
"//runtime",
"//runtime:unknown_attributes",
"@@protobuf~//java/core",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@cel_spec//proto/test/v1/proto2:test_all_types_java_proto",
"@cel_spec//proto/test/v1/proto3:test_all_types_java_proto",
"@com_google_googleapis//google/rpc/context:attribute_context_java_proto",
"@com_google_googleapis//google/type:type_java_proto",
"@maven//:com_google_guava_guava",
"@maven//:com_google_guava_guava_testlib",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_google_protobuf_protobuf_java_util",
"@maven//:com_google_testparameterinjector_test_parameter_injector",
"@maven//:com_google_truth_extensions_truth_proto_extension",
Expand Down
10 changes: 5 additions & 5 deletions checker/src/main/java/dev/cel/checker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ java_library(
"//common/types",
"//common/types:cel_types",
"//common/types:type_providers",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
Expand Down Expand Up @@ -84,7 +84,7 @@ java_library(
"//common/types:cel_types",
"//common/types:message_type_provider",
"//common/types:type_providers",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
Expand All @@ -103,7 +103,7 @@ java_library(
"//common:compiler_common",
"//common:options",
"//common/types:type_providers",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@maven//:com_google_errorprone_error_prone_annotations",
],
Expand All @@ -116,7 +116,7 @@ java_library(
],
deps = [
"//:auto_value",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
],
Expand Down Expand Up @@ -184,7 +184,7 @@ java_library(
"//common/types:type_providers",
"//parser:macro",
"//parser:operator",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
Expand Down
2 changes: 1 addition & 1 deletion 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(
srcs = glob(["*Test.java"]),
resources = ["//checker/src/test/resources:baselines"],
deps = [
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
# "//java/com/google/testing/testsize:annotations",
"//:auto_value",
"//checker",
Expand Down
2 changes: 1 addition & 1 deletion codelab/src/main/codelab/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ java_library(
"//validator/validators:homogeneous_literal", # unuseddeps: keep
"//validator/validators:regex", # unuseddeps: keep
"//validator/validators:timestamp", # unuseddeps: keep
"@@protobuf~//java/core", # unuseddeps: keep
"@com_google_googleapis//google/rpc/context:attribute_context_java_proto", # unuseddeps: keep
"@maven//:com_google_guava_guava", # unuseddeps: keep
"@maven//:com_google_protobuf_protobuf_java", # unuseddeps: keep
"@maven//:com_google_protobuf_protobuf_java_util", # unuseddeps: keep
],
)
2 changes: 1 addition & 1 deletion codelab/src/main/codelab/solutions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ java_library(
"//validator/validators:homogeneous_literal",
"//validator/validators:regex",
"//validator/validators:timestamp",
"@@protobuf~//java/core",
"@com_google_googleapis//google/rpc/context:attribute_context_java_proto",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_google_protobuf_protobuf_java_util",
],
)
Loading