diff --git a/.bazelrc b/.bazelrc index a8faf8d15..c0ebfce57 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,8 @@ +# Enable Bzlmod. +common --enable_bzlmod +common --registry=https://raw.githubusercontent.com/SanjayVas/bazel-registry/main/ +common --registry=https://bcr.bazel.build + # Use clang as C++ compiler. build --repo_env='CC=clang' @@ -8,4 +13,4 @@ build --cxxopt='-std=c++17' build --java_runtime_version=remotejdk_11 # Target Java 8. -build --java_language_version=8 \ No newline at end of file +build --java_language_version=8 diff --git a/.bazelversion b/.bazelversion index 8a30e8f94..19b860c18 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -5.4.0 +6.4.0 diff --git a/BUILD.bazel b/BUILD.bazel deleted file mode 100644 index 3b1efa885..000000000 --- a/BUILD.bazel +++ /dev/null @@ -1,7 +0,0 @@ -load("@bazel_gazelle//:def.bzl", "gazelle") - -package(default_visibility = ["//:__subpackages__"]) - -# This is completely unintuitive. The Bazel rules for Docker require this. -# https://github.com/bazelbuild/bazel-gazelle/issues/609 -gazelle(name = "gazelle") diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..2d3c8b788 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,195 @@ +module( + name = "common_jvm", + repo_name = "wfa_common_jvm", +) + +bazel_dep( + name = "platforms", + version = "0.0.7", +) +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 = "6.5.2", +) +bazel_dep( + name = "rules_jvm_external", + version = "5.3", +) +bazel_dep( + name = "rules_kotlin_jvm", + repo_name = "wfa_rules_kotlin_jvm", + version = "0.1.0-rc2", +) + +bazel_dep( + name = "protobuf", + version = "21.7", + repo_name = "com_google_protobuf", +) + +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.8.0" + +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( + artifact = "grpc-core", + exclusions = ["io.grpc:grpc-util"], + group = "io.grpc", + version = GRPC_JAVA_VERSION, +) +maven.install( + artifacts = [ + "junit:junit:4.13.2", + "org.conscrypt:conscrypt-openjdk-uber:2.5.2", + "org.jetbrains:annotations:23.0.0", + "org.mockito.kotlin:mockito-kotlin:3.2.0", + "info.picocli:picocli:4.4.0", + "com.google.api:api-common:2.5.0", + "com.google.api:gax:2.22.0", + "com.google.cloud:google-cloud-core:2.27.0", + "com.google.cloud:google-cloud-core-grpc:2.27.0", + "com.google.cloud:google-cloud-storage:2.29.1", + "com.google.cloud:google-cloud-nio:0.127.7", + "com.google.cloud:google-cloud-spanner:6.35.2", + "com.google.cloud:google-cloud-bigquery:2.10.10", + "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.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:s3:" + AWS_JAVA_SDK_VERSION, + "software.amazon.awssdk:secretsmanager:" + AWS_JAVA_SDK_VERSION, + "software.amazon.awssdk:sts:" + AWS_JAVA_SDK_VERSION, + "software.amazon.awssdk:regions:" + 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") + +bazel_dep( + name = "rules_oci", + version = "1.4.3", +) + +oci = use_extension("@rules_oci//oci:extensions.bzl", "oci") +oci.pull( + name = "java_image_base", + digest = "sha256:241064293d5477b6b91fb75abc923023a5fde11740a8ef56f54666579f8fef42", + image = "gcr.io/distroless/java11-debian11", +) +use_repo( + oci, + "java_image_base", +) + +bazel_dep( + name = "googleapis", + version = "0.1.0-rc1", +) + +googleapis = use_extension("@googleapis//extensions:googleapis.bzl", "googleapis") +use_repo(googleapis, "com_google_googleapis") + +repo_targets = use_extension("@googleapis//extensions:repo_targets.bzl", "repo_targets") +use_repo(repo_targets, "com_google_googleapis_imports") + +non_module_deps = use_extension( + "//build/extensions:non_module_deps.bzl", + "non_module_deps", +) +non_module_deps.tink_java_version( + sha256 = "cff458ea60897f7a5edc91d1eb9c58c650c2fd3206d94672f29c950b94398a49", + version = TINK_VERSION, +) +use_repo( + non_module_deps, + "cloud_spanner_emulator", + "com_google_highwayhash", + "io_grpc_grpc_proto", + "tink_java_src", +) diff --git a/WORKSPACE b/WORKSPACE index aa1fb5b7c..c21e24531 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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() diff --git a/build/bazel_skylib/repo.bzl b/build/bazel_skylib/repo.bzl deleted file mode 100644 index 401a1ca8c..000000000 --- a/build/bazel_skylib/repo.bzl +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Repository rules/macros for Bazel Skylib. -""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def bazel_skylib(): - maybe( - http_archive, - name = "bazel_skylib", - sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", - ], - ) diff --git a/build/bazel_toolchains/BUILD.bazel b/build/bazel_toolchains/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/bazel_toolchains/repo.bzl b/build/bazel_toolchains/repo.bzl deleted file mode 100644 index 79cfab7a8..000000000 --- a/build/bazel_toolchains/repo.bzl +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Repository macros for bazel-toolchains library. - -See https://github.com/bazelbuild/bazel-toolchains -""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -_URL_TEMPLATES = [ - "https://github.com/bazelbuild/bazel-toolchains/releases/download/{version}/bazel-toolchains-{version}.tar.gz", - "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/{version}/bazel-toolchains-{version}.tar.gz", -] - -def bazel_toolchains(name, version, sha256): - prefix = "bazel-toolchains-" + version - urls = [template.format(version = version) for template in _URL_TEMPLATES] - - maybe( - http_archive, - name = name, - sha256 = sha256, - strip_prefix = prefix, - urls = urls, - ) diff --git a/build/com_github_grpc_grpc/BUILD.bazel b/build/com_github_grpc_grpc/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/com_github_grpc_grpc/repo.bzl b/build/com_github_grpc_grpc/repo.bzl deleted file mode 100644 index 3459f09dd..000000000 --- a/build/com_github_grpc_grpc/repo.bzl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Repository rules/macros for Github GRPC. -""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") - -def com_github_grpc_grpc(): - maybe( - http_archive, - name = "com_github_grpc_grpc", - sha256 = "67423a4cd706ce16a88d1549297023f0f9f0d695a96dd684adc21e67b021f9bc", - strip_prefix = "grpc-1.46.0", - urls = ["https://github.com/grpc/grpc/archive/v1.46.0.tar.gz"], - ) diff --git a/build/com_google_truth/BUILD.bazel b/build/com_google_truth/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/com_google_truth/repo.bzl b/build/com_google_truth/repo.bzl deleted file mode 100644 index bdf57b453..000000000 --- a/build/com_google_truth/repo.bzl +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Repository defs for Truth library.""" - -_ARTIFACT_NAMES = [ - "com.google.truth.extensions:truth-java8-extension", - "com.google.truth.extensions:truth-proto-extension", - "com.google.truth:truth", -] - -def com_google_truth_artifact_dict(version): - return {name: version for name in _ARTIFACT_NAMES} diff --git a/build/common_jvm_deps.bzl b/build/common_jvm_deps.bzl deleted file mode 100644 index fae3e631f..000000000 --- a/build/common_jvm_deps.bzl +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Adds external repos necessary for common-jvm. -""" - -load("@rules_pkg//pkg:deps.bzl", "rules_pkg_dependencies", "rules_pkg_register_toolchains") -load( - "@rules_proto//proto:repositories.bzl", - "rules_proto_dependencies", - "rules_proto_toolchains", -) -load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") -load( - "@io_bazel_rules_docker//repositories:repositories.bzl", - container_repositories = "repositories", -) -load("//build/rules_kotlin:deps.bzl", "rules_kotlin_deps") -load("//build/io_bazel_rules_docker:base_images.bzl", "base_java_images") -load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps") -load( - "@com_google_googleapis//:repository_rules.bzl", - "switched_rules_by_language", -) -load("@tink_java//:tink_java_deps.bzl", "tink_java_deps") - -# buildifier: disable=unnamed-macro -def common_jvm_deps(): - """Adds transitive dependencies of external repos for common-jvm.""" - rules_pkg_dependencies() - rules_pkg_register_toolchains() - rules_proto_dependencies() - rules_proto_toolchains() - rules_jvm_external_deps() - grpc_deps() - container_repositories() - rules_kotlin_deps() - base_java_images() - switched_rules_by_language( - name = "com_google_googleapis_imports", - java = True, - ) - tink_java_deps() diff --git a/build/common_jvm_extra_deps.bzl b/build/common_jvm_extra_deps.bzl deleted file mode 100644 index 1e8e98edc..000000000 --- a/build/common_jvm_extra_deps.bzl +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Adds external repos necessary for common-jvm. -""" - -load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") -load("@com_github_grpc_grpc_kotlin//:repositories.bzl", "grpc_kt_repositories") -load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories") -load("@maven//:compat.bzl", "compat_repositories") -load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps") -load( - "@io_bazel_rules_docker//java:image.bzl", - java_image_repositories = "repositories", -) -load("//build:grpc_extra_deps.bzl", "grpc_extra_deps") - -def common_jvm_extra_deps(): - """ - Adds second-level transitive dependencies of external repos for common-jvm. - """ - rules_jvm_external_setup() - grpc_extra_deps() - compat_repositories() - container_deps() - java_image_repositories() - grpc_kt_repositories() - grpc_java_repositories() diff --git a/build/common_jvm_maven.bzl b/build/common_jvm_maven.bzl deleted file mode 100644 index 8bc74d579..000000000 --- a/build/common_jvm_maven.bzl +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Adds external repos necessary for common-jvm. -""" - -load( - "//build/rules_kotlin:repo.bzl", - "rules_kotlin_maven_artifacts_dict", -) -load( - "@io_grpc_grpc_java//:repositories.bzl", - GRPC_JAVA_MAVEN_DEPS = "IO_GRPC_GRPC_JAVA_ARTIFACTS", -) -load( - "@com_github_grpc_grpc_kotlin//:repositories.bzl", - GRPC_KOTLIN_MAVEN_DEPS = "IO_GRPC_GRPC_KOTLIN_ARTIFACTS", -) -load( - "//build/rules_proto:repo.bzl", - "rules_proto_maven_artifacts_dict", - RULES_PROTO_EXCLUDED_ARTIFACTS = "EXCLUDED_ARTIFACTS", -) -load("//build/grpc_java:repo.bzl", "grpc_java_maven_artifacts_dict") -load( - "//build/grpc_kotlin:repo.bzl", - "GRPC_KOTLIN_OVERRIDE_TARGETS", - "grpc_kotlin_maven_artifacts_dict", -) -load("//build/com_google_truth:repo.bzl", "com_google_truth_artifact_dict") -load("//build/kotlinx_coroutines:repo.bzl", "kotlinx_coroutines_artifact_dict") -load("//build/maven:artifacts.bzl", "artifacts") -load("//build/tink:repo.bzl", "TINK_JAVA_KMS_MAVEN_DEPS") -load( - "//build:versions.bzl", - "AWS_JAVA_SDK_VERSION", - "OPENTELEMETRY_JAVA_VERSION", - "PROTOBUF_KOTLIN_VERSION", -) - -# buildifier: disable=function-docstring-return -def common_jvm_maven_artifacts(): - """Returns a list of Maven artifacts for this repo.""" - return artifacts.dict_to_list(common_jvm_maven_artifacts_dict()) - -# buildifier: disable=function-docstring-return -def common_jvm_maven_artifacts_dict(): - """Returns a dict of Maven coordinates to version for this repo.""" - maven_artifacts = artifacts.list_to_dict( - GRPC_JAVA_MAVEN_DEPS + - GRPC_KOTLIN_MAVEN_DEPS, - ) - - maven_artifacts.update(rules_proto_maven_artifacts_dict()) - maven_artifacts.update(rules_kotlin_maven_artifacts_dict()) - maven_artifacts.update(grpc_java_maven_artifacts_dict()) - maven_artifacts.update(grpc_kotlin_maven_artifacts_dict()) - maven_artifacts.update(TINK_JAVA_KMS_MAVEN_DEPS) - maven_artifacts.update(com_google_truth_artifact_dict(version = "1.0.1")) - maven_artifacts.update(kotlinx_coroutines_artifact_dict()) - - # Add Maven artifacts or override versions (e.g. those pulled in by gRPC Kotlin - # or default dependency versions). - maven_artifacts.update({ - "com.adobe.testing:s3mock-junit4": "2.2.3", - "com.google.cloud:google-cloud-bigquery": "2.10.10", - "com.google.cloud:google-cloud-nio": "0.123.28", - "com.google.cloud:google-cloud-spanner": "6.35.2", - "com.google.cloud:google-cloud-storage": "2.6.1", - "com.google.guava:guava": "31.0.1-jre", - "info.picocli:picocli": "4.4.0", - "io.opentelemetry:opentelemetry-api": OPENTELEMETRY_JAVA_VERSION, - "junit:junit": "4.13", - "org.conscrypt:conscrypt-openjdk-uber": "2.5.2", - "org.jetbrains:annotations": "23.0.0", - "org.mockito.kotlin:mockito-kotlin": "3.2.0", - "software.amazon.awssdk:s3": AWS_JAVA_SDK_VERSION, - "software.amazon.awssdk:secretsmanager": AWS_JAVA_SDK_VERSION, - "software.amazon.awssdk:sts": AWS_JAVA_SDK_VERSION, - "software.amazon.awssdk:regions": AWS_JAVA_SDK_VERSION, - - # PostgreSQL. - "com.google.cloud.sql:postgres-socket-factory": "1.6.2", - "com.google.cloud.sql:cloud-sql-connector-r2dbc-postgres": "1.6.2", - "org.postgresql:postgresql": "42.4.0", - "org.postgresql:r2dbc-postgresql": "0.9.1.RELEASE", - "org.testcontainers:postgresql": "1.18.3", - - # 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", - - # For grpc-kotlin. This should be a version that is compatible with - # KOTLIN_RELEASE_VERSION. - "com.squareup:kotlinpoet": "1.8.0", - - # For kt_jvm_proto_library. - "com.google.protobuf:protobuf-kotlin": PROTOBUF_KOTLIN_VERSION, - - # 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", - }) - - return maven_artifacts - -COMMON_JVM_MAVEN_OVERRIDE_TARGETS = GRPC_KOTLIN_OVERRIDE_TARGETS - -COMMON_JVM_EXCLUDED_ARTIFACTS = [ - # Until the log2shell has been more widely mitigated, prohibit log4j totally. - "org.apache.logging.log4j:log4j", - "org.apache.logging.log4j:log4j-api", - "org.apache.logging.log4j:log4j-core", - "org.slf4j:log4j-over-slf4j", - "org.slf4j:slf4j-log4j12", -] + RULES_PROTO_EXCLUDED_ARTIFACTS diff --git a/build/common_jvm_repositories.bzl b/build/common_jvm_repositories.bzl deleted file mode 100644 index 28ceae292..000000000 --- a/build/common_jvm_repositories.bzl +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Adds external repos necessary for common-jvm. -""" - -load("//build/bazel_skylib:repo.bzl", "bazel_skylib") -load("//build/rules_pkg:repo.bzl", "rules_pkg") -load("//build/protobuf:repo.bzl", "com_github_protocolbuffers_protobuf") -load("//build/rules_proto:repo.bzl", "rules_proto") -load("//build/platforms:repo.bzl", "platforms_repo") -load("//build/grpc_java:repo.bzl", "io_grpc_grpc_java") -load("//build/grpc_kotlin:repo.bzl", "com_github_grpc_grpc_kotlin") -load("//build/rules_jvm_external:repo.bzl", "rules_jvm_external_repo") -load("//build/com_github_grpc_grpc:repo.bzl", "com_github_grpc_grpc") -load("//build/cloud_spanner_emulator:defs.bzl", "cloud_spanner_emulator_binaries") -load("//build/io_bazel_rules_docker:repo.bzl", "io_bazel_rules_docker") -load("//build/com_google_googleapis:repo.bzl", "com_google_googleapis") -load("//build/rules_kotlin:repo.bzl", "io_bazel_rules_kotlin") -load("//build/tink:repo.bzl", "tink_java") -load("//build/com_google_highwayhash:repo.bzl", "com_google_highwayhash") - -def common_jvm_repositories(): - """ - Adds all external repos necessary for common-jvm. - """ - platforms_repo() - bazel_skylib() - rules_pkg() - com_github_protocolbuffers_protobuf() - rules_proto() - rules_jvm_external_repo() - io_bazel_rules_kotlin() - io_grpc_grpc_java() - com_github_grpc_grpc_kotlin() - com_github_grpc_grpc() - cloud_spanner_emulator_binaries() - io_bazel_rules_docker() - com_google_googleapis() - tink_java() - com_google_highwayhash() diff --git a/build/defs.bzl b/build/defs.bzl index 1ca281f82..51c6fa83b 100644 --- a/build/defs.bzl +++ b/build/defs.bzl @@ -16,13 +16,7 @@ def to_label(label_string): """Returns a Label object for a possibly relative label string.""" - if label_string.startswith("@") or label_string.startswith("//"): - return Label(label_string) - - return Label("{repo}//{package}".format( - repo = native.repository_name(), - package = native.package_name(), - )).relative(label_string) + return native.package_relative_label(label_string) def test_target(target): """Returns the label for the corresponding target in the test tree.""" diff --git a/build/bazel_skylib/BUILD.bazel b/build/extensions/BUILD.bazel similarity index 100% rename from build/bazel_skylib/BUILD.bazel rename to build/extensions/BUILD.bazel diff --git a/build/extensions/non_module_deps.bzl b/build/extensions/non_module_deps.bzl new file mode 100644 index 000000000..9fd63296a --- /dev/null +++ b/build/extensions/non_module_deps.bzl @@ -0,0 +1,75 @@ +# Copyright 2023 The Cross-Media Measurement 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 extension for non-module dependencies of common_jvm.""" + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("//build/cloud_spanner_emulator:defs.bzl", "cloud_spanner_emulator_binaries") +load("//build/com_google_googleapis:repo.bzl", "com_google_googleapis") +load("//build/com_google_highwayhash:repo.bzl", "com_google_highwayhash") + +_file_version_tag = tag_class( + attrs = { + "version": attr.string(), + "sha256": attr.string(), + }, +) + +def _non_module_deps_impl(mctx): + tink_java_version = None + for module in mctx.modules: + for file_version in module.tags.tink_java_version: + if tink_java_version: + fail("Only one tink-java version supported") + tink_java_version = file_version + + # TODO(tink-crypto/tink-java#19): Remove when fixed. + if not tink_java_version: + fail("tink_java_version is required") + http_archive( + name = "tink_java_src", + urls = ["https://github.com/tink-crypto/tink-java/archive/refs/tags/v{version}.zip".format(version = tink_java_version.version)], + strip_prefix = "tink-java-{version}/src/main/java/com/google/crypto/tink".format(version = tink_java_version.version), + sha256 = tink_java_version.sha256, + build_file_content = """ +load("@rules_java//java:defs.bzl", "java_library") + +package(default_visibility = ["//visibility:public"]) + +java_library( + name = "kms_clients_test_util", + srcs = ["KmsClientsTestUtil.java"], + deps = ["@wfa_common_jvm//imports/java/com/google/crypto/tink"], + testonly = True, +) +""", + ) + + com_google_googleapis() + cloud_spanner_emulator_binaries() + com_google_highwayhash() + + http_archive( + name = "io_grpc_grpc_proto", + sha256 = "464e97a24d7d784d9c94c25fa537ba24127af5aae3edd381007b5b98705a0518", + strip_prefix = "grpc-proto-08911e9d585cbda3a55eb1dcc4b99c89aebccff8", + urls = ["https://github.com/grpc/grpc-proto/archive/08911e9d585cbda3a55eb1dcc4b99c89aebccff8.zip"], + ) + +non_module_deps = module_extension( + implementation = _non_module_deps_impl, + tag_classes = { + "tink_java_version": _file_version_tag, + }, +) diff --git a/build/grpc_extra_deps.bzl b/build/grpc_extra_deps.bzl deleted file mode 100644 index 427714856..000000000 --- a/build/grpc_extra_deps.bzl +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2023 The Cross-Media Measurement 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. - -"""Loads the dependencies necessary for the external repositories defined in grpc_deps.bzl. -""" - -load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") -load("@build_bazel_apple_support//lib:repositories.bzl", "apple_support_dependencies") -load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") -load("@com_envoyproxy_protoc_gen_validate//:dependencies.bzl", "go_third_party") -load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") -load("@envoy_api//bazel:repositories.bzl", "api_dependencies") -load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") -load("@upb//bazel:workspace_deps.bzl", "upb_deps") - -def grpc_extra_deps(ignore_version_differences = False, go_toolchains_version = "1.19.4"): - """Loads additional gRPC dependencies. - - This is copied from https://github.com/grpc/grpc - with modifications to address version compatibility issues. - It must be run after `grpc_deps`. - - TODO(grpc/grpc#32850): Revert when the dependency issue is addressed. - - Args: - ignore_version_differences: Plumbed directly to the invocation of - apple_rules_dependencies. - go_toolchains_version: Plumbed directly to the invocation of - go_register_toolchains. - """ - protobuf_deps() - - upb_deps() - - api_dependencies() - - go_rules_dependencies() - go_register_toolchains(version = go_toolchains_version) - gazelle_dependencies() - - # Pull-in the go 3rd party dependencies for protoc_gen_validate, which is - # needed for building C++ xDS protos - go_third_party() - - apple_rules_dependencies(ignore_version_differences = ignore_version_differences) - - apple_support_dependencies() - - # Initialize Google APIs with only C++ and Python targets - switched_rules_by_language( - name = "com_google_googleapis_imports", - cc = True, - grpc = True, - python = True, - ) diff --git a/build/grpc_java/BUILD.bazel b/build/grpc_java/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/grpc_java/repo.bzl b/build/grpc_java/repo.bzl deleted file mode 100644 index ead8968a6..000000000 --- a/build/grpc_java/repo.bzl +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2022 The Cross-Media Measurement 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. - -"""Repository rules/macros for grpc-java.""" - -load("//build:versions.bzl", "GRPC_JAVA", "versioned_http_archive") - -# Known coordinates for non-Android Maven artifacts built from grpc-java. -_MAVEN_COORDINATES = [ - "io.grpc:grpc-alts", - "io.grpc:grpc-api", - "io.grpc:grpc-auth", - "io.grpc:grpc-benchmarks", - "io.grpc:grpc-bom", - "io.grpc:grpc-census", - "io.grpc:grpc-context", - "io.grpc:grpc-core", - "io.grpc:grpc-googleapis", - "io.grpc:grpc-grpclb", - "io.grpc:grpc-netty", - "io.grpc:grpc-netty-shaded", - "io.grpc:grpc-okhttp", - "io.grpc:grpc-protobuf", - "io.grpc:grpc-protobuf-lite", - "io.grpc:grpc-rls", - "io.grpc:grpc-services", - "io.grpc:grpc-stub", - "io.grpc:grpc-testing", - "io.grpc:grpc-xds", -] - -def io_grpc_grpc_java(): - versioned_http_archive(GRPC_JAVA, "io_grpc_grpc_java") - -def grpc_java_maven_artifacts_dict(): - return { - coordinates: GRPC_JAVA.version - for coordinates in _MAVEN_COORDINATES - } diff --git a/build/grpc_kotlin/BUILD.bazel b/build/grpc_kotlin/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/grpc_kotlin/repo.bzl b/build/grpc_kotlin/repo.bzl deleted file mode 100644 index a4898870a..000000000 --- a/build/grpc_kotlin/repo.bzl +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Repository rules/macros for Github GPRC Kotlin. -""" - -load("//build:versions.bzl", "GRPC_KOTLIN", "versioned_http_archive") - -# kt_jvm_grpc_library directly depends on these library targets. -GRPC_KOTLIN_OVERRIDE_TARGETS = { - "io.grpc:grpc-kotlin-stub": "@com_github_grpc_grpc_kotlin//stub/src/main/java/io/grpc/kotlin:stub", -} - -def com_github_grpc_grpc_kotlin(): - versioned_http_archive(GRPC_KOTLIN, "com_github_grpc_grpc_kotlin") - -def grpc_kotlin_maven_artifacts_dict(): - return { - coordinates: GRPC_KOTLIN.version - for coordinates in GRPC_KOTLIN_OVERRIDE_TARGETS.keys() - } diff --git a/build/io_bazel_rules_docker/BUILD.bazel b/build/io_bazel_rules_docker/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/io_bazel_rules_docker/base_images.bzl b/build/io_bazel_rules_docker/base_images.bzl deleted file mode 100644 index ed420649b..000000000 --- a/build/io_bazel_rules_docker/base_images.bzl +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Build defs for base container images.""" - -load("@io_bazel_rules_docker//container:container.bzl", "container_pull") - -def base_java_images(): - """Default base Java image targets. - - These must come before calling repositories() in - @io_bazel_rules_docker//java:image.bzl. The target names are significant. - - See https://console.cloud.google.com/gcr/images/distroless/GLOBAL/java - - We currently use - gcr.io/distroless/java11-debian11:nonroot-amd64 - and - gcr.io/distroless/java11-debian11:debug-nonroot-amd64 - as the base images. - """ - - container_pull( - name = "java_image_base", - digest = "sha256:241064293d5477b6b91fb75abc923023a5fde11740a8ef56f54666579f8fef42", - registry = "gcr.io", - repository = "distroless/java11-debian11", - ) - - container_pull( - name = "java_debug_image_base", - digest = "sha256:b7bfe2e8e38fc34180de94ec4b2e34a1fc4aa4021215edc87675710b95e663e2", - registry = "gcr.io", - repository = "distroless/java11-debian11", - ) diff --git a/build/io_bazel_rules_docker/repo.bzl b/build/io_bazel_rules_docker/repo.bzl deleted file mode 100644 index 639f8c124..000000000 --- a/build/io_bazel_rules_docker/repo.bzl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Repository rules/macros for rules_docker.""" - -load("//build:versions.bzl", "RULES_DOCKER", "versioned_http_archive") - -def io_bazel_rules_docker(): - versioned_http_archive(RULES_DOCKER, "io_bazel_rules_docker") diff --git a/build/kotlinx_coroutines/BUILD.bazel b/build/kotlinx_coroutines/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/kotlinx_coroutines/repo.bzl b/build/kotlinx_coroutines/repo.bzl deleted file mode 100644 index 98cd7d9a9..000000000 --- a/build/kotlinx_coroutines/repo.bzl +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Repository defs for kotlinx-coroutines.""" - -load("//build:versions.bzl", "KOTLINX_COROUTINES_VERSION") - -_ARTIFACT_NAMES = [ - "org.jetbrains.kotlinx:kotlinx-coroutines-core", - "org.jetbrains.kotlinx:kotlinx-coroutines-debug", - "org.jetbrains.kotlinx:kotlinx-coroutines-guava", - "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", - "org.jetbrains.kotlinx:kotlinx-coroutines-reactive", - "org.jetbrains.kotlinx:kotlinx-coroutines-test", -] - -def kotlinx_coroutines_artifact_dict(): - return {name: KOTLINX_COROUTINES_VERSION for name in _ARTIFACT_NAMES} diff --git a/build/kt_jvm_proto/BUILD.bazel b/build/kt_jvm_proto/BUILD.bazel index b712fc463..e69de29bb 100644 --- a/build/kt_jvm_proto/BUILD.bazel +++ b/build/kt_jvm_proto/BUILD.bazel @@ -1,13 +0,0 @@ -load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_kotlinc_options") - -package(default_visibility = ["//visibility:public"]) - -sh_binary( - name = "extract_srcjars", - srcs = ["extract_srcjars.sh"], -) - -kt_kotlinc_options( - name = "proto_gen_kt_options", - warn = "off", -) diff --git a/build/kt_jvm_proto/defs.bzl b/build/kt_jvm_proto/defs.bzl index af2c0debb..1a802fe97 100644 --- a/build/kt_jvm_proto/defs.bzl +++ b/build/kt_jvm_proto/defs.bzl @@ -16,182 +16,31 @@ Provides kt_jvm_proto_library to generate Kotlin protos. """ -load("//build:defs.bzl", "get_real_short_path") -load("@rules_proto//proto:defs.bzl", "ProtoInfo") -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") - -KtProtoLibInfo = provider( - "Information for a Kotlin JVM proto library.", - fields = {"srcjars": "depset of .srcjar Files"}, -) - -def _run_protoc(ctx, proto_lib, output_dir): - """Executes protoc to generate Kotlin files.""" - proto_info = proto_lib[ProtoInfo] - descriptor_sets = proto_info.transitive_descriptor_sets - transitive_descriptor_set = depset(transitive = [descriptor_sets]) - proto_sources = [get_real_short_path(file) for file in proto_info.direct_sources] - - protoc_args = ctx.actions.args() - protoc_args.set_param_file_format("multiline") - protoc_args.use_param_file("@%s") - protoc_args.add("--kotlin_out=" + output_dir.path) - protoc_args.add_joined( - transitive_descriptor_set, - join_with = ctx.configuration.host_path_separator, - format_joined = "--descriptor_set_in=%s", - ) - protoc_args.add_all(proto_sources) - ctx.actions.run( - inputs = depset(transitive = [transitive_descriptor_set]), - outputs = [output_dir], - executable = ctx.executable._protoc, - arguments = [protoc_args], - mnemonic = "KtProtoc", - progress_message = "Generating Kotlin protos for " + ctx.label.name, - ) - -def _create_srcjar(ctx, input_dir, output_jar): - """Bundles .kt files into a srcjar.""" - zipper_args = ctx.actions.args() - zipper_args.add("c", output_jar) - zipper_args.add_all([input_dir]) - - ctx.actions.run( - outputs = [output_jar], - inputs = [input_dir], - executable = ctx.executable._zipper, - arguments = [zipper_args], - mnemonic = "KtProtoSrcJar", - progress_message = "Generating Kotlin proto srcjar for " + ctx.label.name, - ) - -def _merge_srcjars(ctx, input_jars, output_jar): - """Merges multiple srcjars into a single srcjar.""" - tmp_dir_name = ctx.label.name + "_srcjars" - tmp_dir = ctx.actions.declare_directory(tmp_dir_name) - - merge_args = ctx.actions.args() - merge_args.add(ctx.executable._zipper) - merge_args.add(tmp_dir.path) - merge_args.add_all(input_jars) - - ctx.actions.run( - outputs = [tmp_dir], - inputs = input_jars, - executable = ctx.executable._extract_srcjars, - tools = [ctx.executable._zipper], - arguments = [merge_args], - mnemonic = "KtProtoExtractSrcJars", - ) - - _create_srcjar(ctx, tmp_dir, output_jar) - -def _kt_jvm_proto_aspect_impl(target, ctx): - name = target.label.name - - gen_src_dir_name = name + "_kt_jvm_srcs" - gen_src_dir = ctx.actions.declare_directory(gen_src_dir_name) - _run_protoc(ctx, target, gen_src_dir) - - srcjar_name = name + "_kt_jvm.srcjar" - srcjar = ctx.actions.declare_file(srcjar_name) - _create_srcjar(ctx, gen_src_dir, srcjar) - - transitive = [ - dep[KtProtoLibInfo].srcjars - for dep in ctx.rule.attr.deps - if KtProtoLibInfo in dep - ] - return [KtProtoLibInfo( - srcjars = depset(direct = [srcjar], transitive = transitive), - )] - -_kt_jvm_proto_aspect = aspect( - attrs = { - "_zipper": attr.label( - default = Label("@bazel_tools//tools/zip:zipper"), - cfg = "exec", - executable = True, - ), - "_protoc": attr.label( - default = Label("@com_google_protobuf//:protoc"), - cfg = "exec", - executable = True, - ), - }, - implementation = _kt_jvm_proto_aspect_impl, - attr_aspects = ["deps"], +load( + "@wfa_rules_kotlin_jvm//kotlin:defs.bzl", + _kt_jvm_proto_library = "kt_jvm_proto_library", ) -def _kt_jvm_proto_library_helper_impl(ctx): - """Implementation of _kt_jvm_proto_library_helper rule.""" - proto_lib_info = ctx.attr.proto_dep[KtProtoLibInfo] - _merge_srcjars(ctx, proto_lib_info.srcjars, ctx.outputs.srcjar) +def kt_jvm_proto_library( + name, + srcs = None, + # buildifier: disable=unused-variable + deps = None, + **kwargs): + """Temporary forwarding macro for kt_jvm_proto_library. -_kt_jvm_proto_library_helper = rule( - attrs = { - "proto_dep": attr.label( - providers = [ProtoInfo], - aspects = [_kt_jvm_proto_aspect], - ), - "srcjar": attr.output( - doc = "Generated Java source jar.", - mandatory = True, - ), - "_zipper": attr.label( - default = Label("@bazel_tools//tools/zip:zipper"), - cfg = "exec", - executable = True, - ), - "_extract_srcjars": attr.label( - default = Label("@wfa_common_jvm//build/kt_jvm_proto:extract_srcjars"), - cfg = "exec", - executable = True, - ), - }, - implementation = _kt_jvm_proto_library_helper_impl, -) - -_KT_JVM_PROTO_DEPS = [ - "@com_google_protobuf_protobuf_kotlin", -] - -def kt_jvm_proto_library(name, srcs = None, deps = None, **kwargs): - """Generates Kotlin code for a protocol buffer library. - - For standard attributes, see: - https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes - - Args: - name: A name for the target - srcs: Exactly one proto_library target to generate Kotlin APIs for - deps: Exactly one java_proto_library target for srcs[0] - **kwargs: other args to pass to the ultimate kt_jvm_library target + Deprecated: + Use kt_jvm_proto_library from @wfa_rules_kotlin_jvm//kotlin:defs.bzl. """ - srcs = srcs or [] - deps = deps or [] - if len(srcs) != 1: - fail("Expected exactly one src", "srcs") - - if len(deps) != 1: - fail("Expected exactly one dep", "deps") - - generated_kt_name = name + "_DO_NOT_DEPEND_generated_kt" - generated_srcjar = generated_kt_name + ".srcjar" - _kt_jvm_proto_library_helper( - name = generated_kt_name, - proto_dep = srcs[0], - srcjar = generated_srcjar, - visibility = ["//visibility:private"], + # buildifier: disable=print + print( + "{context}: Use kt_jvm_proto_library from @wfa_rules_kotlin_jvm//kotlin:defs.bzl".format( + context = native.package_name(), + ), ) - - kt_jvm_library( + _kt_jvm_proto_library( name = name, - srcs = [generated_srcjar], - deps = deps + _KT_JVM_PROTO_DEPS, - exports = deps + _KT_JVM_PROTO_DEPS, - kotlinc_opts = "@wfa_common_jvm//build/kt_jvm_proto:proto_gen_kt_options", + deps = srcs, **kwargs ) diff --git a/build/kt_jvm_proto/extract_srcjars.sh b/build/kt_jvm_proto/extract_srcjars.sh deleted file mode 100755 index 8b34378eb..000000000 --- a/build/kt_jvm_proto/extract_srcjars.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2021 The Cross-Media Measurement 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. - - -# Extracts multiple srcjars to a single output directory. - -readonly zipper="$1" -readonly output_dir="$2" -shift 2 - -mkdir -p "${output_dir}" -for input_jar in "$@"; do - $zipper x "${input_jar}" -d "${output_dir}" -done diff --git a/build/kt_jvm_proto_library.bzl b/build/kt_jvm_proto_library.bzl deleted file mode 100644 index 4dd88703a..000000000 --- a/build/kt_jvm_proto_library.bzl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -"""Temporary forwarding macro for kt_jvm_proto_library.""" - -load("//build/kt_jvm_proto:defs.bzl", _kt_jvm_proto_library = "kt_jvm_proto_library") - -def kt_jvm_proto_library(**kwargs): - """Forwarding macro for kt_jvm_proto_library. - - Deprecated: - Load from @wfa_common_jvm//build/kt_jvm_proto:defs.bzl - """ - - # buildifier: disable=print - print( - "{context}: kt_jvm_proto_library should be loaded from @wfa_common_jvm//build/kt_jvm_proto:defs.bzl".format( - context = native.package_name(), - ), - ) - _kt_jvm_proto_library(**kwargs) diff --git a/build/macros.bzl b/build/macros.bzl index da18d804d..0c7353311 100644 --- a/build/macros.bzl +++ b/build/macros.bzl @@ -14,116 +14,22 @@ """Common macros.""" -load(":defs.bzl", "to_label") -load("@rules_java//java:defs.bzl", "java_library", "java_proto_library") load( - "@com_github_grpc_grpc_kotlin//:kt_jvm_grpc.bzl", - _kt_jvm_grpc_library = "kt_jvm_grpc_library", + "@wfa_rules_kotlin_jvm//kotlin:defs.bzl", + _kt_jvm_grpc_proto_library = "kt_jvm_grpc_proto_library", ) -load("//build/kt_jvm_proto:defs.bzl", "kt_jvm_proto_library") -def kt_jvm_grpc_library( - name, - srcs, - deps, - flavor = None, - visibility = None, - **kwargs): - """Wrapper macro for regular kt_jvm_grpc_library rule from grpc_kotlin. +def kt_jvm_grpc_proto_library(name, srcs = None, **kwargs): + """Forwarding macro for kt_jvm_grpc_proto_library. - This includes a convenience export for the java_proto_library dep. - - Args: - name: Target name. - srcs: Exactly one proto_library target. - deps: Exactly one java_proto_library target. - flavor: "normal" (default) for normal proto runtime, or "lite" for the - lite runtime (for Android usage) - visibility: List of visibility labels. - **kwargs: Keyword arguments. - """ - - internal_name = name + "_internal" - - _kt_jvm_grpc_library( - name = internal_name, - srcs = srcs, - deps = deps, - flavor = flavor, - visibility = ["//visibility:private"], - **kwargs - ) - java_library( - name = name, - exports = [ - internal_name, - ] + deps, - visibility = visibility, - **kwargs - ) - -def kt_jvm_grpc_proto_library( - name, - srcs, - flavor = None, - visibility = None, - **kwargs): - """java_library that exports Kotlin JVM gRPC service and proto libraries. - - Given a proto_library named `_proto`, this will create additional - `_java_proto`, `_kt_jvm_proto`, and `_kt_jvm_grpc` - targets. - - Args: - name: Target name. - srcs: Exactly one proto source file. - flavor: "normal" (default) for normal proto runtime, or "lite" for the - lite runtime (for Android usage) - visibility: List of visibility labels. - **kwargs: Keyword arguments. + Deprecated: + Use kt_jvm_grpc_proto_library from @wfa_rules_kotlin_jvm//kotlin:defs.bzl. """ - if len(srcs) != 1: - fail("Expected exactly one src", "srcs") - - proto_name = to_label(srcs[0]).name - if not proto_name.endswith("_proto"): - fail("proto_library target names should end with '_proto'") - name_prefix = proto_name.rsplit("_", 1)[0] - java_proto_name = name_prefix + "_java_proto" - kt_jvm_proto_name = name_prefix + "_kt_jvm_proto" - kt_jvm_grpc_name = name_prefix + "_kt_jvm_grpc" - - java_proto_library( - name = java_proto_name, - deps = srcs, - visibility = visibility, - **kwargs - ) - - kt_jvm_proto_library( - name = kt_jvm_proto_name, - srcs = srcs, - deps = [java_proto_name], - visibility = visibility, - **kwargs - ) - - _kt_jvm_grpc_library( - name = kt_jvm_grpc_name, - srcs = srcs, - deps = [java_proto_name], - flavor = flavor, - visibility = visibility, - **kwargs - ) - - java_library( - name = name, - exports = [ - kt_jvm_grpc_name, - kt_jvm_proto_name, - ], - visibility = visibility, - **kwargs + # buildifier: disable=print + print( + "{context}: Use kt_jvm_grpc_proto_library from @wfa_rules_kotlin_jvm//kotlin:defs.bzl".format( + context = native.package_name(), + ), ) + _kt_jvm_grpc_proto_library(name, deps = srcs, **kwargs) diff --git a/build/maven/BUILD.bazel b/build/maven/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/maven/artifacts.bzl b/build/maven/artifacts.bzl deleted file mode 100644 index 5061b88ef..000000000 --- a/build/maven/artifacts.bzl +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Maven artifact utils.""" - -def _list_to_dict(artifact_list): - """Returns a dict of artifact name to version.""" - tuples = [tuple(item.rsplit(":", 1)) for item in artifact_list] - return {name: version for (name, version) in tuples} - -def _dict_to_list(artifact_dict): - """Returns a list artifacts from a dict of name to version.""" - return [ - ":".join([name, version]) - for (name, version) in artifact_dict.items() - ] - -artifacts = struct( - list_to_dict = _list_to_dict, - dict_to_list = _dict_to_list, -) diff --git a/build/platforms/repo.bzl b/build/platforms/repo.bzl deleted file mode 100644 index 87a0a3dbc..000000000 --- a/build/platforms/repo.bzl +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Repository rules/macros for Platforms. -""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def platforms_repo(): - if "platforms" not in native.existing_rules(): - http_archive( - name = "platforms", - sha256 = "079945598e4b6cc075846f7fd6a9d0857c33a7afc0de868c2ccb96405225135d", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", - "https://github.com/bazelbuild/platforms/releases/download/0.0.4/platforms-0.0.4.tar.gz", - ], - ) diff --git a/build/protobuf/BUILD.bazel b/build/protobuf/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/protobuf/repo.bzl b/build/protobuf/repo.bzl deleted file mode 100644 index dc7364ea5..000000000 --- a/build/protobuf/repo.bzl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Repository rules/macros for Protobuf. -""" - -load("//build:versions.bzl", "PROTOBUF", "versioned_http_archive") - -def com_github_protocolbuffers_protobuf(): - versioned_http_archive(PROTOBUF, "com_github_protocolbuffers_protobuf") diff --git a/build/rules_jvm_external/BUILD.bazel b/build/rules_jvm_external/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/rules_jvm_external/repo.bzl b/build/rules_jvm_external/repo.bzl deleted file mode 100644 index f20e40243..000000000 --- a/build/rules_jvm_external/repo.bzl +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -""" -Repository rules/macros for JVM External Rules. -""" - -load("//build:versions.bzl", "RULES_JVM_EXTERNAL", "versioned_http_archive") - -def rules_jvm_external_repo(): - versioned_http_archive(RULES_JVM_EXTERNAL, "rules_jvm_external") diff --git a/build/rules_kotlin/defs.bzl b/build/rules_kotlin/defs.bzl index 1010eda63..c704565d4 100644 --- a/build/rules_kotlin/defs.bzl +++ b/build/rules_kotlin/defs.bzl @@ -14,23 +14,19 @@ """Macros for kt_jvm_library to include Maven kotlin stdlib.""" -load( - "@io_bazel_rules_kotlin//kotlin:jvm.bzl", - _kt_jvm_library = "kt_jvm_library", -) +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", _kt_jvm_library = "kt_jvm_library") -_STDLIBS = [ - "@wfa_common_jvm//imports/kotlin/kotlin:stdlib", - "@wfa_common_jvm//imports/kotlin/kotlin/reflect", -] +def kt_jvm_library(*args, **kwargs): + """Forwarding macro for kt_jvm_library. -def kt_jvm_library(name, deps = None, exports = None, **kwargs): - deps = deps or [] - exports = exports or [] + Deprecated: + Load @wfa_rules_kotlin_jvm//kotlin:defs.bzl + """ - _kt_jvm_library( - name = name, - deps = deps + _STDLIBS, - exports = exports + _STDLIBS, - **kwargs + # buildifier: disable=print + print( + "{context}: kt_jvm_library should be loaded from @wfa_rules_kotlin_jvm//kotlin:defs.bzl".format( + context = native.package_name(), + ), ) + _kt_jvm_library(*args, **kwargs) diff --git a/build/rules_kotlin/deps.bzl b/build/rules_kotlin/deps.bzl deleted file mode 100644 index d7d12e34b..000000000 --- a/build/rules_kotlin/deps.bzl +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Repository rules/macros for rules_kotlin dependencies.""" - -load( - "@io_bazel_rules_kotlin//kotlin:repositories.bzl", - "kotlin_repositories", - "kotlinc_version", -) -load("//build:versions.bzl", "KOTLIN_RELEASE_VERSION") - -# Version of org.jetbrains:annotations that comes bundled with -# KOTLIN_RELEASE_VERSION. -JETBRAINS_ANNOTATIONS_VERSION = "13.0" - -# buildifier: disable=unnamed-macro -def rules_kotlin_deps(): - compiler_release = kotlinc_version( - release = KOTLIN_RELEASE_VERSION, - sha256 = "6e43c5569ad067492d04d92c28cdf8095673699d81ce460bd7270443297e8fd7", - ) - kotlin_repositories( - compiler_release = compiler_release, - ) - native.register_toolchains( - "@wfa_common_jvm//build/rules_kotlin/toolchain:toolchain", - ) diff --git a/build/rules_kotlin/repo.bzl b/build/rules_kotlin/repo.bzl deleted file mode 100644 index 0738622fa..000000000 --- a/build/rules_kotlin/repo.bzl +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2020 The Cross-Media Measurement 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. - -"""Repository rules/macros for rules_kotlin. - -See https://github.com/bazelbuild/rules_kotlin -""" - -load( - "//build:versions.bzl", - "KOTLIN_RELEASE_VERSION", - "RULES_KOTLIN", - "versioned_http_archive", -) - -_JETBRAINS_KOTLIN_LIBRARIES = [ - "org.jetbrains.kotlin:kotlin-stdlib", - "org.jetbrains.kotlin:kotlin-stdlib-common", - "org.jetbrains.kotlin:kotlin-reflect", - "org.jetbrains.kotlin:kotlin-test", -] - -def io_bazel_rules_kotlin(): - versioned_http_archive(RULES_KOTLIN, "io_bazel_rules_kotlin") - -def rules_kotlin_maven_artifacts_dict(): - artifacts_dict = { - coordinates: KOTLIN_RELEASE_VERSION - for coordinates in _JETBRAINS_KOTLIN_LIBRARIES - } - return artifacts_dict diff --git a/build/rules_kotlin/toolchain/BUILD.bazel b/build/rules_kotlin/toolchain/BUILD.bazel deleted file mode 100644 index a3ccb3c49..000000000 --- a/build/rules_kotlin/toolchain/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load( - "@io_bazel_rules_kotlin//kotlin:core.bzl", - "define_kt_toolchain", - "kt_kotlinc_options", -) -load("//build:versions.bzl", "KOTLIN_LANGUAGE_LEVEL") - -kt_kotlinc_options( - name = "default_opts", - include_stdlibs = "none", - x_optin = ["kotlin.RequiresOptIn"], -) - -define_kt_toolchain( - name = "toolchain", - api_version = KOTLIN_LANGUAGE_LEVEL, - kotlinc_options = ":default_opts", - language_version = KOTLIN_LANGUAGE_LEVEL, -) diff --git a/build/rules_oci/BUILD.bazel b/build/rules_oci/BUILD.bazel new file mode 100644 index 000000000..f96267592 --- /dev/null +++ b/build/rules_oci/BUILD.bazel @@ -0,0 +1,4 @@ +exports_files([ + "repositories_tmpl.txt", + "tags_tmpl.txt", +]) diff --git a/build/rules_oci/defs.bzl b/build/rules_oci/defs.bzl new file mode 100644 index 000000000..385935582 --- /dev/null +++ b/build/rules_oci/defs.bzl @@ -0,0 +1,136 @@ +# Copyright 2023 The Cross-Media Measurement 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. + +"""Defs for rules_oci.""" + +load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push_rule") +load("@rules_pkg//pkg:mappings.bzl", "pkg_files") +load("@rules_pkg//pkg:tar.bzl", "pkg_tar") +load("//build:defs.bzl", "expand_template", "to_label") + +DEFAULT_JAVA_IMAGE_BASE = Label("@java_image_base") + +def java_image( + name, + deploy_jar, + base = DEFAULT_JAVA_IMAGE_BASE, + labels = None, + visibility = None, + **kwargs): + """Java container image. + + For standard attributes, see + https://bazel.build/reference/be/common-definitions + + Args: + name: name of the resulting oci_image target + deploy_jar: label of deploy JAR from java_binary + base: label of base Java oci_image + labels: dictionary of labels for the image config + visibility: standard attribute + **kwargs: other args to pass to the resulting target + """ + deploy_jar_label = to_label(deploy_jar) + + jar_files_name = "_{name}_jar_files".format(name = name) + pkg_files( + name = jar_files_name, + srcs = [deploy_jar_label], + renames = { + deploy_jar_label: "app.jar", + }, + visibility = ["//visibility:private"], + **kwargs + ) + + layer_name = "_{name}_layer".format(name = name) + pkg_tar( + name = layer_name, + srcs = [":" + jar_files_name], + visibility = ["//visibility:private"], + **kwargs + ) + + oci_image( + name = name, + base = base, + tars = [":" + layer_name], + entrypoint = [ + "java", + "-jar", + "/app.jar", + ], + visibility = visibility, + labels = labels, + **kwargs + ) + +def container_push( + name, + image, + registry, + repository, + tag, + visibility = None, + **kwargs): + """Compatibility macro for container_push using rules_oci. + + For standard attributes, see + https://bazel.build/reference/be/common-definitions + + Args: + name: name of the resulting oci_push_rule target + image: label of oci_image to push + registry: container registry + repository: image repository + tag: image tag + visibility: standard attribute + **kwargs: other args to pass to the resulting target + """ + + # Handle "Make" variable substitution + gen_repositories_name = "_{name}_gen_repositories".format(name = name) + repositories_name = "_{name}_repositories.txt".format(name = name) + gen_tags_name = "_{name}_gen_tags".format(name = name) + tags_name = "_{name}_tags.txt".format(name = name) + expand_template( + name = gen_repositories_name, + template = Label("//build/rules_oci:repositories_tmpl.txt"), + out = repositories_name, + visibility = ["//visibility:private"], + substitutions = { + "{registry}": registry, + "{repository}": repository, + }, + **kwargs + ) + expand_template( + name = gen_tags_name, + template = Label("//build/rules_oci:tags_tmpl.txt"), + out = tags_name, + visibility = ["//visibility:private"], + substitutions = { + "{tag}": tag, + }, + **kwargs + ) + + oci_push_rule( + name = name, + image = image, + repository_file = ":" + repositories_name, + remote_tags = ":" + tags_name, + visibility = visibility, + **kwargs + ) diff --git a/build/rules_oci/repositories_tmpl.txt b/build/rules_oci/repositories_tmpl.txt new file mode 100644 index 000000000..e9070fbc6 --- /dev/null +++ b/build/rules_oci/repositories_tmpl.txt @@ -0,0 +1 @@ +{registry}/{repository} diff --git a/build/rules_oci/tags_tmpl.txt b/build/rules_oci/tags_tmpl.txt new file mode 100644 index 000000000..47101e8a1 --- /dev/null +++ b/build/rules_oci/tags_tmpl.txt @@ -0,0 +1 @@ +{tag} diff --git a/build/rules_pkg/BUILD.bazel b/build/rules_pkg/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/rules_pkg/repo.bzl b/build/rules_pkg/repo.bzl deleted file mode 100644 index c43ab2a66..000000000 --- a/build/rules_pkg/repo.bzl +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2022 The Cross-Media Measurement 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. - -"""Repository rules/macros for rules_pkg.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def rules_pkg(): - http_archive( - name = "rules_pkg", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", - "https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz", - ], - sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2", - ) diff --git a/build/rules_proto/BUILD.bazel b/build/rules_proto/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/rules_proto/repo.bzl b/build/rules_proto/repo.bzl deleted file mode 100644 index dedf425d8..000000000 --- a/build/rules_proto/repo.bzl +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2022 The Cross-Media Measurement 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. - -"""Repository rules/macros for rules_proto.""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("//build:versions.bzl", "PROTOBUF_JAVA_VERSION") - -_MAVEN_COORDINATES = [ - "com.google.protobuf:protobuf-java", - "com.google.protobuf:protobuf-java-util", -] - -EXCLUDED_ARTIFACTS = [ - # protobuf-java and protobuf-javalite cannot coexist. - "com.google.protobuf:protobuf-javalite", -] - -def rules_proto(): - maybe( - http_archive, - name = "rules_proto", - sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", - strip_prefix = "rules_proto-5.3.0-21.7", - urls = [ - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", - ], - ) - -def rules_proto_maven_artifacts_dict(): - return {coordinates: PROTOBUF_JAVA_VERSION for coordinates in _MAVEN_COORDINATES} diff --git a/build/tink/BUILD.bazel b/build/tink/BUILD.bazel deleted file mode 100644 index e69de29bb..000000000 diff --git a/build/tink/repo.bzl b/build/tink/repo.bzl deleted file mode 100644 index 2223e1e45..000000000 --- a/build/tink/repo.bzl +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2021 The Cross-Media Measurement 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. - -"""Repository targets for Tink (https://github.com/google/tink).""" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") -load("//build:versions.bzl", "TINK_COMMIT") - -_SHA256 = "0b8bbaffee4903faea66dbad76f8eb6d0eea3f94367807bebc49180f9f417031" -_URL = "https://github.com/google/tink/archive/{commit}.tar.gz".format(commit = TINK_COMMIT) - -# Dict of Maven artifacts for Tink Java KMS integration. -TINK_JAVA_KMS_MAVEN_DEPS = { - # Auto Service. - "com.google.auto:auto-common": "0.10", - "com.google.auto.service:auto-service": "1.0-rc7", - "com.google.auto.service:auto-service-annotations": "1.0-rc7", - - # Google Cloud KMS. - "com.google.apis:google-api-services-cloudkms": "v1-rev108-1.25.0", - - # AWS KMS. - "com.amazonaws:aws-java-sdk-core": "1.11.976", - "com.amazonaws:aws-java-sdk-kms": "1.11.976", -} - -def tink_java(): - _tink_base() - - # TODO(@SanjayVas): Depend on Maven artifact instead once everything - # we use from Tink is included in a Maven release. - maybe( - http_archive, - name = "tink_java", - url = _URL, - sha256 = _SHA256, - strip_prefix = "tink-{commit}/java_src".format(commit = TINK_COMMIT), - ) - -def _tink_base(): - maybe( - http_archive, - name = "tink_base", - url = _URL, - sha256 = _SHA256, - strip_prefix = "tink-{commit}".format(commit = TINK_COMMIT), - ) diff --git a/build/variables.bzl b/build/variables.bzl deleted file mode 100644 index 4fbda3ccf..000000000 --- a/build/variables.bzl +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2020 The Measurement System 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. - -""" -This file contains local settings for building and deploying the codebase. -It is in .gitignore; please don't commit your local changes. -""" - -# Settings for the repository where Docker images are stored. -# The image path is the container_registry, the prefix, and an -# image-specific suffix joined with slashes. -IMAGE_REPOSITORY_SETTINGS = struct( - # URL of the container registry. - container_registry = "", - - # Common prefix of all images. - repository_prefix = "", -) - -# Settings for deploying tests to Google Cloud. -TEST_GOOGLE_CLOUD_SETTINGS = struct( - spanner_project = "", - spanner_instance = "", - cloud_storage_project = "", - cloud_storage_bucket = "", -) diff --git a/build/versions.bzl b/build/versions.bzl index a34dd1ca7..e67dd131b 100644 --- a/build/versions.bzl +++ b/build/versions.bzl @@ -50,44 +50,6 @@ def versioned_http_archive(versioned_archive, name): urls = _format_url_templates(versioned_archive), ) -PROTOBUF = VersionedArchiveInfo( - version = "21.12", - sha256 = "22fdaf641b31655d4b2297f9981fa5203b2866f8332d3c6333f6b0107bb320de", - url_templates = [ - "https://github.com/protocolbuffers/protobuf/archive/v{version}.tar.gz", - ], - prefix_template = "protobuf-{version}", -) - -PROTOBUF_JAVA_VERSION = "3." + PROTOBUF.version -PROTOBUF_KOTLIN_VERSION = PROTOBUF_JAVA_VERSION - -GRPC_JAVA = VersionedArchiveInfo( - version = "1.52.1", - sha256 = "6bbe6dca6e60bb892fec8000ab2a200c474c4d9700f34e3fa205c84aaeaf33f7", - url_templates = [ - "https://github.com/grpc/grpc-java/archive/refs/tags/v{version}.tar.gz", - ], - prefix_template = "grpc-java-{version}", -) -GRPC_KOTLIN = VersionedArchiveInfo( - version = "1.3.0", - sha256 = "466d33303aac7e825822b402efa3dcfddd68e6f566ed79443634180bb75eab6e", - url_templates = [ - "https://github.com/grpc/grpc-kotlin/archive/refs/tags/v{version}.tar.gz", - ], - prefix_template = "grpc-kotlin-{version}", -) - -RULES_JVM_EXTERNAL = VersionedArchiveInfo( - version = "5.2", - sha256 = "f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f", - url_templates = [ - "https://github.com/bazelbuild/rules_jvm_external/releases/download/{version}/rules_jvm_external-{version}.tar.gz", - ], - prefix_template = "rules_jvm_external-{version}", -) - SPANNER_EMULATOR = VersionedArchiveInfo( version = "1.4.9", sha256 = "0716bf95e740328cdaef7a7e41e022037fde803596378a9db81b56bc0de1dcb9", @@ -104,29 +66,7 @@ RULES_DOCKER = VersionedArchiveInfo( ], ) -RULES_KOTLIN = VersionedArchiveInfo( - version = "1.8.1", - sha256 = "a630cda9fdb4f56cf2dc20a4bf873765c41cf00e9379e8d59cd07b24730f4fde", - url_templates = [ - "https://github.com/bazelbuild/rules_kotlin/releases/download/v{version}/rules_kotlin_release.tgz", - ], -) - -KOTLIN_LANGUAGE_LEVEL = "1.8" - -# Kotlin release version. -# -# See https://kotlinlang.org/docs/releases.html#release-details. -KOTLIN_RELEASE_VERSION = "1.8.21" - -# kotlinx.coroutines version. -KOTLINX_COROUTINES_VERSION = "1.7.3" - # Tink commit that is newer than v1.6.1. # # TODO: Use version once there's a release that contains AesSivBoringSsl. TINK_COMMIT = "0f65dc5d079fb3107c71908734a082079e98ae45" - -AWS_JAVA_SDK_VERSION = "2.17.258" - -OPENTELEMETRY_JAVA_VERSION = "1.32.0" diff --git a/imports/java/com/google/cloud/spanner/BUILD.bazel b/imports/java/com/google/cloud/spanner/BUILD.bazel index 7a5aa6ac9..f816cefb6 100644 --- a/imports/java/com/google/cloud/spanner/BUILD.bazel +++ b/imports/java/com/google/cloud/spanner/BUILD.bazel @@ -1,16 +1,6 @@ -load("@rules_java//java:defs.bzl", "java_library") - package(default_visibility = ["//visibility:public"]) -java_library( +alias( name = "spanner", - exports = [ - "@maven//:com_google_cloud_google_cloud_spanner", - - # Also export transitive deps com.google.api.core and com.google.api.gax - # to fix IntelliJ -- it doesn't pick up on these by itself. - "//imports/java/com/google/api/core", - "//imports/java/com/google/api/gax", - "//imports/java/com/google/cloud/grpc", - ], + actual = "@maven//:com_google_cloud_google_cloud_spanner", ) diff --git a/imports/java/com/google/crypto/tink/BUILD.bazel b/imports/java/com/google/crypto/tink/BUILD.bazel new file mode 100644 index 000000000..afd5b2bd1 --- /dev/null +++ b/imports/java/com/google/crypto/tink/BUILD.bazel @@ -0,0 +1,6 @@ +package(default_visibility = ["//visibility:public"]) + +alias( + name = "tink", + actual = "@maven//:com_google_crypto_tink_tink", +) diff --git a/imports/java/com/google/type/BUILD.bazel b/imports/java/com/google/type/BUILD.bazel index 6ea1b7b85..bf701da74 100644 --- a/imports/java/com/google/type/BUILD.bazel +++ b/imports/java/com/google/type/BUILD.bazel @@ -1,6 +1,23 @@ +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_proto_library") + package(default_visibility = ["//visibility:public"]) -alias( - name = "type_java_proto", - actual = "@com_google_googleapis//google/type:type_java_proto", +kt_jvm_proto_library( + name = "dayofweek_kt_jvm_proto", + deps = ["@com_google_googleapis//google/type:dayofweek_proto"], +) + +kt_jvm_proto_library( + name = "date_kt_jvm_proto", + deps = ["@com_google_googleapis//google/type:date_proto"], +) + +kt_jvm_proto_library( + name = "latlng_kt_jvm_proto", + deps = ["@com_google_googleapis//google/type:latlng_proto"], +) + +kt_jvm_proto_library( + name = "interval_kt_jvm_proto", + deps = ["@com_google_googleapis//google/type:interval_proto"], ) diff --git a/imports/java/io/grpc/BUILD.bazel b/imports/java/io/grpc/BUILD.bazel index 1b524685e..c3f0e2eb7 100644 --- a/imports/java/io/grpc/BUILD.bazel +++ b/imports/java/io/grpc/BUILD.bazel @@ -7,7 +7,7 @@ alias( alias( name = "api", - actual = "@maven//:io_grpc_grpc_api", + actual = "@wfa_rules_kotlin_jvm//imports/io/gprc:api", ) alias( diff --git a/imports/java/io/grpc/protobuf/BUILD.bazel b/imports/java/io/grpc/protobuf/BUILD.bazel index fa0abe2dd..2a1fccae0 100644 --- a/imports/java/io/grpc/protobuf/BUILD.bazel +++ b/imports/java/io/grpc/protobuf/BUILD.bazel @@ -2,5 +2,5 @@ package(default_visibility = ["//visibility:public"]) alias( name = "protobuf", - actual = "@maven//:io_grpc_grpc_protobuf", + actual = "@wfa_rules_kotlin_jvm//imports/io/gprc/protobuf", ) diff --git a/imports/java/io/grpc/stub/BUILD.bazel b/imports/java/io/grpc/stub/BUILD.bazel index dc5fee0b0..ce9085977 100644 --- a/imports/java/io/grpc/stub/BUILD.bazel +++ b/imports/java/io/grpc/stub/BUILD.bazel @@ -2,5 +2,5 @@ package(default_visibility = ["//visibility:public"]) alias( name = "stub", - actual = "@maven//:io_grpc_grpc_stub", + actual = "@wfa_rules_kotlin_jvm//imports/io/gprc/stub", ) diff --git a/imports/kotlin/com/google/protobuf/kotlin/BUILD.bazel b/imports/kotlin/com/google/protobuf/kotlin/BUILD.bazel index 88277f1e0..4d2b3f5d5 100644 --- a/imports/kotlin/com/google/protobuf/kotlin/BUILD.bazel +++ b/imports/kotlin/com/google/protobuf/kotlin/BUILD.bazel @@ -2,5 +2,5 @@ package(default_visibility = ["//visibility:public"]) alias( name = "kotlin", - actual = "@maven//:com_google_protobuf_protobuf_kotlin", + actual = "@wfa_rules_kotlin_jvm//imports/com/google/protobuf/kotlin", ) diff --git a/imports/kotlin/io/grpc/health/v1/BUILD.bazel b/imports/kotlin/io/grpc/health/v1/BUILD.bazel index 82ebd9bd7..40cf184c2 100644 --- a/imports/kotlin/io/grpc/health/v1/BUILD.bazel +++ b/imports/kotlin/io/grpc/health/v1/BUILD.bazel @@ -1,9 +1,11 @@ -load("@com_github_grpc_grpc_kotlin//:kt_jvm_grpc.bzl", "kt_jvm_grpc_library") +load( + "@wfa_rules_kotlin_jvm//kotlin:defs.bzl", + "kt_jvm_grpc_proto_library", +) package(default_visibility = ["//visibility:public"]) -kt_jvm_grpc_library( - name = "health_kt_jvm_grpc", - srcs = ["@io_grpc_grpc_proto//:health_proto"], - deps = ["@io_grpc_grpc_proto//:health_java_proto"], +kt_jvm_grpc_proto_library( + name = "health_kt_jvm_grpc_proto", + deps = ["@io_grpc_grpc_proto//:health_proto"], ) diff --git a/imports/kotlin/io/grpc/kotlin/BUILD.bazel b/imports/kotlin/io/grpc/kotlin/BUILD.bazel index bd5cee8fb..0209973e4 100644 --- a/imports/kotlin/io/grpc/kotlin/BUILD.bazel +++ b/imports/kotlin/io/grpc/kotlin/BUILD.bazel @@ -2,5 +2,5 @@ package(default_visibility = ["//visibility:public"]) alias( name = "stub", - actual = "@maven//:io_grpc_grpc_kotlin_stub", + actual = "@wfa_rules_kotlin_jvm//imports/io/gprc/kotlin:stub", ) diff --git a/imports/kotlin/kotlin/BUILD.bazel b/imports/kotlin/kotlin/BUILD.bazel index 971ef2125..9ac6c37de 100644 --- a/imports/kotlin/kotlin/BUILD.bazel +++ b/imports/kotlin/kotlin/BUILD.bazel @@ -2,5 +2,5 @@ package(default_visibility = ["//visibility:public"]) alias( name = "stdlib", - actual = "@maven//:org_jetbrains_kotlin_kotlin_stdlib", + actual = "@wfa_rules_kotlin_jvm//imports/kotlin:stdlib", ) diff --git a/imports/kotlin/kotlin/reflect/BUILD.bazel b/imports/kotlin/kotlin/reflect/BUILD.bazel index eb2c71997..06406c7f4 100644 --- a/imports/kotlin/kotlin/reflect/BUILD.bazel +++ b/imports/kotlin/kotlin/reflect/BUILD.bazel @@ -2,5 +2,5 @@ package(default_visibility = ["//visibility:public"]) alias( name = "reflect", - actual = "@maven//:org_jetbrains_kotlin_kotlin_reflect", + actual = "@wfa_rules_kotlin_jvm//imports/kotlin/reflect", ) diff --git a/imports/kotlin/kotlin/test/BUILD.bazel b/imports/kotlin/kotlin/test/BUILD.bazel index c4bddcf79..3d1834272 100644 --- a/imports/kotlin/kotlin/test/BUILD.bazel +++ b/imports/kotlin/kotlin/test/BUILD.bazel @@ -2,5 +2,5 @@ package(default_visibility = ["//visibility:public"]) alias( name = "test", - actual = "@maven//:org_jetbrains_kotlin_kotlin_test", + actual = "@wfa_rules_kotlin_jvm//imports/kotlin/test", ) diff --git a/imports/kotlin/kotlinx/coroutines/BUILD.bazel b/imports/kotlin/kotlinx/coroutines/BUILD.bazel index aef4323dd..ca333d27c 100644 --- a/imports/kotlin/kotlinx/coroutines/BUILD.bazel +++ b/imports/kotlin/kotlinx/coroutines/BUILD.bazel @@ -1,16 +1,6 @@ -load("@rules_java//java:defs.bzl", "java_library") - package(default_visibility = ["//visibility:public"]) -java_library( - name = "core", - exports = [ - "@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core", - "@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm", - ], -) - alias( - name = "jdk8", - actual = "@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_jdk8", + name = "core", + actual = "@wfa_rules_kotlin_jvm//imports/kotlinx/coroutines:core", ) diff --git a/src/main/kotlin/org/wfanet/measurement/aws/common/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/aws/common/BUILD.bazel index 25a6bd195..9d8de26b1 100644 --- a/src/main/kotlin/org/wfanet/measurement/aws/common/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/aws/common/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/aws/postgres/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/aws/postgres/BUILD.bazel index d4020e99a..27c8e892f 100644 --- a/src/main/kotlin/org/wfanet/measurement/aws/postgres/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/aws/postgres/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/aws/postgres/tools/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/aws/postgres/tools/BUILD.bazel index 96cdf47f9..73e25b6b4 100644 --- a/src/main/kotlin/org/wfanet/measurement/aws/postgres/tools/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/aws/postgres/tools/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel index 679bd9ace..7d4944236 100644 --- a/src/main/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) @@ -10,7 +10,6 @@ kt_jvm_library( "//imports/java/software/amazon/awssdk/services/s3", "//imports/kotlin/com/google/protobuf/kotlin", "//imports/kotlin/kotlinx/coroutines:core", - "//imports/kotlin/kotlinx/coroutines:jdk8", "//imports/kotlin/kotlinx/coroutines/reactive", "//src/main/kotlin/org/wfanet/measurement/aws/common:region_converter", "//src/main/kotlin/org/wfanet/measurement/common/crypto:hashing", diff --git a/src/main/kotlin/org/wfanet/measurement/common/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/BUILD.bazel index 54da33b1c..f8007ae59 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) @@ -11,11 +11,11 @@ kt_jvm_library( "//imports/java/com/google/gson", "//imports/java/com/google/protobuf", "//imports/java/com/google/protobuf/util", + "//imports/java/com/google/type:date_kt_jvm_proto", + "//imports/java/com/google/type:interval_kt_jvm_proto", "//imports/java/org/jetbrains/annotations", "//imports/java/picocli", "//imports/kotlin/com/google/protobuf/kotlin", "//imports/kotlin/kotlinx/coroutines:core", - "//src/main/proto/google/type:interval_kt_jvm_proto", - "@com_google_googleapis//google/type:type_java_proto", ], ) diff --git a/src/main/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel index 3c4f0c86e..a6bacb6ee 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/crypto/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/crypto/testing/BUILD.bazel index 1c08aad45..90829e476 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/crypto/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/crypto/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package( default_testonly = True, diff --git a/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel index d33fef7a7..78e623c8a 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) @@ -6,6 +6,7 @@ kt_jvm_library( name = "tink", srcs = glob(["*.kt"]), deps = [ + "//imports/java/com/google/crypto/tink", "//imports/java/com/google/protobuf", "//imports/java/org/jetbrains/annotations", "//imports/kotlin/kotlinx/coroutines:core", @@ -14,17 +15,5 @@ kt_jvm_library( "//src/main/kotlin/org/wfanet/measurement/common/crypto:key_storage", "//src/main/kotlin/org/wfanet/measurement/storage:client", "//src/main/kotlin/org/wfanet/measurement/storage:store", - "@tink_java//src/main/java/com/google/crypto/tink:aead", - "@tink_java//src/main/java/com/google/crypto/tink:binary_keyset_reader", - "@tink_java//src/main/java/com/google/crypto/tink:binary_keyset_writer", - "@tink_java//src/main/java/com/google/crypto/tink:cleartext_keyset_handle", - "@tink_java//src/main/java/com/google/crypto/tink:hybrid_decrypt", - "@tink_java//src/main/java/com/google/crypto/tink:hybrid_encrypt", - "@tink_java//src/main/java/com/google/crypto/tink:key_templates", - "@tink_java//src/main/java/com/google/crypto/tink:kms_clients", - "@tink_java//src/main/java/com/google/crypto/tink:registry_cluster", - "@tink_java//src/main/java/com/google/crypto/tink/hybrid:hybrid_config", - "@tink_java//src/main/java/com/google/crypto/tink/jwt:jwk_set_converter", - "@tink_java//src/main/java/com/google/crypto/tink/jwt:jwt_signature_config", ], ) diff --git a/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel index 8dccf59e8..46e0fcad7 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package( default_testonly = True, @@ -10,8 +10,6 @@ kt_jvm_library( srcs = glob(["*.kt"]), associates = ["//src/main/kotlin/org/wfanet/measurement/common/crypto/tink"], deps = [ - "@tink_java//src/main/java/com/google/crypto/tink:kms_client", - "@tink_java//src/main/java/com/google/crypto/tink:kms_clients", - "@tink_java//src/main/java/com/google/crypto/tink:registry_cluster", + "//imports/java/com/google/crypto/tink", ], ) diff --git a/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/BUILD.bazel index 4bf17bf3d..71c487a6f 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/tools/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/tools/BUILD.bazel index 591eb0954..d805f677f 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/tools/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/db/liquibase/tools/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/db/postgres/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/db/postgres/BUILD.bazel index 2aa5a1116..5f9cb8083 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/db/postgres/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/db/postgres/BUILD.bazel @@ -1,6 +1,6 @@ # Database specifics for Postgres. -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/db/postgres/tools/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/db/postgres/tools/BUILD.bazel index 79ac8be60..e4a169307 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/db/postgres/tools/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/db/postgres/tools/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/BUILD.bazel index e45ef5245..587114fb6 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel index 5d2589c25..7c35bd02e 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/testing/BUILD.bazel index 9c4f9fd87..2d87150bb 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package( default_testonly = True, diff --git a/src/main/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel index 1fe386189..a34e264fb 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel index 1f2494099..1909e010b 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/grpc/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/grpc/testing/BUILD.bazel index 1c3b22af1..292844ba3 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/grpc/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/grpc/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package( default_testonly = True, diff --git a/src/main/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel index fb27efd64..4961a57af 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/identity/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/identity/testing/BUILD.bazel index d2d789c24..be914fb0d 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/identity/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/identity/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/openid/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/openid/BUILD.bazel index 1156f803c..685ec1daa 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/openid/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/openid/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel index 71e786335..b76220b3d 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel index 5b4a0ef30..463a9109f 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) @@ -14,7 +14,6 @@ kt_jvm_library( "//imports/java/org/junit", "//imports/java/org/mockito", "//imports/kotlin/kotlinx/coroutines:core", - "//imports/kotlin/kotlinx/coroutines:jdk8", "//imports/kotlin/org/mockito/kotlin", "//src/main/kotlin/org/wfanet/measurement/common", "//src/main/kotlin/org/wfanet/measurement/common/grpc", diff --git a/src/main/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel index 79be835a0..e1de85142 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) @@ -8,6 +8,5 @@ kt_jvm_library( deps = [ "//imports/java/picocli", "//imports/kotlin/kotlinx/coroutines:core", - "//imports/kotlin/kotlinx/coroutines:jdk8", ], ) diff --git a/src/main/kotlin/org/wfanet/measurement/common/throttler/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/common/throttler/testing/BUILD.bazel index cfe0b8ee4..099372286 100644 --- a/src/main/kotlin/org/wfanet/measurement/common/throttler/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/common/throttler/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/common/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/common/BUILD.bazel index 58123ef7b..cb2db4d3e 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/common/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/common/BUILD.bazel @@ -1,6 +1,6 @@ # Common functionality for Google Cloud (gcloud) APIs. -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) @@ -11,7 +11,7 @@ kt_jvm_library( "//imports/java/com/google/api/core", "//imports/java/com/google/cloud:core", "//imports/java/com/google/protobuf", - "//imports/java/com/google/type:type_java_proto", + "//imports/java/com/google/type:date_kt_jvm_proto", "//imports/kotlin/kotlinx/coroutines:core", "//imports/kotlin/kotlinx/coroutines/guava", ], diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel index edda91e30..7edf32653 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel @@ -1,6 +1,6 @@ # Blob/object storage specifics for Google Cloud Storage (GCS). -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel index 4afac4dc5..87f2c0649 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/BUILD.bazel index 44439c3d5..82678eb64 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/BUILD.bazel @@ -1,6 +1,6 @@ # Database specifics for Postgres. -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/tools/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/tools/BUILD.bazel index 9e1177b7f..ee963230d 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/tools/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/postgres/tools/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel index cd8d79509..37f95f5fa 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel @@ -1,6 +1,6 @@ # Database specifics for Google Cloud Spanner. -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) @@ -21,7 +21,6 @@ kt_jvm_library( ":flags", "//imports/java/com/google/cloud/spanner", "//imports/kotlin/kotlinx/coroutines:core", - "//imports/kotlin/kotlinx/coroutines:jdk8", "//src/main/kotlin/org/wfanet/measurement/common", "//src/main/kotlin/org/wfanet/measurement/common/identity", "//src/main/kotlin/org/wfanet/measurement/gcloud/common", diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/BUILD.bazel index c85a89884..c0c5266fc 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package( default_testonly = True, diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/macros.bzl b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/macros.bzl index f81610da7..b9014b25f 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/macros.bzl +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/testing/macros.bzl @@ -14,7 +14,7 @@ """Macros for Spanner test targets.""" -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") def spanner_emulator_test(name, data = [], **kwargs): kt_jvm_test( diff --git a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/tools/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/tools/BUILD.bazel index 661b54bd2..e53707b70 100644 --- a/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/tools/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/gcloud/spanner/tools/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/storage/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/storage/BUILD.bazel index ba0589096..b1be28138 100644 --- a/src/main/kotlin/org/wfanet/measurement/storage/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/storage/BUILD.bazel @@ -1,6 +1,6 @@ # Blob/object storage. -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel index ea66d4b38..c7fa59273 100644 --- a/src/main/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel @@ -1,6 +1,6 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") load("@rules_java//java:defs.bzl", "java_binary") -load("@io_bazel_rules_docker//java:image.bzl", "java_image") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") +load("//build/rules_oci:defs.bzl", "java_image") package(default_visibility = ["//visibility:public"]) @@ -53,6 +53,5 @@ java_binary( java_image( name = "server_image", - main_class = "org.wfanet.measurement.storage.filesystem.FileSystemStorageServerKt", - runtime_deps = [":server"], + deploy_jar = ":FileSystemStorageServer_deploy.jar", ) diff --git a/src/main/kotlin/org/wfanet/measurement/storage/forwarded/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/storage/forwarded/BUILD.bazel index 6cbd7f19a..12d28fb6a 100644 --- a/src/main/kotlin/org/wfanet/measurement/storage/forwarded/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/storage/forwarded/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package(default_visibility = ["//visibility:public"]) diff --git a/src/main/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel b/src/main/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel index e7ace31d1..66aa4cdf6 100644 --- a/src/main/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel +++ b/src/main/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("//build/rules_kotlin:defs.bzl", "kt_jvm_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_library") package( default_testonly = True, diff --git a/src/main/proto/google/type/BUILD.bazel b/src/main/proto/google/type/BUILD.bazel deleted file mode 100644 index e241c3eed..000000000 --- a/src/main/proto/google/type/BUILD.bazel +++ /dev/null @@ -1,27 +0,0 @@ -load("//build/kt_jvm_proto:defs.bzl", "kt_jvm_proto_library") - -package(default_visibility = ["//visibility:public"]) - -kt_jvm_proto_library( - name = "dayofweek_kt_jvm_proto", - srcs = ["@com_google_googleapis//google/type:dayofweek_proto"], - deps = ["@com_google_googleapis//google/type:type_java_proto"], -) - -kt_jvm_proto_library( - name = "date_kt_jvm_proto", - srcs = ["@com_google_googleapis//google/type:date_proto"], - deps = ["@com_google_googleapis//google/type:type_java_proto"], -) - -kt_jvm_proto_library( - name = "latlng_kt_jvm_proto", - srcs = ["@com_google_googleapis//google/type:latlng_proto"], - deps = ["@com_google_googleapis//google/type:type_java_proto"], -) - -kt_jvm_proto_library( - name = "interval_kt_jvm_proto", - srcs = ["@com_google_googleapis//google/type:interval_proto"], - deps = ["@com_google_googleapis//google/type:type_java_proto"], -) diff --git a/src/main/proto/wfa/measurement/common/testing/BUILD.bazel b/src/main/proto/wfa/measurement/common/testing/BUILD.bazel index e6580ea94..16d4e6e62 100644 --- a/src/main/proto/wfa/measurement/common/testing/BUILD.bazel +++ b/src/main/proto/wfa/measurement/common/testing/BUILD.bazel @@ -1,6 +1,5 @@ load("@rules_proto//proto:defs.bzl", "proto_library") -load("@rules_java//java:defs.bzl", "java_proto_library") -load("@wfa_common_jvm//build/kt_jvm_proto:defs.bzl", "kt_jvm_proto_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_proto_library") package( default_testonly = True, @@ -15,6 +14,11 @@ proto_library( strip_import_prefix = IMPORT_PREFIX, ) +kt_jvm_proto_library( + name = "simple_kt_jvm_proto", + deps = [":simple_proto"], +) + proto_library( name = "depends_on_simple_proto", srcs = ["depends_on_simple.proto"], @@ -25,13 +29,7 @@ proto_library( ], ) -java_proto_library( - name = "depends_on_simple_java_proto", - deps = [":depends_on_simple_proto"], -) - kt_jvm_proto_library( name = "depends_on_simple_kt_jvm_proto", - srcs = [":depends_on_simple_proto"], - deps = [":depends_on_simple_java_proto"], + deps = [":depends_on_simple_proto"], ) diff --git a/src/main/proto/wfa/measurement/internal/testing/BUILD.bazel b/src/main/proto/wfa/measurement/internal/testing/BUILD.bazel index 2a7091de8..c183d8c6d 100644 --- a/src/main/proto/wfa/measurement/internal/testing/BUILD.bazel +++ b/src/main/proto/wfa/measurement/internal/testing/BUILD.bazel @@ -1,15 +1,14 @@ load("@rules_proto//proto:defs.bzl", "proto_library") -load("//build:macros.bzl", "kt_jvm_grpc_proto_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_grpc_proto_library") package(default_visibility = ["//visibility:public"]) proto_library( name = "forwarded_storage_service_proto", srcs = ["forwarded_storage_service.proto"], - strip_import_prefix = "/src/main/proto", ) kt_jvm_grpc_proto_library( name = "forwarded_storage_service_kt_jvm_grpc_proto", - srcs = [":forwarded_storage_service_proto"], + deps = [":forwarded_storage_service_proto"], ) diff --git a/src/main/proto/wfa/measurement/testing/riegeli/BUILD.bazel b/src/main/proto/wfa/measurement/testing/riegeli/BUILD.bazel index d2eb1b85a..83195b6f5 100644 --- a/src/main/proto/wfa/measurement/testing/riegeli/BUILD.bazel +++ b/src/main/proto/wfa/measurement/testing/riegeli/BUILD.bazel @@ -1,6 +1,6 @@ -load("//build/kt_jvm_proto:defs.bzl", "kt_jvm_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_proto_library") package( default_testonly = True, @@ -10,7 +10,6 @@ package( proto_library( name = "simple_message_proto", srcs = ["simple_message.proto"], - strip_import_prefix = "/src/main/proto", ) java_proto_library( @@ -20,6 +19,5 @@ java_proto_library( kt_jvm_proto_library( name = "simple_message_kt_jvm_proto", - srcs = [":simple_message_proto"], - deps = [":simple_message_java_proto"], + deps = [":simple_message_proto"], ) diff --git a/src/test/kotlin/org/wfanet/bazel/BUILD.bazel b/src/test/kotlin/org/wfanet/bazel/BUILD.bazel index afcac3f80..8592667ec 100644 --- a/src/test/kotlin/org/wfanet/bazel/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/bazel/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "KtJvmProtoLibraryTest", diff --git a/src/test/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel index 634b1258c..659a50870 100644 --- a/src/test/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/aws/s3/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "S3StorageClientTest", diff --git a/src/test/kotlin/org/wfanet/measurement/common/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/BUILD.bazel index 981b6ef14..05373ed58 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "BytesTest", @@ -90,9 +90,9 @@ kt_jvm_test( "//imports/java/com/google/common/truth", "//imports/java/com/google/common/truth/extensions/proto", "//imports/java/com/google/protobuf", + "//imports/java/com/google/type:date_kt_jvm_proto", "//imports/java/org/junit", "//src/main/kotlin/org/wfanet/measurement/common", - "@com_google_googleapis//google/type:type_java_proto", ], ) diff --git a/src/test/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel index 817ee9abd..d21194b27 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/crypto/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "HashingTest", diff --git a/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel index 8469c6072..fcc9de6b8 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "KeyHandleTest", @@ -19,11 +19,11 @@ kt_jvm_test( srcs = ["KmsStorageClientTest.kt"], deps = [ "//imports/java/com/google/common/truth", + "//imports/java/com/google/crypto/tink", "//imports/java/org/junit", "//src/main/kotlin/org/wfanet/measurement/common/crypto/tink", "//src/main/kotlin/org/wfanet/measurement/common/crypto/tink/testing", "//src/main/kotlin/org/wfanet/measurement/storage/testing", - "@tink_java//src/main/java/com/google/crypto/tink/aead:aead_config", ], ) diff --git a/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel index 8e2119687..491e89e18 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/crypto/tink/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") package(default_testonly = True) @@ -8,10 +8,10 @@ kt_jvm_test( test_class = "org.wfanet.measurement.common.crypto.tink.testing.FakeKmsClientTest", deps = [ "//imports/java/com/google/common/truth", + "//imports/java/com/google/crypto/tink", "//imports/java/org/junit", "//imports/kotlin/kotlin/test", "//src/main/kotlin/org/wfanet/measurement/common/crypto/tink/testing", - "@tink_java//src/main/java/com/google/crypto/tink:kms_clients", - "@tink_java//src/main/java/com/google/crypto/tink:kms_clients_test_util", + "@tink_java_src//:kms_clients_test_util", ], ) diff --git a/src/test/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel index 5b2b8b21c..911c6bac3 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "PostgresDatabaseClientTest", @@ -12,11 +12,11 @@ kt_jvm_test( ], deps = [ "//imports/java/com/google/common/truth", + "//imports/java/com/google/type:dayofweek_kt_jvm_proto", + "//imports/java/com/google/type:latlng_kt_jvm_proto", "//imports/java/org/junit", "//src/main/kotlin/org/wfanet/measurement/common", "//src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres", "//src/main/kotlin/org/wfanet/measurement/common/db/r2dbc/postgres/testing:database_provider", - "//src/main/proto/google/type:dayofweek_kt_jvm_proto", - "//src/main/proto/google/type:latlng_kt_jvm_proto", ], ) diff --git a/src/test/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel index c96b0f63d..3a6054177 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/graphviz/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "DotTest", diff --git a/src/test/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel index b7c4e7eba..7ec81d3ad 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/grpc/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "ChannelShutdownHookTest", @@ -32,7 +32,7 @@ kt_jvm_test( "//imports/java/io/grpc/testing", "//imports/java/io/netty/handler", "//imports/java/org/junit", - "//imports/kotlin/io/grpc/health/v1:health_kt_jvm_grpc", + "//imports/kotlin/io/grpc/health/v1:health_kt_jvm_grpc_proto", "//imports/kotlin/kotlin/test", "//imports/kotlin/kotlinx/coroutines:core", "//src/main/kotlin/org/wfanet/measurement/common/crypto:signing_certs", diff --git a/src/test/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel index aa78efdd4..afe6fefcc 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/identity/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "IdentifiersTest", diff --git a/src/test/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel index fc3f56964..09bc8f562 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/riegeli/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "RiegeliTest", diff --git a/src/test/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel index eff5570dd..c783205a6 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "TestClockWithNamedInstantsTest", diff --git a/src/test/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel index 94c3d9c5c..740c84a5f 100644 --- a/src/test/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/common/throttler/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "AdaptiveThrottlerTest", @@ -24,7 +24,6 @@ kt_jvm_test( "//imports/java/org/junit", "//imports/kotlin/kotlin/test", "//imports/kotlin/kotlinx/coroutines:core", - "//imports/kotlin/kotlinx/coroutines:jdk8", "//imports/kotlin/kotlinx/coroutines/test", "//src/main/kotlin/org/wfanet/measurement/common/throttler", ], diff --git a/src/test/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel index ff35d1142..0dc1be425 100644 --- a/src/test/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/gcloud/gcs/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "GcsStorageClientTest", diff --git a/src/test/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel index 498d6fe7c..68a9d2cb4 100644 --- a/src/test/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/gcloud/logging/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") package(default_testonly = True) diff --git a/src/test/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel index a1850abb5..43ac96c99 100644 --- a/src/test/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/gcloud/spanner/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "SpannerStructsTest", diff --git a/src/test/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel index d16ae62f7..d78f5ba84 100644 --- a/src/test/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/storage/filesystem/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "FileSystemStorageClientTest", diff --git a/src/test/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel b/src/test/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel index c3a3fc2a0..d21d443b7 100644 --- a/src/test/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel +++ b/src/test/kotlin/org/wfanet/measurement/storage/testing/BUILD.bazel @@ -1,4 +1,4 @@ -load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_test") +load("@wfa_rules_kotlin_jvm//kotlin:defs.bzl", "kt_jvm_test") kt_jvm_test( name = "InMemoryStorageClientTest", diff --git a/src/test/proto/wfa/measurement/common/BUILD.bazel b/src/test/proto/wfa/measurement/common/BUILD.bazel index 022630321..4de3d38b7 100644 --- a/src/test/proto/wfa/measurement/common/BUILD.bazel +++ b/src/test/proto/wfa/measurement/common/BUILD.bazel @@ -1,7 +1,10 @@ -load("//build/kt_jvm_proto:defs.bzl", "kt_jvm_proto_library") -load("//build:macros.bzl", "kt_jvm_grpc_proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@rules_proto//proto:defs.bzl", "proto_library") +load( + "@wfa_rules_kotlin_jvm//kotlin:defs.bzl", + "kt_jvm_grpc_proto_library", + "kt_jvm_proto_library", +) package( default_testonly = True, @@ -21,8 +24,7 @@ java_proto_library( kt_jvm_proto_library( name = "fake_message_kt_jvm_proto", - srcs = [":fake_message_proto"], - deps = [":fake_message_java_proto"], + deps = [":fake_message_proto"], ) proto_library( @@ -33,5 +35,5 @@ proto_library( kt_jvm_grpc_proto_library( name = "fake_service_kt_jvm_grpc_proto", - srcs = [":fake_service_proto"], + deps = [":fake_service_proto"], )