[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] add standard ./make-release-build script



commit 6989f9b2b018748cb329d84b187fd7c73552da38
Author: Hans-Christoph Steiner <hans@xxxxxxx>
Date:   Thu Jun 4 15:24:05 2015 -0400

    add standard ./make-release-build script
---
 make-release-build |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/make-release-build b/make-release-build
new file mode 100755
index 0000000..0372ee7
--- /dev/null
+++ b/make-release-build
@@ -0,0 +1,76 @@
+#!/bin/bash
+# bash is required because we need bash's printf to guarantee a cross-platform
+# timestamp format.
+
+set -e
+set -x
+
+# make sure we're on a signed tag that matches the version name
+versionName=`sed -n 's,.*versionName="\([^"]*\)".*,\1,p' AndroidManifest.xml`
+describe=`git describe`
+if [ $versionName != $describe ]; then
+    echo "WARNING: building $describe, which is not the latest release ($versionName)"
+else
+    # make a clearer warning above by putting this here
+    set +x
+    echo ""
+    echo ""
+    echo "Checking git tag signature for release build:"
+    git tag -v $versionName
+    echo ""
+    echo ""
+    set -x
+fi
+
+
+if [ -z $ANDROID_HOME ]; then
+    if [ -e ~/.android/bashrc ]; then
+        . ~/.android/bashrc
+    else
+        echo "ANDROID_HOME must be set!"
+        exit
+    fi
+fi
+
+projectroot=`pwd`
+projectname=`sed -n 's,.*name="app_name">\(.*\)<.*,\1,p' res/values/strings.xml`
+
+# standardize timezone to reduce build differences
+export TZ=UTC
+TIMESTAMP=`printf '%(%Y-%m-%d %H:%M:%S)T' \
+    $(git log -n1 --format=format:%at)`
+# run the clock at 5% speed, ant requires a moving clock
+TIMESTAMP_5=`printf '@%(%Y-%m-%d %H:%M:%S)T x0.05' \
+    $(git log -n1 --format=format:%at)`
+
+git reset --hard
+git clean -fdx
+git submodule foreach git reset --hard
+git submodule foreach git clean -fdx
+git submodule sync
+git submodule foreach git submodule sync
+git submodule update --init --recursive
+
+
+if [ -e ~/.android/ant.properties ]; then
+    cp ~/.android/ant.properties $projectroot/
+else
+    echo "skipping release ant.properties"
+fi
+
+faketime "$TIMESTAMP" make -C external
+
+./setup-ant
+faketime -f "$TIMESTAMP_5" ant release
+
+apk=$projectroot/bin/$projectname-v$describe.apk
+
+if which gpg > /dev/null; then
+    if [ -z "`gpg --list-secret-keys`" ]; then
+        echo "No GPG secret keys found, not signing APK"
+    else
+        gpg --armor --detach-sign $apk
+    fi
+else
+    echo "gpg not found, not signing APK"
+fi



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits