From 82524fe5aaa66e7a36285c25321afd79f7a98680 Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Wed, 25 Mar 2015 13:06:12 -0700 Subject: Create protoc-artifacts directory --- protoc-artifacts/build.gradle | 3 + protoc-artifacts/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 51018 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + protoc-artifacts/gradlew | 164 +++++++++++++++++++++ protoc-artifacts/gradlew.bat | 90 +++++++++++ 5 files changed, 263 insertions(+) create mode 100644 protoc-artifacts/build.gradle create mode 100644 protoc-artifacts/gradle/wrapper/gradle-wrapper.jar create mode 100644 protoc-artifacts/gradle/wrapper/gradle-wrapper.properties create mode 100755 protoc-artifacts/gradlew create mode 100644 protoc-artifacts/gradlew.bat (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build.gradle b/protoc-artifacts/build.gradle new file mode 100644 index 00000000..5af087a9 --- /dev/null +++ b/protoc-artifacts/build.gradle @@ -0,0 +1,3 @@ +task wrapper(type: Wrapper) { + gradleVersion = '2.0' +} diff --git a/protoc-artifacts/gradle/wrapper/gradle-wrapper.jar b/protoc-artifacts/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..c97a8bdb Binary files /dev/null and b/protoc-artifacts/gradle/wrapper/gradle-wrapper.jar differ diff --git a/protoc-artifacts/gradle/wrapper/gradle-wrapper.properties b/protoc-artifacts/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..b125b424 --- /dev/null +++ b/protoc-artifacts/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Mar 25 13:05:27 PDT 2015 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip diff --git a/protoc-artifacts/gradlew b/protoc-artifacts/gradlew new file mode 100755 index 00000000..91a7e269 --- /dev/null +++ b/protoc-artifacts/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/protoc-artifacts/gradlew.bat b/protoc-artifacts/gradlew.bat new file mode 100644 index 00000000..aec99730 --- /dev/null +++ b/protoc-artifacts/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega -- cgit v1.2.3 From 488162db1e59f74f7b5f094aa87fdd4a324dc3c0 Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Wed, 25 Mar 2015 16:07:50 -0700 Subject: Gradle script to publish protoc binaries --- protoc-artifacts/build-protoc.sh | 8 +++ protoc-artifacts/build.gradle | 110 +++++++++++++++++++++++++++++++++++++++ protoc-artifacts/settings.gradle | 1 + 3 files changed, 119 insertions(+) create mode 100755 protoc-artifacts/build-protoc.sh create mode 100644 protoc-artifacts/settings.gradle (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh new file mode 100755 index 00000000..137c5d63 --- /dev/null +++ b/protoc-artifacts/build-protoc.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Override the default value set in configure.ac that has '-g' which produces +# huge binary. +export CXXFLAGS=-DNDEBUG + +cd $(dirname "$0")/.. && ./configure --disable-shared && make && + cd src && (strip protoc || strip protoc.exe) diff --git a/protoc-artifacts/build.gradle b/protoc-artifacts/build.gradle index 5af087a9..b44844fa 100644 --- a/protoc-artifacts/build.gradle +++ b/protoc-artifacts/build.gradle @@ -1,3 +1,113 @@ +apply plugin: 'maven' +apply plugin: 'java' +apply plugin: 'osdetector' +apply plugin: 'signing' + +description = 'Pre-compiled protoc (protobuf compiler) artifacts' + +group = 'com.google.protobuf' +version = '3.0.0-alpha-3-pre' + +buildscript { + repositories { + mavenCentral() + mavenLocal() + } + dependencies { + classpath 'com.google.gradle:osdetector-gradle-plugin:0.1.0-SNAPSHOT' + } +} + +repositories { + mavenCentral() + mavenLocal() +} + +signing { + sign configurations.archives +} + +def artifactFile = 'target/protoc.exe' as File + +task buildProtoc(type: Exec) { + commandLine './build-protoc.sh' +} + +task prepareArtifact(type: Copy, dependsOn: buildProtoc) { + from '../src/' as File + into artifactFile.parent + include 'protoc', 'protoc.exe' + rename 'protoc', 'protoc.exe' +} + +artifacts { + archives(artifactFile) { + classifier osdetector.classifier + type "exe" + extension "exe" + builtBy prepareArtifact + } +} + +uploadArchives.repositories.mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { + if (rootProject.hasProperty("ossrhUsername") + && rootProject.hasProperty("ossrhPassword")) { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + } + + snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { + if (rootProject.hasProperty("ossrhUsername") + && rootProject.hasProperty("ossrhPassword")) { + authentication(userName: ossrhUsername, password: ossrhPassword) + } + } +} + +[ + install.repositories.mavenInstaller, + uploadArchives.repositories.mavenDeployer, +]*.pom*.whenConfigured { pom -> + pom.project { + name "$project.group:$project.name" + description project.description + url 'https://github.com/google/protobuf' + + scm { + connection 'scm:svn:https://github.com/google/protobuf.git' + developerConnection 'scm:svn:git@github.com:google/protobuf.git' + url 'https://github.com/google/protobuf' + } + + licenses { + license { + name 'BSD 3-Clause' + url 'http://opensource.org/licenses/BSD-3-Clause' + } + } + + developers { + developer { + id "com.google.protobuf" + name "Protobuf Contributors" + email "protobuf@googlegroups.com" + url "https://github.com/google/protobuf" + organization = "Google, Inc." + organizationUrl "https://www.google.com" + } + } + } +} + +// Exe files are skipped by Maven by default. Override it. +[ + install.repositories.mavenInstaller, + uploadArchives.repositories.mavenDeployer, +]*.addFilter('all') {artifact, file -> true} + task wrapper(type: Wrapper) { gradleVersion = '2.0' } diff --git a/protoc-artifacts/settings.gradle b/protoc-artifacts/settings.gradle new file mode 100644 index 00000000..2a18bb00 --- /dev/null +++ b/protoc-artifacts/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'protoc' -- cgit v1.2.3 From f1496fdafce35d63c5e65c4f7108075217b8d603 Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Fri, 27 Mar 2015 17:33:11 -0700 Subject: Use osdetector-gradle-plugin:1.2.1; Fix authentication methods for sonatype --- protoc-artifacts/build.gradle | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build.gradle b/protoc-artifacts/build.gradle index b44844fa..80a4f8c6 100644 --- a/protoc-artifacts/build.gradle +++ b/protoc-artifacts/build.gradle @@ -11,16 +11,14 @@ version = '3.0.0-alpha-3-pre' buildscript { repositories { mavenCentral() - mavenLocal() } dependencies { - classpath 'com.google.gradle:osdetector-gradle-plugin:0.1.0-SNAPSHOT' + classpath 'com.google.gradle:osdetector-gradle-plugin:1.2.1' } } repositories { mavenCentral() - mavenLocal() } signing { @@ -53,17 +51,11 @@ uploadArchives.repositories.mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - if (rootProject.hasProperty("ossrhUsername") - && rootProject.hasProperty("ossrhPassword")) { - authentication(userName: ossrhUsername, password: ossrhPassword) - } + authentication(userName: sonatypeUsername, password: sonatypePassword) } snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - if (rootProject.hasProperty("ossrhUsername") - && rootProject.hasProperty("ossrhPassword")) { - authentication(userName: ossrhUsername, password: ossrhPassword) - } + authentication(userName: sonatypeUsername, password: sonatypePassword) } } -- cgit v1.2.3 From 65858d51bbea49c19f0c2a1d4c223b781ea688f7 Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Mon, 30 Mar 2015 10:51:13 -0700 Subject: Add README.md; Allow installing to local repo without OSSRH account and signature --- protoc-artifacts/README.md | 38 ++++++++++++++++++++++++++++++++++++++ protoc-artifacts/build.gradle | 9 +++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 protoc-artifacts/README.md (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md new file mode 100644 index 00000000..136ae4a6 --- /dev/null +++ b/protoc-artifacts/README.md @@ -0,0 +1,38 @@ +# 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. + +## Artifact name +The name of a published ``protoc`` artifact is in the following format: +``protoc---.exe``, e.g., ``protoc-3.0.0-alpha-3-windows-x86_64.exe``. + +## To install artifacts locally +The following command will install the ``protoc`` artifact to your local Maven repository. +``` +$ ./gradlew install +``` + +## To push artifacts to Maven Central +Before you can upload artifacts to Maven Central repository, you must have [set +up your account with OSSRH](http://central.sonatype.org/pages/ossrh-guide.html), +and have [generated a PGP key](http://gradle.org/docs/current/userguide/signing_plugin.html) +for siging. You need to put your account information and PGP key information +in ``$HOME/.gradle/gradle.properties``, e.g.: +``` +signing.keyId=24875D73 +signing.password=secret +signing.secretKeyRingFile=/Users/me/.gnupg/secring.gpg + +ossrhUsername=your-jira-id +ossrhPassword=your-jira-password +``` + +Use the following command to upload artifacts: +``` +$ ./gradlew uploadArchives +``` + diff --git a/protoc-artifacts/build.gradle b/protoc-artifacts/build.gradle index 80a4f8c6..ab5edd81 100644 --- a/protoc-artifacts/build.gradle +++ b/protoc-artifacts/build.gradle @@ -22,6 +22,7 @@ repositories { } signing { + required false sign configurations.archives } @@ -51,11 +52,15 @@ uploadArchives.repositories.mavenDeployer { beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) + if (rootProject.hasProperty("ossrhUsername") && rootProject.hasProperty("ossrhPassword")) { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } } snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - authentication(userName: sonatypeUsername, password: sonatypePassword) + if (rootProject.hasProperty("ossrhUsername") && rootProject.hasProperty("ossrhPassword")) { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } } } -- cgit v1.2.3 From 9f4d9c6a443ff0b6f847f0d0e1054cd140aeb7d5 Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Mon, 30 Mar 2015 10:57:00 -0700 Subject: Clarify the usage and the versioning of the artifact --- protoc-artifacts/README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index 136ae4a6..3d48ed22 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -4,7 +4,12 @@ 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. +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: -- cgit v1.2.3 From f162ee59e00bc046692079ff4dd1f5fdde8589ab Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Mon, 30 Mar 2015 11:02:02 -0700 Subject: Clarify system requirements --- protoc-artifacts/README.md | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index 3d48ed22..d3ef7ba2 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -15,6 +15,11 @@ Protobuf project. The name of a published ``protoc`` artifact is in the following format: ``protoc---.exe``, e.g., ``protoc-3.0.0-alpha-3-windows-x86_64.exe``. +## System requirement +These 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. ``` -- cgit v1.2.3 From 645d7fbf365d9a27dbfb63bb54c07e61ce58ed7e Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Mon, 30 Mar 2015 15:22:02 -0700 Subject: Fix property names for ossrh username and password --- protoc-artifacts/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build.gradle b/protoc-artifacts/build.gradle index ab5edd81..b95d00cf 100644 --- a/protoc-artifacts/build.gradle +++ b/protoc-artifacts/build.gradle @@ -53,13 +53,13 @@ uploadArchives.repositories.mavenDeployer { repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { if (rootProject.hasProperty("ossrhUsername") && rootProject.hasProperty("ossrhPassword")) { - authentication(userName: sonatypeUsername, password: sonatypePassword) + authentication(userName: ossrhUsername, password: ossrhPassword) } } snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { if (rootProject.hasProperty("ossrhUsername") && rootProject.hasProperty("ossrhPassword")) { - authentication(userName: sonatypeUsername, password: sonatypePassword) + authentication(userName: ossrhUsername, password: ossrhPassword) } } } -- cgit v1.2.3 From cd4e9e72fbcc7032b440df56a0352106d2c7d0b5 Mon Sep 17 00:00:00 2001 From: zhangkun83 Date: Mon, 30 Mar 2015 18:01:07 -0700 Subject: Use bash explicitly to run build-protoc.sh to make it work on Windows w/ MSYS --- protoc-artifacts/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build.gradle b/protoc-artifacts/build.gradle index b95d00cf..de93cb02 100644 --- a/protoc-artifacts/build.gradle +++ b/protoc-artifacts/build.gradle @@ -29,7 +29,7 @@ signing { def artifactFile = 'target/protoc.exe' as File task buildProtoc(type: Exec) { - commandLine './build-protoc.sh' + commandLine 'bash', 'build-protoc.sh' } task prepareArtifact(type: Copy, dependsOn: buildProtoc) { -- cgit v1.2.3 From 36093ca45e544bb92ec67962130aaea31aa7c9d1 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Tue, 31 Mar 2015 22:07:13 +0100 Subject: Tweak flags to make statically-linked binary under Cygwin --- protoc-artifacts/build-protoc.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 137c5d63..8293311a 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -2,7 +2,18 @@ # Override the default value set in configure.ac that has '-g' which produces # huge binary. -export CXXFLAGS=-DNDEBUG +export CXXFLAGS="-DNDEBUG" + +# Statically link libgcc and libstdc++ +export LDFLAGS="-static-libgcc -static-libstdc++" + +# Under Cygwin we use MinGW GCC because the executable produced by Cygwin GCC +# depends on Cygwin DLL. +if [[ "$(uname)" == CYGWIN* ]]; then + export CC=i686-pc-mingw32-gcc + export CXX=i686-pc-mingw32-c++ + export CXXCPP=i686-pc-mingw32-cpp +fi cd $(dirname "$0")/.. && ./configure --disable-shared && make && cd src && (strip protoc || strip protoc.exe) -- cgit v1.2.3 From e4f1f933137f8231cdf8def6bc9231653de7d36f Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Tue, 31 Mar 2015 16:28:57 -0700 Subject: Stop calling strip, pass -s to linker instead --- protoc-artifacts/build-protoc.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 8293311a..8233c64d 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -4,8 +4,9 @@ # huge binary. export CXXFLAGS="-DNDEBUG" -# Statically link libgcc and libstdc++ -export LDFLAGS="-static-libgcc -static-libstdc++" +# Statically link libgcc and libstdc++. +# -s to produce stripped binary +export LDFLAGS="-static-libgcc -static-libstdc++ -s" # Under Cygwin we use MinGW GCC because the executable produced by Cygwin GCC # depends on Cygwin DLL. @@ -15,5 +16,4 @@ if [[ "$(uname)" == CYGWIN* ]]; then export CXXCPP=i686-pc-mingw32-cpp fi -cd $(dirname "$0")/.. && ./configure --disable-shared && make && - cd src && (strip protoc || strip protoc.exe) +cd $(dirname "$0")/.. && ./configure --disable-shared && make -- cgit v1.2.3 From e2f858574b1cbab1d914ad451bb942bec81347ee Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Tue, 31 Mar 2015 16:59:33 -0700 Subject: Make clean before making --- protoc-artifacts/build-protoc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 8233c64d..f166c8b6 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -16,4 +16,4 @@ if [[ "$(uname)" == CYGWIN* ]]; then export CXXCPP=i686-pc-mingw32-cpp fi -cd $(dirname "$0")/.. && ./configure --disable-shared && make +cd $(dirname "$0")/.. && ./configure --disable-shared && make clean && make -- cgit v1.2.3 From ae9177d6453ce23ddb33927a5e88360255efa1fc Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Tue, 31 Mar 2015 18:26:28 -0700 Subject: Switch from Gradle to Maven. --- protoc-artifacts/build-protoc.sh | 7 +- protoc-artifacts/build.gradle | 110 -------------- protoc-artifacts/gradle/wrapper/gradle-wrapper.jar | Bin 51018 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - protoc-artifacts/gradlew | 164 --------------------- protoc-artifacts/gradlew.bat | 90 ----------- protoc-artifacts/pom.xml | 113 ++++++++++++++ protoc-artifacts/settings.gradle | 1 - 8 files changed, 119 insertions(+), 372 deletions(-) delete mode 100644 protoc-artifacts/build.gradle delete mode 100644 protoc-artifacts/gradle/wrapper/gradle-wrapper.jar delete mode 100644 protoc-artifacts/gradle/wrapper/gradle-wrapper.properties delete mode 100755 protoc-artifacts/gradlew delete mode 100644 protoc-artifacts/gradlew.bat create mode 100644 protoc-artifacts/pom.xml delete mode 100644 protoc-artifacts/settings.gradle (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index f166c8b6..4e0e5498 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -1,5 +1,8 @@ #!/bin/bash +cd $(dirname "$0") +WORKING_DIR=$(pwd) + # Override the default value set in configure.ac that has '-g' which produces # huge binary. export CXXFLAGS="-DNDEBUG" @@ -16,4 +19,6 @@ if [[ "$(uname)" == CYGWIN* ]]; then export CXXCPP=i686-pc-mingw32-cpp fi -cd $(dirname "$0")/.. && ./configure --disable-shared && make clean && make +cd "$WORKING_DIR"/.. && ./configure --disable-shared && make clean && make && + cd "$WORKING_DIR" && mkdir -p target && + (cp ../src/protoc target/protoc.exe || cp ../src/protoc.exe target/protoc.exe) diff --git a/protoc-artifacts/build.gradle b/protoc-artifacts/build.gradle deleted file mode 100644 index de93cb02..00000000 --- a/protoc-artifacts/build.gradle +++ /dev/null @@ -1,110 +0,0 @@ -apply plugin: 'maven' -apply plugin: 'java' -apply plugin: 'osdetector' -apply plugin: 'signing' - -description = 'Pre-compiled protoc (protobuf compiler) artifacts' - -group = 'com.google.protobuf' -version = '3.0.0-alpha-3-pre' - -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath 'com.google.gradle:osdetector-gradle-plugin:1.2.1' - } -} - -repositories { - mavenCentral() -} - -signing { - required false - sign configurations.archives -} - -def artifactFile = 'target/protoc.exe' as File - -task buildProtoc(type: Exec) { - commandLine 'bash', 'build-protoc.sh' -} - -task prepareArtifact(type: Copy, dependsOn: buildProtoc) { - from '../src/' as File - into artifactFile.parent - include 'protoc', 'protoc.exe' - rename 'protoc', 'protoc.exe' -} - -artifacts { - archives(artifactFile) { - classifier osdetector.classifier - type "exe" - extension "exe" - builtBy prepareArtifact - } -} - -uploadArchives.repositories.mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { - if (rootProject.hasProperty("ossrhUsername") && rootProject.hasProperty("ossrhPassword")) { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - } - - snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { - if (rootProject.hasProperty("ossrhUsername") && rootProject.hasProperty("ossrhPassword")) { - authentication(userName: ossrhUsername, password: ossrhPassword) - } - } -} - -[ - install.repositories.mavenInstaller, - uploadArchives.repositories.mavenDeployer, -]*.pom*.whenConfigured { pom -> - pom.project { - name "$project.group:$project.name" - description project.description - url 'https://github.com/google/protobuf' - - scm { - connection 'scm:svn:https://github.com/google/protobuf.git' - developerConnection 'scm:svn:git@github.com:google/protobuf.git' - url 'https://github.com/google/protobuf' - } - - licenses { - license { - name 'BSD 3-Clause' - url 'http://opensource.org/licenses/BSD-3-Clause' - } - } - - developers { - developer { - id "com.google.protobuf" - name "Protobuf Contributors" - email "protobuf@googlegroups.com" - url "https://github.com/google/protobuf" - organization = "Google, Inc." - organizationUrl "https://www.google.com" - } - } - } -} - -// Exe files are skipped by Maven by default. Override it. -[ - install.repositories.mavenInstaller, - uploadArchives.repositories.mavenDeployer, -]*.addFilter('all') {artifact, file -> true} - -task wrapper(type: Wrapper) { - gradleVersion = '2.0' -} diff --git a/protoc-artifacts/gradle/wrapper/gradle-wrapper.jar b/protoc-artifacts/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index c97a8bdb..00000000 Binary files a/protoc-artifacts/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/protoc-artifacts/gradle/wrapper/gradle-wrapper.properties b/protoc-artifacts/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index b125b424..00000000 --- a/protoc-artifacts/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Wed Mar 25 13:05:27 PDT 2015 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip diff --git a/protoc-artifacts/gradlew b/protoc-artifacts/gradlew deleted file mode 100755 index 91a7e269..00000000 --- a/protoc-artifacts/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/protoc-artifacts/gradlew.bat b/protoc-artifacts/gradlew.bat deleted file mode 100644 index aec99730..00000000 --- a/protoc-artifacts/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml new file mode 100644 index 00000000..51b48c92 --- /dev/null +++ b/protoc-artifacts/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + + com.google + google + 1 + + com.google.protobuf + protoc + 3.0.0-alpha-3-pre + pom + Protobuf Compiler + + Protobuf Compiler (protoc) is a compiler for .proto files. It generates + language-specific code for Protobuf messages and RPC interfaces. + + 2008 + https://developers.google.com/protocol-buffers/ + + + New BSD license + http://www.opensource.org/licenses/bsd-license.php + repo + + + + https://github.com/google/protobuf + + scm:git:https://github.com/google/protobuf.git + + + + + + kr.motd.maven + os-maven-plugin + 1.2.3.Final + + + + + org.codehaus.mojo + exec-maven-plugin + 1.1.1 + + + compile + + exec + + + + + bash + + build-protoc.sh + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.8 + + + attach-artifacts + package + + attach-artifact + + + + + ${basedir}/target/protoc.exe + ${os.detected.classifier} + exe + + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.3 + true + + sonatype-nexus-staging + https://oss.sonatype.org/ + false + + + + + diff --git a/protoc-artifacts/settings.gradle b/protoc-artifacts/settings.gradle deleted file mode 100644 index 2a18bb00..00000000 --- a/protoc-artifacts/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'protoc' -- cgit v1.2.3 From 18f02bc1cde4f039e8ecd85d8f2949c5c66a9d84 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Wed, 1 Apr 2015 11:53:03 -0700 Subject: Move signing and uploading to the release profile --- protoc-artifacts/pom.xml | 59 ++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 25 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 51b48c92..f7bc8818 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -83,31 +83,40 @@ - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 - true - - sonatype-nexus-staging - https://oss.sonatype.org/ - false - - + + + release + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.3 + true + + sonatype-nexus-staging + https://oss.sonatype.org/ + false + + + + + + -- cgit v1.2.3 From e499956536ca12f151715b8f9f79739df9da15ff Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Wed, 1 Apr 2015 12:06:24 -0700 Subject: Update README.md --- protoc-artifacts/README.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index d3ef7ba2..e99e4745 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -16,33 +16,25 @@ The name of a published ``protoc`` artifact is in the following format: ``protoc---.exe``, e.g., ``protoc-3.0.0-alpha-3-windows-x86_64.exe``. ## System requirement -These scripts only work under Unix-like environments, e.g., Linux, MacOSX, and +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. ``` -$ ./gradlew install +$ mvn install ``` ## To push artifacts to Maven Central -Before you can upload artifacts to Maven Central repository, you must have [set -up your account with OSSRH](http://central.sonatype.org/pages/ossrh-guide.html), -and have [generated a PGP key](http://gradle.org/docs/current/userguide/signing_plugin.html) -for siging. You need to put your account information and PGP key information -in ``$HOME/.gradle/gradle.properties``, e.g.: -``` -signing.keyId=24875D73 -signing.password=secret -signing.secretKeyRingFile=/Users/me/.gnupg/secring.gpg - -ossrhUsername=your-jira-id -ossrhPassword=your-jira-password -``` +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: ``` -$ ./gradlew uploadArchives +$ mvn clean deploy -P release ``` -- cgit v1.2.3 From c8eda8e9d8e91a94b7e060b4a0d3ef21f4224a5a Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Wed, 1 Apr 2015 16:23:15 -0700 Subject: Run make protoc(.exe) instead of just make, because the latter fails on Cygwin with mingw gcc; build-protoc.sh works under Cygwin; build-protoc.sh will use the --host parameter consistent with what os-maven-plugin has detected --- protoc-artifacts/build-protoc.sh | 88 ++++++++++++++++++++++++++++++++++++---- protoc-artifacts/pom.xml | 2 + 2 files changed, 81 insertions(+), 9 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 4e0e5498..f8afa95a 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -1,7 +1,84 @@ #!/bin/bash +# Builds protoc executable into target/protoc.exe +# To be run from Maven. +# Usage: build-protoc.sh +# and are ${os.detected.name} and ${os.detected.arch} from os-maven-plugin +OS=$1 +ARCH=$2 + +# Under Cygwin, bash doesn't have these in PATH when called from Maven which +# runs in Windows version of Java. +export PATH="/bin:/usr/bin:$PATH" + +############################################################################ +# Helper functions +############################################################################ +E_PARAM_ERR=98 +E_ASSERT_FAILED=99 + +fail() +{ + echo "Error: $1" + exit $E_ASSERT_FAILED +} + +# Usage: assertEq VAL1 VAL2 $LINENO +assertEq () +{ + lineno=$3 + if [ -z "$lineno" ]; then + echo "lineno not given" + exit $E_PARAM_ERR + fi + + if [[ "$1" != "$2" ]]; then + echo "Assertion failed: \"$1\" == \"$2\"" + echo "File \"$0\", line $lineno" # Give name of file and line number. + exit $E_ASSERT_FAILED + fi +} +############################################################################ + +echo "Building protoc, OS=$OS ARCH=$ARCH" + cd $(dirname "$0") WORKING_DIR=$(pwd) +CONFIGURE_ARGS="--disable-shared" + +MAKE_TARGET="protoc" +if [[ "$OS" == windows ]]; then + MAKE_TARGET="${MAKE_TARGET}.exe" +fi + +if [[ "$(uname)" == CYGWIN* ]]; then + assertEq "$OS" windows $LINENO + # Use mingw32 compilers because executables produced by Cygwin compiler + # always have dependency on Cygwin DLL. + if [[ "$ARCH" == x86_64 ]]; then + CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32" + elif [[ "$ARCH" == x86_32 ]]; then + CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-pc-mingw32" + else + fail "Unsupported arch by CYGWIN: $ARCH" + fi +elif [[ "$(uname)" == MINGW32* ]]; then + assertEq "$OS" windows $LINENO + assertEq "$ARCH" x86_32 $LINENO +elif [[ "$(uname)" == Linux* ]]; then + assertEq "$OS" linux $LINENO + if [[ "$ARCH" == x86_64 ]]; then + CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-linux-gnu" + elif [[ "$ARCH" == x86_32 ]]; then + CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-linux-gnu" + else + fail "Unsupported arch by CYGWIN: $ARCH" + fi +elif [[ "$(uname)" == Darwin* ]]; then + assertEq "$OS" osx $LINENO +else + fail "Unsupported system: $(uname)" +fi # Override the default value set in configure.ac that has '-g' which produces # huge binary. @@ -11,14 +88,7 @@ export CXXFLAGS="-DNDEBUG" # -s to produce stripped binary export LDFLAGS="-static-libgcc -static-libstdc++ -s" -# Under Cygwin we use MinGW GCC because the executable produced by Cygwin GCC -# depends on Cygwin DLL. -if [[ "$(uname)" == CYGWIN* ]]; then - export CC=i686-pc-mingw32-gcc - export CXX=i686-pc-mingw32-c++ - export CXXCPP=i686-pc-mingw32-cpp -fi - -cd "$WORKING_DIR"/.. && ./configure --disable-shared && make clean && make && +cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && + cd src && make clean && make $MAKE_TARGET && cd "$WORKING_DIR" && mkdir -p target && (cp ../src/protoc target/protoc.exe || cp ../src/protoc.exe target/protoc.exe) diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index f7bc8818..2536cad6 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -57,6 +57,8 @@ bash build-protoc.sh + ${os.detected.name} + ${os.detected.arch} -- cgit v1.2.3 From 74c4b648cb0a29a8ca29681d5144eca295ed2cf7 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Wed, 1 Apr 2015 16:32:21 -0700 Subject: Make cross-compilation possible --- protoc-artifacts/README.md | 11 +++++++++++ protoc-artifacts/pom.xml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index e99e4745..caabc1cb 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -28,6 +28,17 @@ The following command will install the ``protoc`` artifact to your local Maven r $ 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 arhitecture +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 diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 2536cad6..7db7b53d 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -77,7 +77,7 @@ ${basedir}/target/protoc.exe - ${os.detected.classifier} + ${os.detected.name}-${os.detected.arch} exe -- cgit v1.2.3 From 87b85019e613ec21299ad6cb2bbf43e41e014c92 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Wed, 1 Apr 2015 18:02:36 -0700 Subject: Make it work on Mac --- protoc-artifacts/build-protoc.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index f8afa95a..90d9a8ef 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -85,8 +85,11 @@ fi export CXXFLAGS="-DNDEBUG" # Statically link libgcc and libstdc++. -# -s to produce stripped binary -export LDFLAGS="-static-libgcc -static-libstdc++ -s" +# -s to produce stripped binary. +# And they don't work under Mac. +if [[ "$OS" != osx ]]; then + export LDFLAGS="-static-libgcc -static-libstdc++ -s" +fi cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && cd src && make clean && make $MAKE_TARGET && -- cgit v1.2.3 From 9a8bae72abe4cdc6dbc6a658845df613d3b0d6e7 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Thu, 2 Apr 2015 10:25:02 -0700 Subject: Guard cd path with quotes --- protoc-artifacts/build-protoc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 90d9a8ef..f02ed01b 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -42,7 +42,7 @@ assertEq () echo "Building protoc, OS=$OS ARCH=$ARCH" -cd $(dirname "$0") +cd "$(dirname \"$0\")" WORKING_DIR=$(pwd) CONFIGURE_ARGS="--disable-shared" -- cgit v1.2.3 From 0556bf4302fe6d16280b914060b552a30cd8a25a Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Thu, 2 Apr 2015 10:25:13 -0700 Subject: Fix typo in README --- protoc-artifacts/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index caabc1cb..c6296462 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -30,7 +30,7 @@ $ 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 arhitecture +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 @@ -42,7 +42,7 @@ $ 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 +configure GPG and Sonatype account. Use the following command to upload artifacts: ``` -- cgit v1.2.3 From b00a5d7ee089e03ef50ea114b42447c5ed6359b1 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Thu, 2 Apr 2015 13:14:29 -0700 Subject: Document more about cross-compilation; Post-build check for the actual arch of the artifact --- protoc-artifacts/README.md | 17 ++++++++--- protoc-artifacts/build-protoc.sh | 61 ++++++++++++++++++++++++++++++++++------ 2 files changed, 66 insertions(+), 12 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index c6296462..2f3ed218 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -32,9 +32,19 @@ $ mvn install 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: +compilers installed. + +You can override the Maven properties ``os.detected.name`` and +``os.detected.arch`` to force the script to generate binaries for a specific OS +and/or architecture. Valid values are defined as the return values of +``normalizeOs()`` and ``normalizeArch()`` of ``Detector`` from +[os-maven-plugin](https://github.com/trustin/os-maven-plugin/blob/master/src/main/java/kr/motd/maven/os/Detector.java). +Frequently used values are: +- ``os.detected.name``: ``linux``, ``osx``, ``windows``. +- ``os.detected.arch``: ``x86_32``, ``x86_64`` + +For example, MingGW32 only ships with 32-bit compilers, but you can still build +32-bit protoc under 64-bit Windows, with the following command: ``` $ mvn install -Dos.detected.arch=x86_32 ``` @@ -48,4 +58,3 @@ Use the following command to upload artifacts: ``` $ mvn clean deploy -P release ``` - diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index f02ed01b..50c4b349 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -7,6 +7,11 @@ OS=$1 ARCH=$2 +if [[ $# < 2 ]]; then + echo "No arguments provided. This script is intended to be run from Maven." + exit 1 +fi + # Under Cygwin, bash doesn't have these in PATH when called from Maven which # runs in Windows version of Java. export PATH="/bin:/usr/bin:$PATH" @@ -17,6 +22,7 @@ export PATH="/bin:/usr/bin:$PATH" E_PARAM_ERR=98 E_ASSERT_FAILED=99 +# Usage: fail() { echo "Error: $1" @@ -38,11 +44,45 @@ assertEq () exit $E_ASSERT_FAILED fi } + +# Checks the artifact is for the expected architecture +# Usage: checkArch +checkArch () +{ + if [[ "$OS" == windows || "$OS" == linux ]]; then + format="$(objdump -f "$1" | grep -o "file format .*$" | grep -o "[^ ]*$")" + if [[ "$OS" == linux ]]; then + if [[ "$ARCH" == x86_32 ]]; then + assertEq $format "elf32-i386" $LINENO + elif [[ "$ARCH" == x86_64 ]]; then + assertEq $format "elf64-x86-64" $LINENO + else + fail "Unsupported arch: $ARCH" + fi + else + # $OS == windows + if [[ "$ARCH" == x86_32 ]]; then + assertEq $format "pei-i386" $LINENO + elif [[ "$ARCH" == x86_64 ]]; then + assertEq $format "pei-x86-64" $LINENO + else + fail "Unsupported arch: $ARCH" + fi + fi + elif [[ "$OS" == osx ]]; then + format="$(file -b "$1" | grep -o "[^ ]*$")" + assertEq $format "x86_64" $LINENO + else + fail "Unsupported system: $(uname)" + fi +} ############################################################################ echo "Building protoc, OS=$OS ARCH=$ARCH" -cd "$(dirname \"$0\")" +# Nested double quotes are unintuitive, but it works. +cd "$(dirname "$0")" + WORKING_DIR=$(pwd) CONFIGURE_ARGS="--disable-shared" @@ -51,6 +91,10 @@ if [[ "$OS" == windows ]]; then MAKE_TARGET="${MAKE_TARGET}.exe" fi +# Override the default value set in configure.ac that has '-g' which produces +# huge binary. +CXXFLAGS="-DNDEBUG" + if [[ "$(uname)" == CYGWIN* ]]; then assertEq "$OS" windows $LINENO # Use mingw32 compilers because executables produced by Cygwin compiler @@ -68,11 +112,11 @@ elif [[ "$(uname)" == MINGW32* ]]; then elif [[ "$(uname)" == Linux* ]]; then assertEq "$OS" linux $LINENO if [[ "$ARCH" == x86_64 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-linux-gnu" + CXXFLAGS="$CXXFLAGS -m64" elif [[ "$ARCH" == x86_32 ]]; then - CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-linux-gnu" + CXXFLAGS="$CXXFLAGS -m32" else - fail "Unsupported arch by CYGWIN: $ARCH" + fail "Unsupported arch: $ARCH" fi elif [[ "$(uname)" == Darwin* ]]; then assertEq "$OS" osx $LINENO @@ -80,9 +124,7 @@ else fail "Unsupported system: $(uname)" fi -# Override the default value set in configure.ac that has '-g' which produces -# huge binary. -export CXXFLAGS="-DNDEBUG" +export CXXFLAGS # Statically link libgcc and libstdc++. # -s to produce stripped binary. @@ -91,7 +133,10 @@ if [[ "$OS" != osx ]]; then export LDFLAGS="-static-libgcc -static-libstdc++ -s" fi +TARGET_FILE=target/protoc.exe + cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && cd src && make clean && make $MAKE_TARGET && cd "$WORKING_DIR" && mkdir -p target && - (cp ../src/protoc target/protoc.exe || cp ../src/protoc.exe target/protoc.exe) + (cp ../src/protoc $TARGET_FILE || cp ../src/protoc.exe $TARGET_FILE) && + checkArch $TARGET_FILE -- cgit v1.2.3 From c5a2a7c3dba6a90a52689277d5a4eb08a5a383d2 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Mon, 6 Apr 2015 14:31:29 -0700 Subject: Process to deploy artifacts for multiple platforms into a single release. - Do not close the staging repository automatically - Added staging.repository property - Updated README with instructions for deployment - Fix building 32-bit Mac artifact --- protoc-artifacts/README.md | 57 +++++++++++++++++++++++++++++++++++++++- protoc-artifacts/build-protoc.sh | 15 ++++++++++- protoc-artifacts/pom.xml | 5 ++++ 3 files changed, 75 insertions(+), 2 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index 2f3ed218..8768a05b 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -54,7 +54,62 @@ 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: +You need to perform the deployment for every platform that you want to +suppport. DO NOT close the staging repository until you have done the +deployment for all platforms. + +Remove any ``SNAPSHOT`` or ``pre`` suffix from the version string before +deploying. + +Use the following command to deploy artifacts for the host platform to a +staging repository. ``` $ mvn clean deploy -P release ``` +It creates a new staging repository. Go to +https://oss.sonatype.org/#stagingRepositories and find the repository, usually +in the name like ``comgoogle-123``. + +You will want to run this command on a different platform. Remember, in +subsequent deployments you will need to provide the repository name that you +have found in the first deployment so that all artifacts go to the same +repository: +``` +$ mvn clean deploy -P release -Dstaging.repository=comgoogle-123 +``` + +A 32-bit artifact can be deployed from a 64-bit host with +``-Dos.detected.arch=x86_32`` + +When you have done deployment for all platforms, go to +https://oss.sonatype.org/#stagingRepositories, verify that the staging +repository has all the binaries, close and release this repository. + +### Tips for deploying on Windows +Under Windows the following error may occur: ``gpg: cannot open tty `no tty': +No such file or directory``. This can be fixed by configuring gpg through an +active profile in ``.m2\settings.xml`` where also the Sonatype password is +stored: +```xml + + + + ossrh + [username] + [password] + + + + + gpg + + gpg + [password] + + + + + gpg + + +``` diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 50c4b349..714b1bec 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -71,7 +71,13 @@ checkArch () fi elif [[ "$OS" == osx ]]; then format="$(file -b "$1" | grep -o "[^ ]*$")" - assertEq $format "x86_64" $LINENO + if [[ "$ARCH" == x86_32 ]]; then + assertEq $format "i386" $LINENO + elif [[ "$ARCH" == x86_64 ]]; then + assertEq $format "x86_64" $LINENO + else + fail "Unsupported arch: $ARCH" + fi else fail "Unsupported system: $(uname)" fi @@ -120,6 +126,13 @@ elif [[ "$(uname)" == Linux* ]]; then fi elif [[ "$(uname)" == Darwin* ]]; then assertEq "$OS" osx $LINENO + if [[ "$ARCH" == x86_64 ]]; then + CXXFLAGS="$CXXFLAGS -m64" + elif [[ "$ARCH" == x86_32 ]]; then + CXXFLAGS="$CXXFLAGS -m32" + else + fail "Unsupported arch: $ARCH" + fi else fail "Unsupported system: $(uname)" fi diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 7db7b53d..6cfcf057 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -90,6 +90,9 @@ release + + + @@ -114,7 +117,9 @@ sonatype-nexus-staging https://oss.sonatype.org/ + true false + ${staging.repository} -- cgit v1.2.3 From c6792363667c7ade6561f9e2736696a5c5bf2612 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Tue, 7 Apr 2015 17:18:46 -0700 Subject: List the platforms that we currently support. Document staging.repository. --- protoc-artifacts/README.md | 7 ++++++- protoc-artifacts/pom.xml | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index 8768a05b..3a530197 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -56,7 +56,12 @@ configure GPG and Sonatype account. You need to perform the deployment for every platform that you want to suppport. DO NOT close the staging repository until you have done the -deployment for all platforms. +deployment for all platforms. Currently the following platforms are supported: +- Linux (x86_32 and x86_64) +- Windows (x86_32 and x86_64) with + - Cygwin with MinGW compilers (both x86_32 and x86_64) + - MSYS with MinGW32 (x86_32 only) +- MacOSX (x86_32 and x86_64) Remove any ``SNAPSHOT`` or ``pre`` suffix from the version string before deploying. diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 6cfcf057..fad81b57 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -91,6 +91,11 @@ release + -- cgit v1.2.3 From 6f2bc19bb3401389b71b515a03fb7c144127efee Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Tue, 7 Apr 2015 20:43:20 -0700 Subject: Add cross-compilation for Windows on Linux using MinGW. Check library dependencies of artifact --- protoc-artifacts/build-protoc.sh | 82 ++++++++++++++++++++++++++++++++++------ 1 file changed, 70 insertions(+), 12 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 714b1bec..686010c0 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -25,7 +25,8 @@ E_ASSERT_FAILED=99 # Usage: fail() { - echo "Error: $1" + echo "ERROR: $1" + echo exit $E_ASSERT_FAILED } @@ -49,8 +50,11 @@ assertEq () # Usage: checkArch checkArch () { + echo + echo "Checking for file format ..." if [[ "$OS" == windows || "$OS" == linux ]]; then format="$(objdump -f "$1" | grep -o "file format .*$" | grep -o "[^ ]*$")" + echo Format=$format if [[ "$OS" == linux ]]; then if [[ "$ARCH" == x86_32 ]]; then assertEq $format "elf32-i386" $LINENO @@ -71,6 +75,7 @@ checkArch () fi elif [[ "$OS" == osx ]]; then format="$(file -b "$1" | grep -o "[^ ]*$")" + echo Format=$format if [[ "$ARCH" == x86_32 ]]; then assertEq $format "i386" $LINENO elif [[ "$ARCH" == x86_64 ]]; then @@ -79,8 +84,45 @@ checkArch () fail "Unsupported arch: $ARCH" fi else - fail "Unsupported system: $(uname)" + fail "Unsupported system: $OS" fi + echo +} + +# Checks the dependencies of the artifact. Artifacts should only depend on +# system libraries. +# Usage: checkDependencies +checkDependencies () +{ + if [[ "$OS" == windows ]]; then + dump_cmd='objdump -x '"$1"' | fgrep "DLL Name"' + white_list="KERNEL32\.dll\|msvcrt\.dll" + elif [[ "$OS" == linux ]]; then + dump_cmd='ldd '"$1" + if [[ "$ARCH" == x86_32 ]]; then + white_list="linux-gate\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux\.so\.2" + elif [[ "$ARCH" == x86_64 ]]; then + white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2" + fi + elif [[ "$OS" == osx ]]; then + dump_cmd='otool -L '"$1" + white_list="libz\.1\.dylib\|libc++\.1\.dylib\|libSystem\.B\.dylib" + fi + if [[ -z "$white_list" || -z "$dump_cmd" ]]; then + fail "Unsupported platform $OS-$ARCH." + fi + echo "Checking for expected dependencies ..." + eval $dump_cmd | grep -i "$white_list" || fail "doesn't show any expected dependencies" + echo "Checking for unexpected dependencies ..." + eval $dump_cmd | grep -i -v "$white_list" + ret=$? + if [[ $ret == 0 ]]; then + fail "found unexpected dependencies (listed above)." + elif [[ $ret != 1 ]]; then + fail "Error when checking dependencies." + fi # grep returns 1 when "not found", which is what we expect + echo "Dependencies look good." + echo } ############################################################################ @@ -100,6 +142,7 @@ fi # Override the default value set in configure.ac that has '-g' which produces # huge binary. CXXFLAGS="-DNDEBUG" +LDFLAGS="" if [[ "$(uname)" == CYGWIN* ]]; then assertEq "$OS" windows $LINENO @@ -116,13 +159,28 @@ elif [[ "$(uname)" == MINGW32* ]]; then assertEq "$OS" windows $LINENO assertEq "$ARCH" x86_32 $LINENO elif [[ "$(uname)" == Linux* ]]; then - assertEq "$OS" linux $LINENO - if [[ "$ARCH" == x86_64 ]]; then - CXXFLAGS="$CXXFLAGS -m64" - elif [[ "$ARCH" == x86_32 ]]; then - CXXFLAGS="$CXXFLAGS -m32" + if [[ "$OS" == linux ]]; then + if [[ "$ARCH" == x86_64 ]]; then + CXXFLAGS="$CXXFLAGS -m64" + elif [[ "$ARCH" == x86_32 ]]; then + CXXFLAGS="$CXXFLAGS -m32" + else + fail "Unsupported arch: $ARCH" + fi + elif [[ "$OS" == windows ]]; then + # Cross-compilation for Windows + # TODO(zhangkun83) MinGW 64 always adds dependency on libwinpthread-1.dll, + # which is undesirable for repository deployment. + CONFIGURE_ARGS="$CONFIGURE_ARGS" + if [[ "$ARCH" == x86_64 ]]; then + CONFIGURE_ARGS="$CONFIGURE_ARGS --host=x86_64-w64-mingw32" + elif [[ "$ARCH" == x86_32 ]]; then + CONFIGURE_ARGS="$CONFIGURE_ARGS --host=i686-w64-mingw32" + else + fail "Unsupported arch: $ARCH" + fi else - fail "Unsupported arch: $ARCH" + fail "Cannot build $OS on $(uname)" fi elif [[ "$(uname)" == Darwin* ]]; then assertEq "$OS" osx $LINENO @@ -137,19 +195,19 @@ else fail "Unsupported system: $(uname)" fi -export CXXFLAGS - # Statically link libgcc and libstdc++. # -s to produce stripped binary. # And they don't work under Mac. if [[ "$OS" != osx ]]; then - export LDFLAGS="-static-libgcc -static-libstdc++ -s" + LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++ -s" fi +export CXXFLAGS LDFLAGS + TARGET_FILE=target/protoc.exe cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && cd src && make clean && make $MAKE_TARGET && cd "$WORKING_DIR" && mkdir -p target && (cp ../src/protoc $TARGET_FILE || cp ../src/protoc.exe $TARGET_FILE) && - checkArch $TARGET_FILE + checkArch $TARGET_FILE && checkDependencies $TARGET_FILE -- cgit v1.2.3 From 5c265faedbd93d867871c8739ae46e8f7f347434 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Tue, 7 Apr 2015 21:06:37 -0700 Subject: Fix osx dependency check. otool prints the file name in the first line. Should skip it --- protoc-artifacts/build-protoc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 686010c0..4027f11e 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -51,7 +51,7 @@ assertEq () checkArch () { echo - echo "Checking for file format ..." + echo "Checking file format ..." if [[ "$OS" == windows || "$OS" == linux ]]; then format="$(objdump -f "$1" | grep -o "file format .*$" | grep -o "[^ ]*$")" echo Format=$format @@ -105,7 +105,7 @@ checkDependencies () white_list="linux-vdso\.so\.1\|libpthread\.so\.0\|libm\.so\.6\|libc\.so\.6\|ld-linux-x86-64\.so\.2" fi elif [[ "$OS" == osx ]]; then - dump_cmd='otool -L '"$1" + dump_cmd='otool -L '"$1"' | fgrep dylib' white_list="libz\.1\.dylib\|libc++\.1\.dylib\|libSystem\.B\.dylib" fi if [[ -z "$white_list" || -z "$dump_cmd" ]]; then -- cgit v1.2.3 From 62903ec0753c59728145bc8959db3c2b028f8eee Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Wed, 8 Apr 2015 00:14:36 -0700 Subject: Make the osx binary compatible with 10.7 and later --- protoc-artifacts/build-protoc.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 4027f11e..10c13074 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -106,7 +106,7 @@ checkDependencies () fi elif [[ "$OS" == osx ]]; then dump_cmd='otool -L '"$1"' | fgrep dylib' - white_list="libz\.1\.dylib\|libc++\.1\.dylib\|libSystem\.B\.dylib" + white_list="libz\.1\.dylib\|libstdc++\.6\.dylib\|libSystem\.B\.dylib" fi if [[ -z "$white_list" || -z "$dump_cmd" ]]; then fail "Unsupported platform $OS-$ARCH." @@ -184,6 +184,8 @@ elif [[ "$(uname)" == Linux* ]]; then fi elif [[ "$(uname)" == Darwin* ]]; then assertEq "$OS" osx $LINENO + # Make the binary compatible with OSX 10.7 and later + CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.7" if [[ "$ARCH" == x86_64 ]]; then CXXFLAGS="$CXXFLAGS -m64" elif [[ "$ARCH" == x86_32 ]]; then -- cgit v1.2.3 From 1c12612bad4e44beae09c43ea1171183d21aea49 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Wed, 8 Apr 2015 10:39:21 -0700 Subject: Strip Mac artifacts --- protoc-artifacts/build-protoc.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 10c13074..96ca97c2 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -211,5 +211,12 @@ TARGET_FILE=target/protoc.exe cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && cd src && make clean && make $MAKE_TARGET && cd "$WORKING_DIR" && mkdir -p target && - (cp ../src/protoc $TARGET_FILE || cp ../src/protoc.exe $TARGET_FILE) && - checkArch $TARGET_FILE && checkDependencies $TARGET_FILE + (cp ../src/protoc $TARGET_FILE || cp ../src/protoc.exe $TARGET_FILE) || + exit 1 + +if [[ "$OS" == osx ]]; then + # Since Mac linker doesn't accept "-s", we need to run strip + strip $TARGET_FILE || exit 1 +fi + +checkArch $TARGET_FILE && checkDependencies $TARGET_FILE -- cgit v1.2.3 From 90a7ed6fcc0891b0cf1d92c5c418990e35a6b5a7 Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Thu, 16 Apr 2015 17:30:07 -0700 Subject: A few fix-ups. 1. make google/protobuf/stubs/pbconfig.h before making protoc, otherwise it won't build a freshly checked-out code. 2. Document the build environments that have been tested to work. 3. Add support for MINGW64 --- protoc-artifacts/README.md | 10 +++++++--- protoc-artifacts/build-protoc.sh | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index 3a530197..1ed1435e 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -63,9 +63,6 @@ deployment for all platforms. Currently the following platforms are supported: - MSYS with MinGW32 (x86_32 only) - MacOSX (x86_32 and x86_64) -Remove any ``SNAPSHOT`` or ``pre`` suffix from the version string before -deploying. - Use the following command to deploy artifacts for the host platform to a staging repository. ``` @@ -118,3 +115,10 @@ stored: ``` + +### Tested build environments +We have succesfully built artifacts on the following environments: +- Linux x86_32 and x86_64: Ubuntu 14.04.2 64-bit +- Windows x86_32: MSYS with ``mingw32-gcc-g++ 4.8.1-4`` on Windows 7 64-bit +- Windows x86_64: Cygwin64 with ``mingw64-x86_64-gcc-g++ 4.8.3-1`` on Windows 7 64-bit +- Mac OS X x86_32 and x86_64: Mac OS X 10.9.5 diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 96ca97c2..2f67c508 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -158,6 +158,9 @@ if [[ "$(uname)" == CYGWIN* ]]; then elif [[ "$(uname)" == MINGW32* ]]; then assertEq "$OS" windows $LINENO assertEq "$ARCH" x86_32 $LINENO +elif [[ "$(uname)" == MINGW64* ]]; then + assertEq "$OS" windows $LINENO + assertEq "$ARCH" x86_64 $LINENO elif [[ "$(uname)" == Linux* ]]; then if [[ "$OS" == linux ]]; then if [[ "$ARCH" == x86_64 ]]; then @@ -209,7 +212,7 @@ export CXXFLAGS LDFLAGS TARGET_FILE=target/protoc.exe cd "$WORKING_DIR"/.. && ./configure $CONFIGURE_ARGS && - cd src && make clean && make $MAKE_TARGET && + cd src && make clean && make google/protobuf/stubs/pbconfig.h $MAKE_TARGET && cd "$WORKING_DIR" && mkdir -p target && (cp ../src/protoc $TARGET_FILE || cp ../src/protoc.exe $TARGET_FILE) || exit 1 -- cgit v1.2.3 From 2aaf5c603a84a3f8ceaf2b871421f35f3914289f Mon Sep 17 00:00:00 2001 From: Kun Zhang Date: Mon, 11 May 2015 17:13:59 -0700 Subject: Dockerfile for building protoc on Centos 6.6 --- protoc-artifacts/Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ protoc-artifacts/README.md | 21 ++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 protoc-artifacts/Dockerfile (limited to 'protoc-artifacts') diff --git a/protoc-artifacts/Dockerfile b/protoc-artifacts/Dockerfile new file mode 100644 index 00000000..fd35b89f --- /dev/null +++ b/protoc-artifacts/Dockerfile @@ -0,0 +1,40 @@ +FROM centos:6.6 + +RUN yum install -y git \ + tar \ + wget \ + make \ + autoconf \ + curl-devel \ + unzip \ + automake \ + libtool \ + glibc-static.i686 \ + glibc-devel \ + glibc-devel.i686 + +# Install Java 8 +RUN wget -q --no-cookies --no-check-certificate \ + --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz" \ + -O - | tar xz -C /var/local +ENV JAVA_HOME /var/local/jdk1.8.0_45 +ENV PATH $JAVA_HOME/bin:$PATH + +# Install Maven +RUN wget -q http://apache.cs.utah.edu/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz -O - | \ + tar xz -C /var/local +ENV PATH /var/local/apache-maven-3.3.3/bin:$PATH + +# Install GCC 4.7 to support -static-libstdc++ +RUN wget http://people.centos.org/tru/devtools-1.1/devtools-1.1.repo -P /etc/yum.repos.d +RUN bash -c 'echo "enabled=1" >> /etc/yum.repos.d/devtools-1.1.repo' +RUN bash -c "sed -e 's/\$basearch/i386/g' /etc/yum.repos.d/devtools-1.1.repo > /etc/yum.repos.d/devtools-i386-1.1.repo" +RUN sed -e 's/testing-/testing-i386-/g' -i /etc/yum.repos.d/devtools-i386-1.1.repo +RUN yum install -y devtoolset-1.1 \ + devtoolset-1.1-libstdc++-devel \ + devtoolset-1.1-libstdc++-devel.i686 + +RUN git clone --depth 1 https://github.com/google/protobuf.git + +# Start in devtoolset environment that uses GCC 4.7 +CMD ["scl", "enable", "devtoolset-1.1", "bash"] diff --git a/protoc-artifacts/README.md b/protoc-artifacts/README.md index 1ed1435e..06091cfe 100644 --- a/protoc-artifacts/README.md +++ b/protoc-artifacts/README.md @@ -87,6 +87,23 @@ When you have done deployment for all platforms, go to https://oss.sonatype.org/#stagingRepositories, verify that the staging repository has all the binaries, close and release this repository. +### Tips for deploying on Linux +We build on Centos 6.6 to provide a good compatibility for not very new +systems. We have provided a ``Dockerfile`` under this directory to build the +environment. It has been tested with Docker 1.6.1. + +To build a image: +``` +$ docker build -t protoc-artifacts . +``` + +To run the image: +``` +$ docker run -it --rm=true protoc-artifacts +``` + +The Protobuf repository has been cloned into ``/protobuf``. + ### Tips for deploying on Windows Under Windows the following error may occur: ``gpg: cannot open tty `no tty': No such file or directory``. This can be fixed by configuring gpg through an @@ -118,7 +135,9 @@ stored: ### Tested build environments We have succesfully built artifacts on the following environments: -- Linux x86_32 and x86_64: Ubuntu 14.04.2 64-bit +- Linux x86_32 and x86_64: + - Centos 6.6 (within Docker 1.6.1) + - Ubuntu 14.04.2 64-bit - Windows x86_32: MSYS with ``mingw32-gcc-g++ 4.8.1-4`` on Windows 7 64-bit - Windows x86_64: Cygwin64 with ``mingw64-x86_64-gcc-g++ 4.8.3-1`` on Windows 7 64-bit - Mac OS X x86_32 and x86_64: Mac OS X 10.9.5 -- cgit v1.2.3 From 9839c0c2c964f2c3881be042758536e9bd68bd8a Mon Sep 17 00:00:00 2001 From: teboring Date: Fri, 22 May 2015 22:22:21 -0700 Subject: Update version number to 3.0.0-alpha-3 --- configure.ac | 2 +- java/pom.xml | 4 ++-- javanano/pom.xml | 4 ++-- protoc-artifacts/pom.xml | 2 +- python/google/protobuf/__init__.py | 2 +- ruby/Gemfile.lock | 2 +- ruby/google-protobuf.gemspec | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'protoc-artifacts') diff --git a/configure.ac b/configure.ac index 8338c18d..92bc0471 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.0.0-alpha-3-pre],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.0.0-alpha-3],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/java/pom.xml b/java/pom.xml index 112bd9c3..cb41977c 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf protobuf-java - 3.0.0-alpha-3-pre + 3.0.0-alpha-3 bundle Protocol Buffer Java API @@ -164,7 +164,7 @@ https://developers.google.com/protocol-buffers/ com.google.protobuf - com.google.protobuf;version=3.0.0-alpha-3-pre + com.google.protobuf;version=3.0.0-alpha-3 diff --git a/javanano/pom.xml b/javanano/pom.xml index 3d8cfb9f..73496779 100644 --- a/javanano/pom.xml +++ b/javanano/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf.nano protobuf-javanano - 3.0.0-alpha-3-pre + 3.0.0-alpha-3 bundle Protocol Buffer JavaNano API @@ -165,7 +165,7 @@ https://developers.google.com/protocol-buffers/ com.google.protobuf - com.google.protobuf;version=3.0.0-alpha-3-pre + com.google.protobuf;version=3.0.0-alpha-3 diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index fad81b57..28ba0049 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf protoc - 3.0.0-alpha-3-pre + 3.0.0-alpha-3 pom Protobuf Compiler diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 1345bd5f..46d29fa4 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -32,4 +32,4 @@ # # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.0.0a3.dev0' +__version__ = '3.0.0a3' diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock index 6f349276..2cf5e472 100644 --- a/ruby/Gemfile.lock +++ b/ruby/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - google-protobuf (3.0.0.alpha.3.1.pre) + google-protobuf (3.0.0.alpha.3) GEM remote: https://rubygems.org/ diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 28cdebf5..3f98a37b 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.0.0.alpha.3.1.pre" + s.version = "3.0.0.alpha.3" s.licenses = ["BSD"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." -- cgit v1.2.3 From e107e2d68edb550bc7763db2cbbc463ae264dcce Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Fri, 29 May 2015 11:00:57 -0700 Subject: Update version number to 3.0.0-alpha-4 --- configure.ac | 2 +- java/pom.xml | 2 +- javanano/pom.xml | 2 +- protoc-artifacts/pom.xml | 2 +- python/google/protobuf/__init__.py | 2 +- ruby/google-protobuf.gemspec | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'protoc-artifacts') diff --git a/configure.ac b/configure.ac index 4e1c0d24..8018cc75 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ AC_PREREQ(2.59) # In the SVN trunk, the version should always be the next anticipated release # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # the size of one file name in the dist tarfile over the 99-char limit.) -AC_INIT([Protocol Buffers],[3.0.0-alpha-3],[protobuf@googlegroups.com],[protobuf]) +AC_INIT([Protocol Buffers],[3.0.0-alpha-4-pre],[protobuf@googlegroups.com],[protobuf]) AM_MAINTAINER_MODE([enable]) diff --git a/java/pom.xml b/java/pom.xml index cb41977c..f0969db7 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf protobuf-java - 3.0.0-alpha-3 + 3.0.0-alpha-4-pre bundle Protocol Buffer Java API diff --git a/javanano/pom.xml b/javanano/pom.xml index 73496779..3b3813ab 100644 --- a/javanano/pom.xml +++ b/javanano/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf.nano protobuf-javanano - 3.0.0-alpha-3 + 3.0.0-alpha-4-pre bundle Protocol Buffer JavaNano API diff --git a/protoc-artifacts/pom.xml b/protoc-artifacts/pom.xml index 28ba0049..52a7d2d6 100644 --- a/protoc-artifacts/pom.xml +++ b/protoc-artifacts/pom.xml @@ -10,7 +10,7 @@ com.google.protobuf protoc - 3.0.0-alpha-3 + 3.0.0-alpha-4-pre pom Protobuf Compiler diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py index 46d29fa4..3f67dfc7 100755 --- a/python/google/protobuf/__init__.py +++ b/python/google/protobuf/__init__.py @@ -32,4 +32,4 @@ # # Copyright 2007 Google Inc. All Rights Reserved. -__version__ = '3.0.0a3' +__version__ = '3.0.0a4.dev0' diff --git a/ruby/google-protobuf.gemspec b/ruby/google-protobuf.gemspec index 3f98a37b..a9e570ec 100644 --- a/ruby/google-protobuf.gemspec +++ b/ruby/google-protobuf.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = "google-protobuf" - s.version = "3.0.0.alpha.3" + s.version = "3.0.0.alpha.4.0.pre" s.licenses = ["BSD"] s.summary = "Protocol Buffers" s.description = "Protocol Buffers are Google's data interchange format." -- cgit v1.2.3