aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/protobuf
diff options
context:
space:
mode:
authorGravatar Carmi Grushko <carmi@google.com>2016-11-07 21:29:25 +0000
committerGravatar Klaus Aehlig <aehlig@google.com>2016-11-08 09:15:33 +0000
commitb36aefbfbc6ba87e2cb1469e919d13b68730c17d (patch)
tree169bc8dbc206e774e705096252ddc318b474d962 /third_party/protobuf
parent71ef85cff53aaa12ee3feb2b2fbc49c0d87fbab0 (diff)
*** Reason for rollback *** Use proto_lang_toolchain() in java_proto_library, after fixing breakage. Verified on Jenkins, http://ci.bazel.io/job/Gerrit-bazel-tests/169/ *** Original change description *** Automated [] rollback of commit a396b070ae36032a973672e11145533621c39edc. *** Reason for rollback *** Breaks tests on latest, as proto_lang_toolchain didn't make it into the 0.4.0 release see http://ci.bazel.io/job/bazel-tests/306/BAZEL_VERSION=latest,PLATFORM_NAME=linux-x86_64/console *** Original change description *** Use proto_lang_toolchain() in java_proto_library. -- MOS_MIGRATED_REVID=138432193
Diffstat (limited to 'third_party/protobuf')
-rw-r--r--third_party/protobuf/3.0.0/BUILD7
-rw-r--r--third_party/protobuf/3.0.0/proto_lang_toolchain_if_exists.bzl24
-rw-r--r--third_party/protobuf/BUILD2
3 files changed, 33 insertions, 0 deletions
diff --git a/third_party/protobuf/3.0.0/BUILD b/third_party/protobuf/3.0.0/BUILD
index 767ebd7306..0146f66727 100644
--- a/third_party/protobuf/3.0.0/BUILD
+++ b/third_party/protobuf/3.0.0/BUILD
@@ -3,6 +3,7 @@ package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load("//third_party/protobuf:protobuf.bzl", "py_proto_library")
+load(":proto_lang_toolchain_if_exists.bzl", "proto_lang_toolchain")
filegroup(
name = "srcs",
@@ -311,3 +312,9 @@ cc_library(
visibility = ["//visibility:public"],
deps = [":protobuf_clib"],
)
+
+proto_lang_toolchain(
+ name = "java_toolchain",
+ command_line = "--java_out=shared,immutable:$(OUT)",
+ runtime = ":protobuf",
+)
diff --git a/third_party/protobuf/3.0.0/proto_lang_toolchain_if_exists.bzl b/third_party/protobuf/3.0.0/proto_lang_toolchain_if_exists.bzl
new file mode 100644
index 0000000000..d0416f600d
--- /dev/null
+++ b/third_party/protobuf/3.0.0/proto_lang_toolchain_if_exists.bzl
@@ -0,0 +1,24 @@
+# Copyright 2016 The Bazel Authors. All rights reserved.
+#
+# 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.
+
+"""Calls proto_lang_toolchain(), but only if it's already been released."""
+
+# TODO(carmi): Delete this after proto_lang_toolchain() is released in Bazel.
+def proto_lang_toolchain(**kwargs):
+ """Calls proto_lang_toolchain(), but only if it's already been released."""
+ if hasattr(native, 'proto_lang_toolchain'):
+ native.proto_lang_toolchain(**kwargs)
+ else:
+ native.filegroup(name = kwargs['name'])
+
diff --git a/third_party/protobuf/BUILD b/third_party/protobuf/BUILD
index 0f39107b93..f6e1ea9fda 100644
--- a/third_party/protobuf/BUILD
+++ b/third_party/protobuf/BUILD
@@ -29,3 +29,5 @@ proto_alias("protobuf_lite", PROTOBUF_VERSION)
proto_alias("protobuf_clib", PROTOBUF_VERSION)
proto_alias("protoc_lib", PROTOBUF_VERSION)
+
+proto_alias("java_toolchain", PROTOBUF_VERSION)