diff options
author | Jisi Liu <liujisi@google.com> | 2015-04-02 10:53:21 -0700 |
---|---|---|
committer | Jisi Liu <liujisi@google.com> | 2015-04-02 10:53:21 -0700 |
commit | 53df3201a396973d73c413c8f8f123332f130da7 (patch) | |
tree | 156c30a2e070d485846ec2068a5da41614f5999d /protoc-artifacts/README.md | |
parent | 42809ef8fef9e4d76267eb21bcb8a856f10ba418 (diff) | |
parent | 0556bf4302fe6d16280b914060b552a30cd8a25a (diff) | |
download | protobuf-53df3201a396973d73c413c8f8f123332f130da7.tar.gz protobuf-53df3201a396973d73c413c8f8f123332f130da7.tar.bz2 protobuf-53df3201a396973d73c413c8f8f123332f130da7.zip |
Merge pull request #268 from zhangkun83/protoc-artifact-maven
Build scripts to publish precompiled protoc binaries (Maven-based)
Diffstat (limited to 'protoc-artifacts/README.md')
-rw-r--r-- | protoc-artifacts/README.md | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md new file mode 100644 index 00000000..c6296462 --- /dev/null +++ b/protoc-artifacts/README.md @@ -0,0 +1,51 @@ +# Build scripts that publish pre-compiled protoc artifacts +``protoc`` is the compiler for ``.proto`` files. It generates language bindings +for the messages and/or RPC services from ``.proto`` files. + +Because ``protoc`` is a native executable, the scripts under this directory +build and publish a ``protoc`` executable (a.k.a. artifact) to Maven +repositories. The artifact can be used by build automation tools so that users +would not need to compile and install ``protoc`` for their systems. + +## Versioning +The version of the ``protoc`` artifact must be the same as the version of the +Protobuf project. + +## Artifact name +The name of a published ``protoc`` artifact is in the following format: +``protoc-<version>-<os>-<arch>.exe``, e.g., ``protoc-3.0.0-alpha-3-windows-x86_64.exe``. + +## System requirement +Install [Apache Maven](http://maven.apache.org/) if you don't have it. + +The scripts only work under Unix-like environments, e.g., Linux, MacOSX, and +Cygwin or MinGW for Windows. Please see ``README.md`` of the Protobuf project +for how to set up the build environment. + +## To install artifacts locally +The following command will install the ``protoc`` artifact to your local Maven repository. +``` +$ mvn install +``` + +## Cross-compilation +The Maven script will try to detect the OS and the architecture from Java +system properties. It's possible to build a protoc binary for an architecture +that is different from what Java has detected, as long as you have the proper +compilers installed. For example, MingGW32 only ships with 32-bit compilers, +but you can still build 32-bit protoc under a 64-bit system, with the following +command: +``` +$ mvn install -Dos.detected.arch=x86_32 +``` + +## To push artifacts to Maven Central +Before you can upload artifacts to Maven Central repository, make sure you have +read [this page](http://central.sonatype.org/pages/apache-maven.html) on how to +configure GPG and Sonatype account. + +Use the following command to upload artifacts: +``` +$ mvn clean deploy -P release +``` + |