zhangkun83 | 65858d5 | 2015-03-30 10:51:13 -0700 | [diff] [blame] | 1 | # Build scripts that publish pre-compiled protoc artifacts |
| 2 | ``protoc`` is the compiler for ``.proto`` files. It generates language bindings |
| 3 | for the messages and/or RPC services from ``.proto`` files. |
| 4 | |
| 5 | Because ``protoc`` is a native executable, the scripts under this directory |
| 6 | build and publish a ``protoc`` executable (a.k.a. artifact) to Maven |
zhangkun83 | 9f4d9c6 | 2015-03-30 10:57:00 -0700 | [diff] [blame] | 7 | repositories. The artifact can be used by build automation tools so that users |
| 8 | would not need to compile and install ``protoc`` for their systems. |
| 9 | |
| 10 | ## Versioning |
| 11 | The version of the ``protoc`` artifact must be the same as the version of the |
| 12 | Protobuf project. |
zhangkun83 | 65858d5 | 2015-03-30 10:51:13 -0700 | [diff] [blame] | 13 | |
| 14 | ## Artifact name |
| 15 | The name of a published ``protoc`` artifact is in the following format: |
| 16 | ``protoc-<version>-<os>-<arch>.exe``, e.g., ``protoc-3.0.0-alpha-3-windows-x86_64.exe``. |
| 17 | |
zhangkun83 | f162ee5 | 2015-03-30 11:02:02 -0700 | [diff] [blame] | 18 | ## System requirement |
Kun Zhang | e499956 | 2015-04-01 12:06:24 -0700 | [diff] [blame^] | 19 | Install [Apache Maven](http://maven.apache.org/) if you don't have it. |
| 20 | |
| 21 | The scripts only work under Unix-like environments, e.g., Linux, MacOSX, and |
zhangkun83 | f162ee5 | 2015-03-30 11:02:02 -0700 | [diff] [blame] | 22 | Cygwin or MinGW for Windows. Please see ``README.md`` of the Protobuf project |
| 23 | for how to set up the build environment. |
| 24 | |
zhangkun83 | 65858d5 | 2015-03-30 10:51:13 -0700 | [diff] [blame] | 25 | ## To install artifacts locally |
| 26 | The following command will install the ``protoc`` artifact to your local Maven repository. |
| 27 | ``` |
Kun Zhang | e499956 | 2015-04-01 12:06:24 -0700 | [diff] [blame^] | 28 | $ mvn install |
zhangkun83 | 65858d5 | 2015-03-30 10:51:13 -0700 | [diff] [blame] | 29 | ``` |
| 30 | |
| 31 | ## To push artifacts to Maven Central |
Kun Zhang | e499956 | 2015-04-01 12:06:24 -0700 | [diff] [blame^] | 32 | Before you can upload artifacts to Maven Central repository, make sure you have |
| 33 | read [this page](http://central.sonatype.org/pages/apache-maven.html) on how to |
| 34 | configure GPG and Sonatype account |
zhangkun83 | 65858d5 | 2015-03-30 10:51:13 -0700 | [diff] [blame] | 35 | |
| 36 | Use the following command to upload artifacts: |
| 37 | ``` |
Kun Zhang | e499956 | 2015-04-01 12:06:24 -0700 | [diff] [blame^] | 38 | $ mvn clean deploy -P release |
zhangkun83 | 65858d5 | 2015-03-30 10:51:13 -0700 | [diff] [blame] | 39 | ``` |
| 40 | |