Commit Graph

188 Commits

Author SHA1 Message Date
Feng Xiao
6945203300 Exclude addressbook.proto from C# boostrap test.
This addressbook.proto now belongs to its own bazel pacakge and can't be
accessed in bazel protobuf_test target.
2017-09-11 17:00:11 -07:00
Jakob Buchgraber
699c0eb9cf bazel: Add proto_library rules for well known types. Fixes #2763
Adds a proto_library rule for each well known type proto:

$ bazel query "filter(\".*_proto$\", \"...\")"
//:wrappers_proto
//:timestamp_proto
//:struct_proto
//:field_mask_proto
//:empty_proto
//:duration_proto
//:compiler_plugin_proto
//:descriptor_proto
//:api_proto
//:type_proto
//:source_context_proto
//:any_proto

Bazel users can reference these proto_library rules for their own
language specific rules i.e.

java_proto_library(
  name = "any_java_proto",
  deps = ["@com_google_protobuf//:any_proto"],
)

Also set the workspace name to "com_google_protobuf", as proto_library
rules reference protobuf that way.
2017-09-05 22:33:54 +02:00
Jisi Liu
12c186f7c6 Fix makefile.am 2017-07-25 14:38:00 -07:00
Jisi Liu
e177739fa2 Fix build files 2017-07-25 14:37:19 -07:00
Jisi Liu
759245a49a Merge from master 2017-07-25 11:52:33 -07:00
Jisi Liu
11b6661e66 update build file list 2017-07-19 12:10:43 -07:00
Jakob Buchgraber
36e63da632 bazel: Make compiled jars java 6 binary compatible.
See: https://github.com/bazelbuild/bazel/issues/3198
2017-06-16 12:50:35 +02:00
Yun Peng
0b059a3d8a Refactor cc options in BUILD file for Windows
Don't put gcc warnings options in copts, so that protobuf is able to
build by MSVC toolchain without python wrappers.
2017-05-31 14:01:30 +02:00
Adam Cozzette
2f4489a3e5 Merge pull request #3024 from acozzette/merge-3.3-to-master
Merged 3.3.x branch to master
2017-05-01 10:58:38 -07:00
makdharma
286f059842 added "objectivec" build target (#3033)
This target will be used by gRPC iOS bazel build system.
2017-05-01 09:49:26 -07:00
Feng Xiao
acde1651b5 Update BUILD file for C# tests. 2017-03-29 15:14:18 -07:00
Feng Xiao
32d7830e4b Fix C++ build for down-integration. 2017-03-29 14:52:33 -07:00
cgrushko
6f21e29268 Compile the Java proto runtime with Java 6
in order to avoid errors related to generics when 
building user code in newer versions of Java.
2017-03-22 14:27:51 -04:00
Bairen Yi
312e2dbcfb Update BUILD 2017-03-21 03:52:37 +08:00
Byron Yi
cb3e84b78e migrate delimited messages functions to util package 2017-03-16 20:01:22 +08:00
Adam Michael
6044b24cfc Make //:protobuf_python have correct __init__.py.
Previously //:protobuf_python set no __init__.py so Bazel created an
empty one. This change makes it use the __init__.py from the repository.
2017-03-10 18:06:34 -05:00
Feng Xiao
0c0a8879c3 Merge pull request #2751 from keveman/master
Added a header only cc_library target for the protobuf library.
2017-03-06 10:41:19 -08:00
Manjunath Kudlur
6837b2dcb7 Added comment explaining the protobuf_headers target. 2017-03-02 18:02:05 -08:00
Jisi Liu
72b82e6875 Merge pull request #2630 from blodan/master
FreeBSD compatibility
2017-02-24 12:52:53 -08:00
Manjunath Kudlur
2d430f8c72 Added a header only cc_library target for the protobuf library. 2017-02-23 08:17:24 -08:00
cgrushko
65a4d20deb Update load() statement to latest style
The first argument is currently implicitly a .bzl file.
Change this to be explicit.
2017-02-08 15:23:57 -05:00
Daniel Ylitalo
32fa55e666 FreeBSD compatibility 2017-01-25 22:04:11 +01:00
cgrushko
e4baf3f58a Add a proto_lang_toolchain for Java
This allows easy use of Bazel's java_proto_library native rule.
2017-01-12 12:51:04 -05:00
Adam Cozzette
d1e7bd9842 Added Bazel genrule for generating well_known_types_embed.cc
In pull request #2517 I made this change for the CMake and autotools
builds but forgot to do it for the Bazel build.
2016-12-20 09:08:19 -08:00
Jisi Liu
f92b455aa6 Add missing files. 2016-12-05 10:16:47 -08:00
cgrushko
45d92aea27 Add a proto_lang_toolchain() for cc_proto_library
Bazel's built-in cc_proto_library rule uses a proto_lang_toolchain to learn how to invoke proto-compiler.
To use Bazel's cc_proto_library, add the following to your project's WORKSPACE file:

local_repository(
  name = "com_google_protobuf_cc",
  path = "/path/to/protobuf-distribution/"
)
2016-12-02 19:40:50 -05:00
Richard Shin
df5841f0b2 Place Python extensions correctly in Bazel build. 2016-10-18 13:17:27 -07:00
Jisi Liu
9d4657a9e2 update files to include php generators 2016-10-10 11:43:48 -07:00
Andy Hochhaus
b2b65842ea Silence compile warnings in bazel 2016-10-09 08:36:01 -07:00
Feng Xiao
431cee60e6 Remove inexist files from build. 2016-10-06 16:36:45 -07:00
Jisi Liu
d947308aa1 update files to include php generators (#2165) 2016-10-06 11:49:47 -07:00
Piotr Sikora
faea19c359 Bazel: export LICENSE file.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-08-04 15:32:14 -07:00
David Z. Chen
02cd45ca35 Bazel build: Keep generated sources and Python runtime in the same directory.
Users often encounter a Python import error when trying to build Python
protos if protobuf is installed locally on the machine. In this case,
Python ends up looking in the wrong directory when importing files (see
bazelbuild/bazel#1209 and tensorflow/tensorflow#2021). It seems that the
problem is caused by Python getting confused when there are Python
source files that are meant to be part of the same package but are
in separate directories.

Prior to #1233, the Bazel build setup would copy the Python
runtime sources and all generated sources for the builtin protos into
the root directory (assuming that the protobuf tree is vendored in a
google/protobuf directory).

With #1233, the two sets of sources are kept in their respective
directories but both `src/` and `python/` are added to the `PYTHONPATH`
using the new `imports` attribute of the Bazel Python rules. However,
both the runtime sources and the generated sources are under the same
package: `google.protobuf`, causing Python to become confused when
trying to import modules that are in the other directory.

This patch adds a workaround to the Bazel build to add a modified
version of the original `internal_copied_filegroup` macro to copy the
`.proto` files under `src/` to `python/` before building the
`py_proto_library` targets for the builtin protos. This ensures that the
generated sources for the builtin protos will be in the same directory
as the corresponding runtime sources.

This patch was tested with the following:
* All Python tests in protobuf
* All Python tests in tensorflow
* All tests in [Skydoc](https://github.com/bazelbuild/skydoc)
* Importing protobuf as `//google/protobuf`
* Importing and binding targets under `//external`
* Importing protobuf as `//third_party/protobuf`
2016-05-25 18:02:09 -07:00
Jisi Liu
f86d39c295 Update file lists. 2016-04-28 14:43:22 -07:00
Feng Xiao
0ad204845f Merge pull request #1416 from cwhipkey/master
Change protobuf CPP proto generator to support the 'lite' option in
2016-04-20 17:15:16 -07:00
Feng Xiao
83a7a5e885 Merge pull request #1402 from davidzchen/py2and3
Add missing PY2AND3 srcs_versions attributes to Python Bazel build targets
2016-04-19 10:01:29 -07:00
Jisi Liu
1f4f3e26bd Update file list to include the missing extension lite file. 2016-04-18 14:12:08 -07:00
Chad Whipkey
baf52bd79e Change protobuf CPP proto generator to support the 'lite' option in
proto3.

Added a couple unit test proto3 files, for arena_lite and lite. Cloned
the proto3_arena_unittest to test some of the basics of generated code
(and to ensure that the generated proto3 test files are used by some
test).
2016-04-15 09:23:50 -07:00
David Z. Chen
5ebeefb94c Add missing PY2AND3 srcs_versions attributes to Python Bazel build targets. 2016-04-08 13:30:13 -07:00
Andrew Harp
3b4e7dcf29 Update BUILD 2016-04-04 16:13:31 -04:00
Andrew Harp
b56b461e49 Do not link in pthread library for Android builds.
This is required to allow Tensorflow to build on Android without hacks. Currently we create a dummy pthread library just to satisfy this dependency for a library that does not exist on Android. See https://github.com/google/protobuf/issues/1373 for more context.
2016-04-04 15:13:30 -04:00
Steven Parkes
d5a573274d export well known protos 2016-03-22 17:56:07 -07:00
Feng Xiao
ca3dc15d4c Merge pull request #1318 from smparkes/smparkes/grpc
add java/util support based on java/util/pom.xml
2016-03-14 14:57:33 -07:00
Jisi Liu
9aea0ef0cd Merge pull request #1312 from petewarden/master
Bazel iOS build settings
2016-03-12 15:15:03 -08:00
Steven Parkes
a9244ca0df add java/util support based on java/util/pom.xml 2016-03-11 18:08:09 -08:00
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
Pete Warden
bc2d6c2504 Merge remote-tracking branch 'upstream/master' 2016-03-09 13:05:15 -08:00
Pete Warden
f0c1a86372 Added iOS settings to Bazel build 2016-03-09 13:03:52 -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
Pete Warden
cb39204af8 Updated library generation with iOS options 2016-02-23 10:18:32 -08:00
Manjunath Kudlur
99a3e30bd7 Added PROTOBUF_PYTHON_ALLOW_OVERSIZE_PROTOS macro and setting it when
--allow_oversize_protos=true is passed to bazel build.
When this macro is set, SetTotalBytesLimit is called to remove
the 64MB limit on binary protos when during ParseFromString.
2016-02-16 15:17:10 -08:00
Ming Zhao
4fe03816b1 Fix bazel BUILD for Java. 2016-01-21 23:08:33 -08:00
Feng Xiao
ef6c72b46b Update BUILD/cmake files.
Change-Id: I6fa9f1b65d6c06b891aabf3f3d868364d74d727d
2015-12-28 17:33:55 -08:00
Manjunath Kudlur
d03ef20039 Made targets relative to google/protobuf
Fixes #1029
2015-12-08 10:46:26 -08:00
Manjunath Kudlur
a194921527 Made building the python extension configurable via --define=use_fast_cpp_protos=true 2015-12-08 08:24:37 -08:00
Manjunath Kudlur
3ff1dca0bd Enable fast cpp protos in the python interface. 2015-12-07 13:08:21 -08:00
Geoffrey Irving
29799238c2 Add srcs_version = "PY2AND3" in BUILD files
The sources themselves appear to already be Python 3 clean.
2015-12-03 13:16:06 -08:00
Jan Tattermusch
562372e53a Merge pull request #989 from jskeet/rename-umbrella
Rename "umbrella" to "reflection" consistently.
2015-11-19 16:31:19 -08:00
Jisi Liu
fa8e2911bb Merge pull request #977 from lberki/master
add headers
2015-11-19 14:39:54 -08:00
Jon Skeet
a6361a124a Rename "umbrella" to "reflection" consistently.
This changes csharp_names.h, which will require a corresponding change in GRPC.
2015-11-19 13:05:17 +00:00
Jisi Liu
6a40bf89d3 Make the cc wkt proto target public. 2015-11-17 12:37:56 -08:00
Lukacs T. Berki
915d9cd245 add headers 2015-11-16 09:36:32 +01: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
e1f60f5043 Update comments. 2015-10-22 13:55:37 -07:00
Jisi Liu
fbc51b7018 Add six as an external dep. 2015-10-22 13:38:17 -07:00
Jisi Liu
68e13f40f4 Enable python tests with testdata. 2015-10-22 11:13:14 -07:00
Jisi Liu
598480df11 Add runfiles to make the protobuf_test pass. 2015-10-21 11:19:16 -07:00
Jisi Liu
166e9bbb84 Rename python and java bazel rules. 2015-10-21 10:56:38 -07:00
Jisi Liu
8f54026ded avoid name duplication. 2015-10-20 16:21:41 -07:00
Jisi Liu
bc4fd15209 Rename copeid_src to internal_copied_filegroup 2015-10-20 16:02:58 -07:00
Jisi Liu
14c8f8ac1d Uncomment objc tests 2015-10-20 15:36:22 -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
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
39362b35b2 Extract protoc action into .bzl for cc.
This is needed to support python bazel build.
2015-10-14 17:12:11 -07:00
Ming Zhao
5cdd9367b3 Add missing csharp_doc_comment.cc to protoc_lib. 2015-10-07 09:11:25 -07:00
Ming Zhao
60880a7e46 Add "java_proto" target in bazel BUILD file to provide Java runtime
library.
2015-09-29 13:21:44 -07:00
Jisi Liu
b90f9f8073 Update cmake and BUILD files.
Change-Id: I17e16fdae6e4d2fb74d178fa5564a609ed58af1d
2015-08-25 17:06:33 -07:00
Jon Skeet
b2ac868493 First part of implementing wrapper types. Not ready yet! 2015-07-16 09:36:30 +01:00
Jorge Canizales
d5d7bb3bfb Add Bazel target for protobuf ObjC runtime
Also add WKT headers to the umbrella file, and simplify Podspec with it.
Plus some layout improvements to the BUILD file.
2015-07-06 11:17:39 -07:00
Jisi Liu
7a0c431c8f Enable tests for bazel build.
Change-Id: I63ed5fb58a45e098f2fd1fa457a219148de030bd
2015-06-18 16:45:27 -07:00
Jisi Liu
94062398dc Remove OUTS constants in BUILD
Induce those from the input proto file names instead to reduce the
lenght of the BUILD file.

Change-Id: I1dda57dedac547f4bd0cc3a7d08fb611d72acd13
2015-06-18 14:06:26 -07:00
Jisi Liu
af3eafd1b1 Update BUILD for the recent json util change.
Change-Id: I0b5a2c017f5412aaca3a47815671753cdef63165
2015-06-18 13:39:09 -07:00
Jisi Liu
e438a51389 Remove redundant include
Change-Id: I62640af99e3c2650a29dc5468ce3deb7b6c7efdf
2015-06-18 10:52:07 -07:00
Jisi Liu
d19604fac5 Add Bazel BUILD for the project.
Change-Id: I5a299d969ff96d7d2f80aadc7e8987d461d24b8f
2015-06-17 17:37:58 -07:00