aboutsummaryrefslogtreecommitdiffhomepage
path: root/protoc-artifacts
diff options
context:
space:
mode:
authorGravatar Jisi Liu <liujisi@google.com>2016-07-28 14:48:46 -0700
committerGravatar GitHub <noreply@github.com>2016-07-28 14:48:46 -0700
commitde30c5639165f69db0cdfe538d82d13250c274bb (patch)
tree35874b6f9b8ffa60a1402d6a52f4b9a87f41c9b8 /protoc-artifacts
parent2662fd3d0c08310c7bded005ef6c45ee65fb1df2 (diff)
parente3fac65addcf0e6d8db2dae13ec40f7a0ba648e6 (diff)
Merge pull request #1874 from pherl/buildzip
Change the build.zip.sh to support lite
Diffstat (limited to 'protoc-artifacts')
-rwxr-xr-xprotoc-artifacts/build-zip.sh46
1 files changed, 27 insertions, 19 deletions
diff --git a/protoc-artifacts/build-zip.sh b/protoc-artifacts/build-zip.sh
index 054e2ea1..d8686d3b 100755
--- a/protoc-artifacts/build-zip.sh
+++ b/protoc-artifacts/build-zip.sh
@@ -1,26 +1,30 @@
#!/bin/bash
-if [ $# -eq 0 ]; then
+if [ $# -ne 2 ]; then
cat <<EOF
-Usage: $0 <VERSION_NUMBER>
+Usage: $0 <TARGET> <VERSION_NUMBER>
+
+TARGET: protoc | protoc-gen-javalite
Example:
- $ $0 3.0.0-beta-4
+ $ $0 protoc 3.0.0
+ $ $0 protoc-gen-javalite 3.0.0
-This script will download pre-built protoc binaries from maven repository
-and package them with well-known type .proto files to create .zip packages
-suitable to be included in the github release page. Each invocation will
-create 5 zip packages:
- dist/protoc-<VERSION_NUMBER>-win32.zip
- dist/protoc-<VERSION_NUMBER>-osx-x86_32.zip
- dist/protoc-<VERSION_NUMBER>-osx-x86_64.zip
- dist/protoc-<VERSION_NUMBER>-linux-x86_32.zip
- dist/protoc-<VERSION_NUMBER>-linux-x86_64.zip
+This script will download pre-built protoc or protoc plugin binaries from maven
+repository and create .zip packages suitable to be included in the github
+release page. If the target is protoc, well-known type .proto files will also be
+included. Each invocation will create 5 zip packages:
+ dist/<TARGET>-<VERSION_NUMBER>-win32.zip
+ dist/<TARGET>-<VERSION_NUMBER>-osx-x86_32.zip
+ dist/<TARGET>-<VERSION_NUMBER>-osx-x86_64.zip
+ dist/<TARGET>-<VERSION_NUMBER>-linux-x86_32.zip
+ dist/<TARGET>-<VERSION_NUMBER>-linux-x86_64.zip
EOF
exit 1
fi
-VERSION_NUMBER=$1
+TARGET=$1
+VERSION_NUMBER=$2
# <zip file name> <binary file name> pairs.
declare -a FILE_NAMES=( \
@@ -79,16 +83,20 @@ mkdir -p ${DIR}/bin
for((i=0;i<${#FILE_NAMES[@]};i+=2));do
ZIP_NAME=${FILE_NAMES[$i]}
BINARY_NAME=${FILE_NAMES[$(($i+1))]}
- BINARY_URL=http://repo1.maven.org/maven2/com/google/protobuf/protoc/${VERSION_NUMBER}/protoc-${VERSION_NUMBER}-${BINARY_NAME}
- if ! wget ${BINARY_URL} -O ${DIR}/bin/protoc &> /dev/null; then
+ BINARY_URL=http://repo1.maven.org/maven2/com/google/protobuf/$TARGET/${VERSION_NUMBER}/$TARGET-${VERSION_NUMBER}-${BINARY_NAME}
+ if ! wget ${BINARY_URL} -O ${DIR}/bin/$TARGET &> /dev/null; then
echo "[ERROR] Failed to download ${BINARY_URL}" >&2
- echo "[ERROR] Skipped protoc-${VERSION_NAME}-${ZIP_NAME}" >&2
+ echo "[ERROR] Skipped $TARGET-${VERSION_NAME}-${ZIP_NAME}" >&2
continue
fi
- TARGET_ZIP_FILE=`pwd`/dist/protoc-${VERSION_NUMBER}-${ZIP_NAME}
+ TARGET_ZIP_FILE=`pwd`/dist/$TARGET-${VERSION_NUMBER}-${ZIP_NAME}
pushd $DIR &> /dev/null
- chmod +x bin/protoc
- zip -r ${TARGET_ZIP_FILE} include bin readme.txt &> /dev/null
+ chmod +x bin/$TARGET
+ if [ "$TARGET" = "protoc" ]; then
+ zip -r ${TARGET_ZIP_FILE} include bin readme.txt &> /dev/null
+ else
+ zip -r ${TARGET_ZIP_FILE} bin &> /dev/null
+ fi
popd &> /dev/null
echo "[INFO] Successfully created ${TARGET_ZIP_FILE}"
done