Commit Graph

24 Commits

Author SHA1 Message Date
Steven Parkes
ea1886661e pass correct args to protoc for java wellknown protos when used as an external repository 2016-03-10 15:04:46 -08:00
David Z. Chen
985c968443 Remove hack for building Python support with Bazel.
This change makes use of new imports attribute for Bazel's Python rules, which
enable adding directories to the PYTHONPATH. This allows us to remove
the hack for building protobuf's Python support with Bazel and now
allows projects to include protobuf using a Bazel external repository
rather than requiring it to be imported directly into the source tree as
//google/protobuf.

This change also updates the protobuf BUILD file to use a named
repository, @python//, for including Python headers rather than
//util/python. This allows projects to specify their own package for
Python headers when including protobuf with an external repository.

Fixes #1230
2016-02-25 12:52:21 -08:00
Manjunath Kudlur
f5c736352e Fixed grpc C++ plugin support.
grpc C++ plugin generates additional files, namely .grpc.pb.cc and
.grpc.pb.h. Adding these files to the outs of the _proto_gen rule, so
dependents don't complain about undeclared inclusions. Also, compiling
the .grpc.pb.cc requires additional header files from the grpc library,
so added //external:grpc_lib to the deps of the
cc_library. Clients are expected to declare that in their bazel
WORKSPACE, pointing it to @grpc//:grpc++{_unsecure}.
2016-02-25 08:50:50 -08:00
Manjunath Kudlur
f0966a746e Added grpc plugin support to cc_proto_library.
cc_proto_library now supports use_grpc_plugin flag that passes
--plugin=protoc-gen-grpc=grpc_cpp_plugin to protoc compiler
invocation. grpc_cpp_plugin is assumed to be present as
//external:grpc_cpp_plugin, so clients can setup their WORKSPACE files
appropriately to point to grpc location using bind.
2016-02-22 14:30:43 -08:00
Damien Martin-Guillerez
76547e5190 Make protobuf Skylark extension appends the workspace root
This change make protobuf skylark extension works when using
remote repository.

Note that this make the Skylark extension unusable prior
to Bazel 0.1.4 because the workspace_root is not available
on prior version.

Tested with Bazel 0.1.4rc2.

Fixes https://github.com/bazelbuild/bazel/issues/784.
2016-01-15 23:12:09 +01:00
Martin Maly
8e0c9a3f11 Making _genproto rules public.
This enables other xx_proto_library targets to depend on xx_proto_library
targets in different packages, and specifically on xx_wkt_protos.
2015-12-04 17:53:07 -08:00
Andrew Harp
38f131fd8c Build protoc for host platform to enable cross-compilation.
This is necessary to run protoc on the host as a dependency for Android BUILD targets with Bazel.
2015-11-03 16:39:32 -05:00
Jisi Liu
d4bef7d41b add warning notes for cc|py_proto_library rules.
To mention that the interface may change or be removed when bazel has
support it natively.
2015-11-02 12:24:32 -08:00
Jisi Liu
be92ffbf74 add default_runtime attribute to cc|py rules.
This adds implicit dependencies to the coressponding runtime libraries.
2015-10-27 15:11:38 -07:00
Jisi Liu
6ddcae225c Use && for internal_copied_filegroup.
So that the rule fails if one or more files cannot be copied.
2015-10-21 10:48:33 -07:00
Jisi Liu
bc4fd15209 Rename copeid_src to internal_copied_filegroup 2015-10-20 16:02:58 -07:00
Jisi Liu
a33fa8eddc fix sources for python target and add needed dependencies. 2015-10-20 15:30:44 -07:00
Jisi Liu
53a56be4c4 Change the impl rule include to includes.
We need to use the list to indicate field presense.
The field must only contain 0 or 1 string element.
2015-10-20 15:18:20 -07:00
Jisi Liu
04658a3c24 Change default value of protoc on xx_proto_library rules. 2015-10-20 15:00:13 -07:00
Jisi Liu
7b948cc7c5 Support python for bazel. 2015-10-19 17:56:27 -07:00
Jisi Liu
993fb7013e Python bazel support. 2015-10-19 17:19:49 -07:00
Jisi Liu
6dac0822c4 Allow include to be None.
This enables the use case where all the paths are relative to the
workspace root, e.g.

foo/bar/BUILD
       /foo.proto -- package foo.bar

would generate the message correctly.
2015-10-19 14:41:00 -07:00
Jisi Liu
3101e7337c Change prefix to include, and add docs 2015-10-16 12:46:26 -07:00
Jisi Liu
d8701b5741 Rename deps/proto_deps to cc_libs/deps 2015-10-16 11:44:21 -07:00
Jisi Liu
9c7d9c0925 style/naming fix 2015-10-15 10:51:32 -07:00
Jisi Liu
25d75b5665 make cc_out and py_out internal. 2015-10-14 17:41:14 -07:00
Jisi Liu
125a91be08 Format code. 2015-10-14 17:37:39 -07:00
Jisi Liu
ee8131a62f buildifier the file 2015-10-14 17:20:05 -07:00
Jisi Liu
39362b35b2 Extract protoc action into .bzl for cc.
This is needed to support python bazel build.
2015-10-14 17:12:11 -07:00