Skip to content

Commit

Permalink
Modernize to latest bzlmod
Browse files Browse the repository at this point in the history
  • Loading branch information
l46kok committed Oct 8, 2024
1 parent c7a2e18 commit ea74b70
Show file tree
Hide file tree
Showing 33 changed files with 1,876 additions and 307 deletions.
3 changes: 2 additions & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
6.5.0
7.3.2
# 6.5.0
# Pinned until https://github.com/bazelbuild/rules_jvm_external/issues/1048 is fixed
96 changes: 96 additions & 0 deletions @
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
alias sim="sudo -E vim"
alias zshs="source ~/.zshrc"
alias mdp="~/mdproxy/bin-base/mdproxy_tools --connect"
alias mdv="~/mdproxy/bin-base/mdproxy_tools --verify"
alias src="cd /google/src/cloud/sokwhan"
alias jsrc="cd /google/src/cloud/sokwhan/cel-source/google3"
alias osrc="cd ~/SourceCode"
alias celsrc="cd /google/src/cloud/sokwhan/cel-source/google3/third_party/java/cel"
alias awake="caffeinate -imdsu"

alias migrate="~/migrate.sh"

alias k2="open /Applications/KakaoTalkAA.app"

# fig

alias hgclean="hg tracked --auto-remove-includes --no-backup --noninteractive"
alias hgd="hg diff"
alias hgc="hg commit"
alias hgu="hg upload ."
alias hgca="hg commit --amend --no-edit"
alias hghr="hg status -un | xargs rm"
alias hgs="hg status"
alias hgx="hg xl"
alias hgcall="hgca && hg evolve && hg ut"

# git related

alias gl="git log"
alias gb="git branch"
alias gfo="git fetch origin"
alias gpr="git pull --rebase"
alias gc="git commit"
alias gs="git status"
alias gd="git diff"

export PATH=/opt/homebrew/bin:$PATH:/Applications/kdiff3.app/Contents/MacOS:$PATH:/Users/sokwhan/maven/apache-maven-3.8.7/bin:/usr/local/bin

bindkey -e
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-char

# Usage: scpdev /your/file
function scpdev() {
scp sokwhan.c.googlers.com:$1 .
}

function gcert() {
if [[ -n $TMUX ]]; then
eval $(tmux show-environment -s)
fi

command gcert "$@"
}

function dev() {
ssh sokwhan.c.googlers.com
}

function devnew() {
(gcertstatus || gcert) && \
ssh -t sokwhan.c.googlers.com "bash -c '(killall mosh-server || true) && (gcertstatus || gcert)'"
echo 'gcert done, use ^C to prevent a new session.' && \
gmosh sokwhan.c.googlers.com
}

function hgmv() {
hg mv $1 third_party/java/cel/java/dev/cel/runtime/internal
}


# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/sokwhan/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/sokwhan/Downloads/google-cloud-sdk/path.zsh.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '/Users/sokwhan/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/sokwhan/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
export PATH="/usr/local/opt/[email protected]/libexec/bin:$PATH"
[[ -e "/Users/sokwhan/mdproxy/data/mdproxy_zshrc" ]] && source "/Users/sokwhan/mdproxy/data/mdproxy_zshrc" # MDPROXY-ZSHRC

# DISABLE_AUTO_TITLE="true"
# export PS1='%(?.%F{green}.%F{green})sean %1~ %# %f'

#set history size
export HISTSIZE=10000
#save history after logout
export SAVEHIST=10000
#history file
export HISTFILE=~/.zhistory
#append into history file
setopt INC_APPEND_HISTORY
#save only one command if 2 common are same and consistent
setopt HIST_IGNORE_DUPS
#add timestamp for each entry
setopt EXTENDED_HISTORY

62 changes: 26 additions & 36 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,18 @@
# limitations under the License.

module(
name = "cel_java"
name = "cel_java",
)

bazel_dep(name = "bazel_skylib", version = "1.4.2")
bazel_dep(name = "rules_jvm_external", version = "5.3")
bazel_dep(name = "protobuf", repo_name="com_google_protobuf", version = "23.1")
bazel_dep(name = "googleapis", repo_name="com_google_googleapis", version = "0.0.0-20240326-1c8d509c5")
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 = "0.0.8")
bazel_dep(name = "rules_java", version = "7.2.0")
bazel_dep(name = "cel-spec", repo_name="cel_spec", version = "0.14.0")

# The following versions need to be pinned until https://github.com/bazelbuild/rules_jvm_external/issues/1048 is fixed

single_version_override(
module_name = "rules_jvm_external",
version = "5.3"
)
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)
Expand All @@ -42,38 +36,34 @@ 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.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.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.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.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",
"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:0.2.0",
"org.threeten:threeten-extra:1.7.2",
"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",
],
lock_file = "//:maven_install.json",
fail_if_repin_required=True
)
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")

# google_common_workspace_rules = use_extension("@bazel_common//:workspace_defs.bzl", "google_common_workspace_rules")
# google_common_workspace_rules()


use_repo(non_module_dependencies, "cel_spec")
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",
],
)
6 changes: 3 additions & 3 deletions codelab/src/test/codelab/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ java_test(
"//codelab",
"//common",
"//common/types",
"@@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_testparameterinjector_test_parameter_injector",
"@maven//:junit_junit",
],
Expand Down Expand Up @@ -60,9 +60,9 @@ java_test(
"//:java_truth",
"//codelab",
"//common",
"@@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_testparameterinjector_test_parameter_injector",
"@maven//:junit_junit",
],
Expand Down Expand Up @@ -93,9 +93,9 @@ java_test(
"//:java_truth",
"//codelab",
"//common",
"@@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",
"@maven//:com_google_testparameterinjector_test_parameter_injector",
"@maven//:junit_junit",
Expand Down
6 changes: 3 additions & 3 deletions codelab/src/test/codelab/solutions/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ java_test(
"//codelab:solutions",
"//common",
"//common/types",
"@@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_testparameterinjector_test_parameter_injector",
"@maven//:junit_junit",
],
Expand All @@ -56,9 +56,9 @@ java_test(
"//:java_truth",
"//codelab:solutions",
"//common",
"@@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_testparameterinjector_test_parameter_injector",
"@maven//:junit_junit",
],
Expand Down Expand Up @@ -87,9 +87,9 @@ java_test(
"//:java_truth",
"//codelab:solutions",
"//common",
"@@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",
"@maven//:com_google_testparameterinjector_test_parameter_injector",
"@maven//:junit_junit",
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/dev/cel/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ java_library(
"//common/types",
"//common/types:cel_types",
"//common/types:type_providers",
"@@protobuf~//java/core",
"@cel_spec//proto/cel/expr:expr_java_proto",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
],
)

Expand Down Expand Up @@ -193,9 +193,9 @@ java_library(
tags = [
],
deps = [
"@@protobuf~//java/core",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_google_protobuf_protobuf_java_util",
],
)
Expand Down
4 changes: 2 additions & 2 deletions common/src/main/java/dev/cel/common/ast/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ java_library(
deps = [
"//:auto_value",
"//common/annotations",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_google_errorprone_error_prone_annotations",
"@maven//:com_google_guava_guava",
"@maven//:org_jspecify_jspecify",
Expand Down Expand Up @@ -98,7 +98,7 @@ java_library(
deps = [
":ast",
"//common/annotations",
"@@protobuf~//java/core",
"@maven//:com_google_protobuf_protobuf_java",
"@maven//:com_google_guava_guava",
],
)
Expand Down
Loading

0 comments on commit ea74b70

Please sign in to comment.