diff --git a/modules/contrib_rules_jvm/0.25.0/MODULE.bazel b/modules/contrib_rules_jvm/0.25.0/MODULE.bazel new file mode 100644 index 00000000000..8ba202bf002 --- /dev/null +++ b/modules/contrib_rules_jvm/0.25.0/MODULE.bazel @@ -0,0 +1,256 @@ +module( + name = "contrib_rules_jvm", + version = "0.25.0", + repo_name = "contrib_rules_jvm", +) + +# TODO: This should be read from repositories.bzl, but we can't until this issue is solved: +# - https://github.com/bazelbuild/bazel/issues/17880 +PROTOBUF_VERSION = "21.7" + +# The java packages are published to maven under a different versioning scheme. +PROTOBUF_JAVA_VERSION = "3.{}".format(PROTOBUF_VERSION) + +bazel_dep( + name = "apple_rules_lint", + version = "0.3.2", +) +bazel_dep( + name = "bazel_skylib", + version = "1.4.2", +) + +bazel_dep( + name = "bazel_skylib_gazelle_plugin", + version = "1.4.2", + dev_dependency = True, +) + +bazel_dep( + name = "gazelle", + version = "0.34.0", + repo_name = "bazel_gazelle", +) +bazel_dep( + name = "protobuf", + version = PROTOBUF_VERSION, + repo_name = "com_google_protobuf", +) +bazel_dep( + name = "rules_cc", + version = "0.0.9", +) +bazel_dep( + name = "rules_go", + version = "0.43.0", + repo_name = "io_bazel_rules_go", +) +bazel_dep( + name = "rules_java", + version = "6.1.1", +) +bazel_dep( + name = "rules_jvm_external", + version = "6.0", +) +bazel_dep( + name = "rules_proto", + version = "5.3.0-{}".format(PROTOBUF_VERSION), +) + +bazel_dep( + name = "stardoc", + version = "0.5.6", + dev_dependency = True, + repo_name = "io_bazel_stardoc", +) + +non_module_deps = use_extension("//java/private:non-module-deps.bzl", "non_module_deps") +use_repo( + non_module_deps, + "io_grpc_grpc_java", +) + +linter = use_extension("@apple_rules_lint//lint:extensions.bzl", "linter") +linter.register(name = "java-checkstyle") +linter.configure( + name = "java-checkstyle", + config = "//java:checkstyle-default-config", +) +linter.register(name = "java-pmd") +linter.configure( + name = "java-pmd", + config = "//java:pmd-config", +) +linter.register(name = "java-spotbugs") +linter.configure( + name = "java-spotbugs", + config = "//java:spotbugs-default-config", +) +use_repo( + linter, + "apple_linters", +) + +maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") + +IO_GRPC_GRPC_JAVA_ARTIFACTS = [ + "com.google.android:annotations:4.1.1.4", + "com.google.api.grpc:proto-google-common-protos:2.9.0", + "com.google.auth:google-auth-library-credentials:0.22.0", + "com.google.auth:google-auth-library-oauth2-http:0.22.0", + "com.google.auto.value:auto-value-annotations:1.9", + "com.google.auto.value:auto-value:1.9", + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.code.gson:gson:2.9.0", + "com.google.errorprone:error_prone_annotations:2.11.0", + "com.google.guava:failureaccess:1.0.1", + "com.google.guava:guava:31.0.1-android", + "com.google.j2objc:j2objc-annotations:1.3", + "com.google.re2j:re2j:1.6", + "com.google.truth:truth:1.0.1", + "com.squareup.okhttp:okhttp:2.7.5", + "com.squareup.okio:okio:1.17.5", + "io.netty:netty-buffer:4.1.87.Final", + "io.netty:netty-codec-http2:4.1.87.Final", + "io.netty:netty-codec-http:4.1.87.Final", + "io.netty:netty-codec-socks:4.1.87.Final", + "io.netty:netty-codec:4.1.87.Final", + "io.netty:netty-common:4.1.87.Final", + "io.netty:netty-handler-proxy:4.1.87.Final", + "io.netty:netty-handler:4.1.87.Final", + "io.netty:netty-resolver:4.1.87.Final", + "io.netty:netty-tcnative-boringssl-static:2.0.56.Final", + "io.netty:netty-tcnative-classes:2.0.56.Final", + "io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.87.Final", + "io.netty:netty-transport-native-unix-common:4.1.87.Final", + "io.netty:netty-transport:4.1.87.Final", + "io.opencensus:opencensus-api:0.24.0", + "io.opencensus:opencensus-contrib-grpc-metrics:0.24.0", + "io.perfmark:perfmark-api:0.25.0", + "junit:junit:4.12", + "org.apache.tomcat:annotations-api:6.0.53", + "org.codehaus.mojo:animal-sniffer-annotations:1.21", +] + +maven.install( + name = "contrib_rules_jvm_deps", + artifacts = [ + "com.google.code.findbugs:jsr305:3.0.2", + "com.google.errorprone:error_prone_annotations:2.11.0", + "com.google.guava:guava:30.1.1-jre", + "commons-cli:commons-cli:1.5.0", + "io.grpc:grpc-api:1.40.0", + "io.grpc:grpc-core:1.40.0", + "io.grpc:grpc-netty:1.40.0", + "io.grpc:grpc-services:1.40.0", + "io.grpc:grpc-stub:1.40.0", + "org.slf4j:slf4j-simple:1.7.32", + "com.google.googlejavaformat:google-java-format:1.15.0", + + # These can be versioned independently of the versions in `repositories.bzl` + # so long as the version numbers are higher. + "org.junit.jupiter:junit-jupiter-engine:5.8.2", + "org.junit.jupiter:junit-jupiter-api:5.8.2", + "org.junit.platform:junit-platform-launcher:1.8.2", + "org.junit.platform:junit-platform-reporting:1.8.2", + "org.junit.vintage:junit-vintage-engine:5.8.2", + + # Open Test Alliance for the JVM dep + "org.opentest4j:opentest4j:1.2.0", + + # Checkstyle deps + "com.puppycrawl.tools:checkstyle:10.2", + + # PMD deps + "net.sourceforge.pmd:pmd-dist:6.46.0", + + # Spotbugs deps + "org.slf4j:slf4j-api:1.7.32", + "org.slf4j:slf4j-jdk14:1.7.32", + + # We explicitly declare a protobuf runtime version + # so that it coincides with the one we use to generate the code. + "com.google.protobuf:protobuf-java:{}".format(PROTOBUF_JAVA_VERSION), + ] + IO_GRPC_GRPC_JAVA_ARTIFACTS, + fail_if_repin_required = True, + generate_compat_repositories = True, + lock_file = "//:contrib_rules_jvm_deps_install.json", + strict_visibility = False, +) + +# Spotbugs deps +# We don't want to force people to use 1.8-beta +# but we can't use the `maven` macros because +# we've not loaded rules yet. Fortunately, the +# expansion is easy :) +maven.artifact( + name = "contrib_rules_jvm_deps", + artifact = "spotbugs", + exclusions = ["org.slf4j:slf4j-api"], + group = "com.github.spotbugs", + version = "4.7.0", +) +use_repo( + maven, + "com_google_api_grpc_proto_google_common_protos", + "com_google_code_findbugs_jsr305", + "com_google_errorprone_error_prone_annotations", + "com_google_guava_failureaccess", + "com_google_guava_guava", + "com_google_j2objc_j2objc_annotations", + "contrib_rules_jvm_deps", + "org_apache_tomcat_annotations_api", + "unpinned_contrib_rules_jvm_deps", +) + +dev_maven = use_extension( + "@rules_jvm_external//:extensions.bzl", + "maven", + dev_dependency = True, +) +dev_maven.install( + name = "contrib_rules_jvm_tests", + artifacts = [ + # These can be versioned independently of the versions in `repositories.bzl` + # so long as the version numbers are higher. + "org.junit.jupiter:junit-jupiter-engine:5.8.2", + "org.junit.jupiter:junit-jupiter-api:5.8.2", + "org.junit.jupiter:junit-jupiter-params:5.8.2", + "org.junit.platform:junit-platform-launcher:1.8.2", + "org.junit.platform:junit-platform-reporting:1.8.2", + "org.junit.platform:junit-platform-suite:1.8.2", + "org.junit.platform:junit-platform-suite-api:1.8.2", + "org.junit.platform:junit-platform-suite-engine:1.8.2", + "org.junit.vintage:junit-vintage-engine:5.8.2", + "org.mockito:mockito-core:4.8.1", + ], + fail_if_repin_required = True, + fetch_sources = True, +) +use_repo( + dev_maven, + "contrib_rules_jvm_tests", +) + +go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk") +go_sdk.download(version = "1.21.5") + +go_deps = use_extension("@bazel_gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//:go.mod") +use_repo( + go_deps, + "com_github_aristanetworks_goarista", + "com_github_bazelbuild_buildtools", + "com_github_google_btree", + "com_github_google_go_cmp", + "com_github_google_uuid", + "com_github_hashicorp_golang_lru", + "com_github_rs_zerolog", + "com_github_sergi_go_diff", + "com_github_stretchr_testify", + "net_starlark_go", + "org_golang_google_grpc", + "org_golang_x_tools", + "org_golang_x_tools_go_vcs", +) diff --git a/modules/contrib_rules_jvm/0.25.0/patches/module_dot_bazel_version.patch b/modules/contrib_rules_jvm/0.25.0/patches/module_dot_bazel_version.patch new file mode 100644 index 00000000000..5ceb5115d1a --- /dev/null +++ b/modules/contrib_rules_jvm/0.25.0/patches/module_dot_bazel_version.patch @@ -0,0 +1,12 @@ +=================================================================== +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -1,7 +1,7 @@ + module( + name = "contrib_rules_jvm", +- version = "0.18.0", ++ version = "0.25.0", + repo_name = "contrib_rules_jvm", + ) + + # TODO: This should be read from repositories.bzl, but we can't until this issue is solved: diff --git a/modules/contrib_rules_jvm/0.25.0/presubmit.yml b/modules/contrib_rules_jvm/0.25.0/presubmit.yml new file mode 100644 index 00000000000..5a79d1dc595 --- /dev/null +++ b/modules/contrib_rules_jvm/0.25.0/presubmit.yml @@ -0,0 +1,19 @@ +bcr_test_module: + module_path: "" + matrix: + platform: ["debian10", "macos", "ubuntu2004"] + tasks: + gazelle: + working_directory: "examples/gazelle" + name: "Gazelle" + platform: ${{ platform }} + run_targets: + - "//:gazelle" + test_targets: + - "//..." + tests_and_lints: + working_directory: "examples/tests_and_lints" + name: "Tests and lints" + platform: ${{ platform }} + test_targets: + - "//..." diff --git a/modules/contrib_rules_jvm/0.25.0/source.json b/modules/contrib_rules_jvm/0.25.0/source.json new file mode 100644 index 00000000000..a3f33ca57bc --- /dev/null +++ b/modules/contrib_rules_jvm/0.25.0/source.json @@ -0,0 +1,9 @@ +{ + "integrity": "sha256-xSWUPezvup0Eaz7z1ueKbbNfWALNOj49xIFqMjITqIU=", + "strip_prefix": "rules_jvm-0.25.0", + "url": "https://github.com/bazel-contrib/rules_jvm/releases/download/v0.25.0/rules_jvm-v0.25.0.tar.gz", + "patches": { + "module_dot_bazel_version.patch": "sha256-TYMSZS3RGO1Y7Cj17qOIJlcx2c0Y+2FEhrxgbsUQvt8=" + }, + "patch_strip": 1 +} diff --git a/modules/contrib_rules_jvm/metadata.json b/modules/contrib_rules_jvm/metadata.json index f1365cce369..15666c5fdee 100644 --- a/modules/contrib_rules_jvm/metadata.json +++ b/modules/contrib_rules_jvm/metadata.json @@ -26,7 +26,8 @@ "0.21.4", "0.22.0", "0.23.0", - "0.24.0" + "0.24.0", + "0.25.0" ], "yanked_versions": {} }