aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/objc
diff options
context:
space:
mode:
authorGravatar Sergio Campama <kaipi@google.com>2016-05-24 21:10:27 +0000
committerGravatar Yue Gan <yueg@google.com>2016-05-25 08:35:36 +0000
commitf945a0c70f46588ce1203d39824377f5c399358e (patch)
tree13fe9d1626787d8850fc66c5a994e7690f90952a /tools/objc
parent1164a4f9db8d2b66d005bfa340ed76fd5f89fb00 (diff)
Support for gathering all the protos seen in the transitive closure of dependencies through the ObjcProtoAspect, compiling and linking the generated protos at the final linking target. This is only enabled for objc_proto_libraries using the portable_proto_filters attribute, and guarded with the "--experimental_auto_top_level_union_objc_protos" flag. This prevents duplicate symbol errors as the generated sources are only linked once.
-- MOS_MIGRATED_REVID=123144532
Diffstat (limited to 'tools/objc')
-rw-r--r--tools/objc/BUILD20
-rw-r--r--tools/objc/dummy.proto21
-rw-r--r--tools/objc/protobuf_compiler.py22
-rw-r--r--tools/objc/protobuf_support7
4 files changed, 70 insertions, 0 deletions
diff --git a/tools/objc/BUILD b/tools/objc/BUILD
index 149a9bb4ff..89c53c5bc4 100644
--- a/tools/objc/BUILD
+++ b/tools/objc/BUILD
@@ -138,3 +138,23 @@ objc_library(
"objc_dummy.mm",
],
)
+
+filegroup(
+ name = "protobuf_compiler",
+ srcs = ["protobuf_compiler.py"],
+)
+
+objc_library(
+ name = "objc_protobuf_lib",
+ deps = [":dummy_lib"],
+)
+
+filegroup(
+ name = "protobuf_compiler_support",
+ srcs = ["protobuf_support"],
+)
+
+filegroup(
+ name = "protobuf_well_known_types",
+ srcs = ["dummy.proto"],
+)
diff --git a/tools/objc/dummy.proto b/tools/objc/dummy.proto
new file mode 100644
index 0000000000..16c4ffb1eb
--- /dev/null
+++ b/tools/objc/dummy.proto
@@ -0,0 +1,21 @@
+// 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.
+
+syntax = "proto2";
+
+package third_party.bazel.tools.objc;
+
+message Dummy {
+ optional string dummy = 1;
+}
diff --git a/tools/objc/protobuf_compiler.py b/tools/objc/protobuf_compiler.py
new file mode 100644
index 0000000000..bd789b7ddd
--- /dev/null
+++ b/tools/objc/protobuf_compiler.py
@@ -0,0 +1,22 @@
+# pylint: disable=g-bad-file-header
+# 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.
+
+"""Dummy python executable."""
+
+import sys
+
+if __name__ == '__main__':
+ print 'Bazel does not yet support protobuf compiling.'
+ sys.exit(1)
diff --git a/tools/objc/protobuf_support b/tools/objc/protobuf_support
new file mode 100644
index 0000000000..d65fe0b31a
--- /dev/null
+++ b/tools/objc/protobuf_support
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+(
+ printf 'Bazel does not yet support protobuf compiling.\n'
+) >&2
+
+exit 1