Skip to content

Commit

Permalink
Update protobuf_version.bzl to separate protoc and per-language java …
Browse files Browse the repository at this point in the history
…major version (#9900)
  • Loading branch information
zhangskz authored May 3, 2022
1 parent cdc11c2 commit b37b613
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions java/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@rules_jvm_external//:defs.bzl", "java_export")
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
load("//:internal.bzl", "conformance_test")
load("//:protobuf_version.bzl", "PROTOBUF_VERSION")
load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
load("//java/internal:testing.bzl", "junit_tests")

LITE_SRCS = [
Expand Down Expand Up @@ -116,7 +116,7 @@ java_library(
# Bazel users, don't depend on this target, use //java/lite.
java_export(
name = "lite_mvn",
maven_coordinates = "com.google.protobuf:protobuf-javalite:%s" % PROTOBUF_VERSION,
maven_coordinates = "com.google.protobuf:protobuf-javalite:%s" % PROTOBUF_JAVA_VERSION,
pom_template = "//java/lite:pom_template.xml",
resources = [
"//:lite_well_known_protos",
Expand Down Expand Up @@ -151,7 +151,7 @@ java_library(
# Bazel users, don't depend on this target, use :core.
java_export(
name = "core_mvn",
maven_coordinates = "com.google.protobuf:protobuf-java:%s" % PROTOBUF_VERSION,
maven_coordinates = "com.google.protobuf:protobuf-java:%s" % PROTOBUF_JAVA_VERSION,
pom_template = "pom_template.xml",
resources = [
"//:well_known_protos",
Expand Down
4 changes: 2 additions & 2 deletions java/kotlin-lite/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@rules_java//java:defs.bzl", "java_lite_proto_library")
load("@rules_jvm_external//:kt_defs.bzl", "kt_jvm_export")
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("//:protobuf_version.bzl", "PROTOBUF_VERSION")
load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
load("//:protobuf.bzl", "internal_gen_kt_protos")

java_lite_proto_library(
Expand Down Expand Up @@ -34,7 +34,7 @@ kt_jvm_export(
"@com_github_jetbrains_kotlin//:kotlin-stdlib",
"//java/lite",
],
maven_coordinates = "com.google.protobuf:protobuf-kotlin-lite:%s" % PROTOBUF_VERSION,
maven_coordinates = "com.google.protobuf:protobuf-kotlin-lite:%s" % PROTOBUF_JAVA_VERSION,
pom_template = "//java/kotlin-lite:pom_template.xml",
resources = ["//:well_known_protos"],
runtime_deps = [
Expand Down
4 changes: 2 additions & 2 deletions java/kotlin/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ load("@rules_java//java:defs.bzl", "java_proto_library")
load("@rules_jvm_external//:kt_defs.bzl", "kt_jvm_export")
load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//:protobuf_version.bzl", "PROTOBUF_VERSION")
load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
load("//:protobuf.bzl", "internal_gen_kt_protos")

exports_files([
Expand Down Expand Up @@ -56,7 +56,7 @@ kt_jvm_export(
"@com_github_jetbrains_kotlin//:kotlin-stdlib",
"//java/core",
],
maven_coordinates = "com.google.protobuf:protobuf-kotlin:%s" % PROTOBUF_VERSION,
maven_coordinates = "com.google.protobuf:protobuf-kotlin:%s" % PROTOBUF_JAVA_VERSION,
pom_template = "//java/kotlin:pom_template.xml",
resources = ["//:well_known_protos"],
runtime_deps = [
Expand Down
4 changes: 2 additions & 2 deletions java/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load("@rules_java//java:defs.bzl", "java_proto_library")
load("@rules_jvm_external//:defs.bzl", "java_export")
load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("//:protobuf_version.bzl", "PROTOBUF_VERSION")
load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
load("//java/internal:testing.bzl", "junit_tests")

java_library(
Expand All @@ -25,7 +25,7 @@ java_library(
java_export(
name = "util_mvn",
deploy_env = ["//java/core"],
maven_coordinates = "com.google.protobuf:protobuf-java-util:%s" % PROTOBUF_VERSION,
maven_coordinates = "com.google.protobuf:protobuf-java-util:%s" % PROTOBUF_JAVA_VERSION,
pom_template = "pom_template.xml",
visibility = ["//java:__pkg__"],
runtime_deps = [":util"],
Expand Down
4 changes: 2 additions & 2 deletions protobuf_release.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Generates package naming variables for use with rules_pkg.

load("@rules_pkg//:providers.bzl", "PackageVariablesInfo")
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
load(":protobuf_version.bzl", "PROTOBUF_VERSION")
load(":protobuf_version.bzl", "PROTOC_VERSION")

def _package_naming_impl(ctx):
values = {}
values["version"] = PROTOBUF_VERSION
values["version"] = PROTOC_VERSION

# infer from the current cpp toolchain.
toolchain = find_cpp_toolchain(ctx)
Expand Down
3 changes: 2 additions & 1 deletion protobuf_version.bzl
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PROTOBUF_VERSION = '3.20.1'
PROTOC_VERSION = '3.20.1'
PROTOBUF_JAVA_VERSION = '3.20.1'

0 comments on commit b37b613

Please sign in to comment.