Skip to content

Commit

Permalink
Migrate to Bzlmod.
Browse files Browse the repository at this point in the history
This updates Bazel to 6.4.0 and Tink to 1.8.0.
  • Loading branch information
SanjayVas committed Jan 9, 2024
1 parent ddedd5a commit 912c3b4
Show file tree
Hide file tree
Showing 183 changed files with 524 additions and 1,661 deletions.
9 changes: 7 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Enable Bzlmod.
common --enable_bzlmod
common --registry=https://raw.githubusercontent.com/world-federation-of-advertisers/bazel-registry/main
common --registry=https://bcr.bazel.build

# Use clang as C++ compiler.
build --repo_env='CC=clang'

Expand All @@ -7,5 +12,5 @@ build --cxxopt='-std=c++17'
# Use JDK 11. See https://github.com/bazelbuild/bazel/issues/6245.
build --java_runtime_version=remotejdk_11

# Target Java 8.
build --java_language_version=8
# Target Java 9.
build --java_language_version=9
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.0
6.4.0
206 changes: 206 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
module(
name = "common-jvm",
repo_name = "wfa_common_jvm",
)

KOTLINX_COROUTINES_VERSION = "1.7.3"

PROTOBUF_JAVA_VERSION = "3.25.1"

GRPC_JAVA_VERSION = "1.59.1"

AWS_JAVA_SDK_VERSION = "2.17.258"

OPENTELEMETRY_JAVA_VERSION = "1.32.0"

TRUTH_VERSION = "1.1.2"

TINK_VERSION = "1.12.0"

MAVEN_REPO_NAME = "common_jvm_maven"

# Bazel Central Registry deps.
bazel_dep(
name = "platforms",
version = "0.0.8",
)
bazel_dep(
name = "bazel_skylib",
version = "1.5.0",
)
bazel_dep(
name = "rules_proto",
version = "5.3.0-21.7",
)
bazel_dep(
name = "rules_pkg",
version = "0.9.1",
)
bazel_dep(
name = "rules_java",
version = "7.2.0",
)
bazel_dep(
name = "rules_multirun",
version = "0.6.1",
)
bazel_dep(
name = "protobuf",
version = "21.7",
repo_name = "com_google_protobuf",
)
bazel_dep(
name = "rules_jvm_external",
version = "5.3",
)
bazel_dep(
name = "rules_oci",
version = "1.4.3",
)

# WFA registry deps.
bazel_dep(
name = "rules_kotlin_jvm",
version = "0.1.1",
repo_name = "wfa_rules_kotlin_jvm",
)
bazel_dep(
name = "googleapis",
version = "0.0.0-bzlmod.1",
repo_name = "com_google_googleapis",
)

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

# Work around "circular dependency" between grpc-core and grpc-util.
# TODO(bazelbuild/rules_jvm_external#966): Remove when fixed.
maven.artifact(
name = MAVEN_REPO_NAME,
artifact = "grpc-core",
exclusions = ["io.grpc:grpc-util"],
group = "io.grpc",
version = GRPC_JAVA_VERSION,
)
maven.install(
name = MAVEN_REPO_NAME,
artifacts = [
"junit:junit:4.13.2",
"org.conscrypt:conscrypt-openjdk-uber:2.5.2",
"org.jetbrains:annotations:23.0.0",
"org.mockito:mockito-core:4.11.0",
"org.mockito.kotlin:mockito-kotlin:4.1.0",
"info.picocli:picocli:4.4.0",
"com.google.api:api-common:2.21.0",
"com.google.api:gax:2.38.0",
"com.google.apis:google-api-services-bigquery:v2-rev20231111-2.0.0",
"com.google.cloud:google-cloud-core:2.28.0",
"com.google.cloud:google-cloud-core-grpc:2.28.0",
"com.google.cloud:google-cloud-storage:2.30.1",
"com.google.cloud:google-cloud-nio:0.127.8",
"com.google.cloud:google-cloud-spanner:6.55.0",
"com.google.cloud:google-cloud-bigquery:2.35.0",
"com.google.code.gson:gson:2.10.1",
"com.google.protobuf:protobuf-java:" + PROTOBUF_JAVA_VERSION,
"com.google.protobuf:protobuf-java-util:" + PROTOBUF_JAVA_VERSION,
"io.grpc:grpc-context:" + GRPC_JAVA_VERSION,
"io.grpc:grpc-testing:" + GRPC_JAVA_VERSION,
"io.grpc:grpc-netty:" + GRPC_JAVA_VERSION,
"io.grpc:grpc-services:" + GRPC_JAVA_VERSION,
"io.grpc:grpc-inprocess:" + GRPC_JAVA_VERSION,
"io.netty:netty-handler:4.1.79.Final",
"org.jetbrains.kotlinx:kotlinx-coroutines-test:" + KOTLINX_COROUTINES_VERSION,
"org.jetbrains.kotlinx:kotlinx-coroutines-debug:" + KOTLINX_COROUTINES_VERSION,
"org.jetbrains.kotlinx:kotlinx-coroutines-reactive:" + KOTLINX_COROUTINES_VERSION,
"org.jetbrains.kotlinx:kotlinx-coroutines-guava:" + KOTLINX_COROUTINES_VERSION,
"org.reactivestreams:reactive-streams:1.0.4",
"io.projectreactor:reactor-core:3.4.19",
"com.google.crypto.tink:tink:" + TINK_VERSION,

# Truth.
"com.google.truth:truth:" + TRUTH_VERSION,
"com.google.truth.extensions:truth-java8-extension:" + TRUTH_VERSION,
"com.google.truth.extensions:truth-proto-extension:" + TRUTH_VERSION,
"com.google.truth.extensions:truth-liteproto-extension:" + TRUTH_VERSION,

# AWS.
"com.adobe.testing:s3mock-junit4:2.2.3",
"software.amazon.awssdk:auth:" + AWS_JAVA_SDK_VERSION,
"software.amazon.awssdk:regions:" + AWS_JAVA_SDK_VERSION,
"software.amazon.awssdk:s3:" + AWS_JAVA_SDK_VERSION,
"software.amazon.awssdk:secretsmanager:" + AWS_JAVA_SDK_VERSION,
"software.amazon.awssdk:sts:" + AWS_JAVA_SDK_VERSION,

# OpenTelemetry.
"io.opentelemetry:opentelemetry-api:" + OPENTELEMETRY_JAVA_VERSION,
"io.opentelemetry:opentelemetry-context:" + OPENTELEMETRY_JAVA_VERSION,

# PostgreSQL.
"com.google.cloud.sql:postgres-socket-factory:1.6.2",
"com.google.cloud.sql:cloud-sql-connector-r2dbc-core:1.6.2",
"com.google.cloud.sql:cloud-sql-connector-r2dbc-postgres:1.6.2",
"org.postgresql:postgresql:42.4.0",
"org.testcontainers:postgresql:1.18.3",
"org.postgresql:r2dbc-postgresql:0.9.1.RELEASE",
"io.r2dbc:r2dbc-spi:0.9.1.RELEASE",

# Liquibase.
"org.yaml:snakeyaml:1.30",
"org.liquibase:liquibase-core:4.18.0",
"com.google.cloudspannerecosystem:liquibase-spanner:4.17.0",
"com.google.cloud:google-cloud-spanner-jdbc:2.9.0",
"org.liquibase.ext:liquibase-postgresql:4.11.0",

# Math library.
"org.apache.commons:commons-math3:3.6.1",
"org.apache.commons:commons-numbers-gamma:1.1",

# CSV library.
"com.opencsv:opencsv:5.6",

# Riegeli Decompressor
"org.apache.commons:commons-compress:1.22",
"org.brotli:dec:0.1.2",
"com.github.luben:zstd-jni:1.5.2-5",
],
exclusions = [
# protobuf-java and protobuf-javalite cannot coexist.
"com.google.protobuf:protobuf-javalite",
],
fetch_sources = True,
repositories = [
"https://maven.google.com",
"https://repo1.maven.org/maven2",
],
strict_visibility = True,
)
use_repo(maven, MAVEN_REPO_NAME)

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "java_image_base",
# Digest of nonroot-amd64 tag.
digest = "sha256:781e3acb7934ce0fa5ceeb62ee1369248ab23ae26dce002138b3d0e5338d7486",
image = "gcr.io/distroless/java11-debian11",
)
oci.pull(
name = "java_debug_image_base",
# Digest of debug-nonroot-amd64 tag.
digest = "sha256:95749ff107e1a1e14a62709f305208973530764cdac02a0f7762295dba2c40d2",
image = "gcr.io/distroless/java11-debian11",
)
use_repo(
oci,
"java_debug_image_base",
"java_image_base",
)

non_module_deps = use_extension(
"//build/extensions:non_module_deps.bzl",
"non_module_deps",
)
use_repo(
non_module_deps,
"cloud_spanner_emulator",
"com_google_highwayhash",
"io_grpc_grpc_proto",
)
31 changes: 2 additions & 29 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
# This file marks the root of the Bazel workspace.
# See MODULE.bazel for external dependencies setup.
workspace(name = "wfa_common_jvm")

load("//build:common_jvm_repositories.bzl", "common_jvm_repositories")

common_jvm_repositories()

load("//build:common_jvm_deps.bzl", "common_jvm_deps")

common_jvm_deps()

load(
"//build:common_jvm_maven.bzl",
"COMMON_JVM_EXCLUDED_ARTIFACTS",
"COMMON_JVM_MAVEN_OVERRIDE_TARGETS",
"common_jvm_maven_artifacts",
)
load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
artifacts = common_jvm_maven_artifacts(),
excluded_artifacts = COMMON_JVM_EXCLUDED_ARTIFACTS,
fetch_sources = True,
generate_compat_repositories = True,
override_targets = COMMON_JVM_MAVEN_OVERRIDE_TARGETS,
repositories = ["https://repo.maven.apache.org/maven2/"],
)

load("//build:common_jvm_extra_deps.bzl", "common_jvm_extra_deps")

common_jvm_extra_deps()
31 changes: 0 additions & 31 deletions build/bazel_skylib/repo.bzl

This file was deleted.

Empty file removed build/bazel_toolchains/BUILD.bazel
Empty file.
38 changes: 0 additions & 38 deletions build/bazel_toolchains/repo.bzl

This file was deleted.

Empty file.
29 changes: 0 additions & 29 deletions build/com_github_grpc_grpc/repo.bzl

This file was deleted.

Empty file removed build/com_google_truth/BUILD.bazel
Empty file.
24 changes: 0 additions & 24 deletions build/com_google_truth/repo.bzl

This file was deleted.

Loading

0 comments on commit 912c3b4

Please sign in to comment.