Commit Graph

68 Commits

Author SHA1 Message Date
Chenwei Xiao
1bbf6f37cc
Correct file extention of README (#10125) 2022-06-09 15:52:50 -07:00
David L. Jones
95da0ba5b4
Rename all BUILD files to BUILD.bazel (#9892)
This avoids conflicting names in a couple of cases.

1. Within google, we want to sync files but not name them BUILD (since the structure doesn't match).
2. On case-insensitive filesystems, `build` may be used for a build directory. Naming `BUILD.bazel` avoids potentioal conflicts.
2022-04-29 17:57:55 -07:00
David L. Jones
d76f8c868c
Add source distribution packaging rules (#9835)
This change adds `rules_pkg`-based targets that will produce source distribution archives, similar to `make dist`.

These rules produce nearly the same outputs as `make dist`. However, there are some differences and caveats:

1. The outputs do not contain vendored googletest sources.
2. You have to run `autogen.sh` before `blaze build pkg:all`. This produces several autotools-related files directly into the source tree.
3. The output .zip files do not have a directory prefix like `protobuf-3.20.1-rc-1` (this will be addressed after [Substitute package variables in `pkg_zip#package_dir`. bazelbuild/rules_pkg#577](https://github.com/bazelbuild/rules_pkg/pull/577); the tar files do have this prefix, though.)
4. One file is missing from the archives, which is produced during the `make` build: benchmarks/gogo/cpp_no_group/cpp_benchmark.cc
5. In several places, I have explicitly excluded some files that are not in the autotools distribution outputs. I think most of those files should probably be included, but for now, I'm aiming for parity with `make dist`. These are marked with comments, so it should be easy to clean them up later.
2022-04-22 16:58:16 -07:00
noahdietz
5abf802bc2 Replace master with main in URLs & docs 2022-04-12 10:25:08 -07:00
Damien Neil
c8dfe32b5a
examples: update Go example (#7217)
Update the Go example to use Go modules: Move the example into a
directory containing a go.mod file, change the installation instructions
to use "go install".

Update the go_package option in addressbook.proto to an actual module path.

Update examples to use the google.golang.org/protobuf/proto module.
2021-10-21 13:27:40 -07:00
Jiamin Shen
0fd835893f
Fix protobuf version in the example (#8509)
The version variable should be `protobuf_VERSION` in `CMakeLists.txt`.
2021-04-20 15:15:30 -07:00
Dan Kortschak
32af37aa38
Make Go example work out of the box (#8486) 2021-04-20 08:25:58 -07:00
Chris Rebert
9d175493a3 addressbook.proto: Enable java_multiple_files option
And update the java_package value accordingly.
Enabling java_multiple_files is preferred nowadays.
Refs CL 348101638 which updates the tutorial accordingly.
2021-04-06 10:07:52 -07:00
Joshua Haberman
c649397029
Set execute bit on files if and only if they begin with (#!). (#7347)
* Set execute bit on files if and only if they begin with (#!).

Git only tracks the 'x' (executable) bit on each file. Prior to this
CL, our files were a random mix of executable and non-executable.
This change imposes some order by making files executable if and only
if they have shebang (#!) lines at the beginning.

We don't have any executable binaries checked into the repo, so
we shouldn't need to worry about that case.

* Added fix_permissions.sh script to set +x iff a file begins with (#!).
2020-04-01 15:28:25 -07:00
Yannic
f0cb9cdb95
[bazel] Move Java runtime/toolchains into //java (#7190)
* [bazel] Move Java runtime/toolchains into //java

This change moves `java_library` targets from the top-level BUILD file
into `//java/{core,lite,util}` and declares `alias` targets to point to
their new locations (hence, this is not a breaking change).

This will allow users that don't use Java to stop depending on
`@rules_java` (e.g. as requested in
https://github.com/bazelbuild/rules_scala/pull/989#issuecomment-583405161).

Note that there is no intention to deprecate + remove the top-level
targets in the foreseeable future.

* Add BUILD files in //java to java_EXTRA_DIST
2020-02-13 13:04:14 -08:00
Brian Wignall
a104dffcb6 Fix typos (#7050)
Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos, with https://github.com/bwignall/typochecker to help automate the checking.
2020-01-08 10:18:20 -08:00
Zhao Junwang
c562c93ad6 add -std=c++11 to make it compile
make cpp won't compile since it requires `-std=c++11` com
2019-12-06 11:15:57 -08:00
Rafi Kamal
e6c5a3b57d
Add a proto_lang_toolchain for javalite (#6882)
* Add a proto_lang_toolchain for javalite

* fix toolchain. Swap javalite example to master repo
2019-11-27 11:10:45 -08:00
Roman Kamyk
dc974d22c5 Fix small style issues in the dart example, following Effective Dart:
- use final instead of obvious types for local variables
- add missing `void` return type
- make the comments doccomments (///)
2019-09-04 12:30:57 -07:00
Yannic Bonenberger
d2d6ff51a8 [bazel] Load python rules from @rules_python 2019-08-06 16:50:32 -07:00
Yannic Bonenberger
bf0c69e130 [bazel] Add fixes for --incompatible_load_{cc,java,proto}_rules_from_bzl (Part 2)
This change adds the required loads to examples and zlib.
For full compatibility with --incompatible_load_{cc,java,proto}_rules_from_bzl,
we will need to roll gtest to a newer version.
2019-07-29 14:14:04 -07:00
Phani Rithvij
39c6b58a9b
fix dart example readme typo 2019-07-07 09:10:41 +05:30
Wang Kirin
74f4f594cf fix typos in examples/README.md 2019-05-31 14:26:20 -07:00
Kent Ross
b6375e03aa create importable function for defining zlib 2019-02-26 11:27:20 -08:00
Xiang Dai
e479410564 delete all duplicate empty blanks (#5758)
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-20 19:28:50 -08:00
Adam Cozzette
e03c0d22a7 Updated Bazel workspace in examples/ to handle zlib dependency
To make this work, I created a symlink to the existing zlib.BUILD file.
Maybe there is a better way to do this, but this is at least a quick
workaround to fix the build.
2018-12-11 16:52:50 -08:00
Jonathan White
b017ac4b87
Update add_person.dart
Fixed typo in a function name.
2018-11-20 18:45:25 -08:00
Adam Cozzette
1c2eba3eac
Merge pull request #5298 from rogerhub/patch-1
Import versions from @bazel_skylib//lib:versions.bzl
2018-11-12 13:36:15 -08:00
Roger Chen
7492b56812 Import versions from @bazel_skylib//lib:versions.bzl
@bazel_skylib//:lib is supposedly deprecated. The 'versions' struct in lib.bzl was committed to bazel-skylib at the same time as //lib:versions.bzl, so there should be no backward incompatibility.
2018-11-02 23:13:17 -07:00
Sarah Zakarias
f075cacaf4 comments 2018-10-23 10:36:46 +02:00
Sarah Zakarias
bc00484bf7 comments and formatting 2018-10-23 09:52:44 +02:00
Sarah Zakarias
969397b719 Add Dart example. 2018-10-15 09:30:34 +02:00
Feng Xiao
afe98de32a Replace repo links. 2018-08-22 11:55:30 -07:00
Yilun Chong
517190a7d9 fix golang kokoro linux build 2018-07-12 16:52:16 -07:00
Feng Xiao
1a7ce04be7 Fix bazel build of examples. 2018-07-03 11:00:15 -07:00
Yilun Chong
805174eda2 Add script for run and upload the benchmark result to bq 2018-04-10 13:26:17 -07:00
Fahrzin Hemmati
35119e39a0 Add a check_protobuf_required_bazel_version() for use in WORKSPACEs 2017-12-04 15:12:08 -08:00
Feng Xiao
8136ccb296 Fix go example test.
It needs "-I" flag to find imported file google/protobuf/timestamp.proto
2017-09-13 17:04:13 -07:00
Feng Xiao
74bf45f379 Add bazel support for examples.
The example utilizes native bazel rules (proto_library, cc_proto_library,
java_proto_library, java_lite_proto_library) to show how easy it is to
build protobuf with bazel's native support. It also makes use of well
known types which was not possible until the latest bazel 0.5.4 release
and https://github.com/google/protobuf/pull/3594 .
2017-09-08 16:01:49 -07:00
cclauss
067543cd6d from __future__ import print_function
The future import is required to support the print(x, end=" ") parameter in Python 2.
2017-08-18 01:14:48 +02:00
cclauss
7daedbd8ca print() function & define raw_input() for Python 3 2017-08-18 01:09:14 +02:00
king6cong
547d76ed8e Add classpath for java example Makefile 2017-07-31 14:53:05 +08:00
Walter Gray
0336770801 add protobuf_generate function, allows use of target_sources where available 2017-06-02 19:57:08 -07:00
Feng Xiao
9086d96439 Integrate from internal code base. 2016-07-13 13:48:40 -07:00
Walter Gray
09f6a5c1d2 Use ExternalProject_Add to build the examples in a stand-alone fashion. 2016-06-06 12:06:55 -07:00
Konstantin Podsvirov
71556295ff CMake project updates
A series of improvements:

- Improved Protobuf module compatibility (disabled by default);
- Hide advanced settings;
- Added build tree configuration;
- Added build of examples.
2016-06-04 00:10:07 +03:00
Joshua Haberman
3ee2e20539 Merge pull request #1144 from dongjoon-hyun/remove_redundant_the
Remove redundant `the`.
2016-02-11 17:17:48 -08:00
Dongjoon Hyun
7a9040fe7f Remove redundant the in comments. 2016-02-03 15:27:27 -08:00
Parth Kolekar
21e1f1d2e9 Updated python examples to use with. 2016-01-26 04:13:31 +05:30
Feng Xiao
9e1777f4b0 Merge pull request #1052 from tswast/master
Add region tags to the Go protobuf examples.
2015-12-17 11:42:59 -08:00
Tim Swast
7df1d773b7 Improves readability of Go example test. 2015-12-16 14:46:28 -08:00
Tim Swast
1cc541b3be Add region tags to the Go protobuf examples.
This will allow us to like to specific snippets of code in the
documentation.  I plan to create a tutorial similar to the C# tutorial
https://developers.google.com/protocol-buffers/docs/csharptutorial

Since that tutorial has sections for populating a proto, parsing, and
serializing, I made a region for each of these for Go.  To make the
populating sample more self-contained, I refactor the listing example
slightly.
2015-12-15 15:56:23 -08:00
Tim Swast
bc4723481a Add region tags for protocol buffers tutorials.
Since these tags might be confusing, added a note that these are not
part of the normal protocol buffers syntax.  I also linked to the main
tutorials page that uses these examples
https://developers.google.com/protocol-buffers/docs/tutorials so that
anyone who arrived here without going through that info first can get
more explanation if they want.
2015-12-01 17:07:18 -08:00
Tim Swast
7e31c4d930 Add a Go language example.
This follows the other examples so that it can be used as a tutorial,
such as the ones at:
  https://developers.google.com/protocol-buffers/docs/tutorials

Even though Go generally does not use Makefiles, I added targets for the
Go examples to be consistent with the other languages.

Edit:

Fix Travis run. Change to use $HOME instead of ~. Add protoc to path.
GOPATH entry cannot start with shell metacharacter '~': "~/gocode"

Edit(2):

Fix Go code style to address comments.
2015-11-25 10:46:35 -08:00
Jan Tattermusch
b0e5ba697e rename persons to people 2015-07-20 15:24:08 -07:00