[tor-commits] [orbot/master] update ant setup script to get all settings from their original sources

n8fr8 at torproject.org n8fr8 at torproject.org
Thu Jun 25 14:59:58 UTC 2015


commit 3c26f67392dab983e1d53acdb6864da228d914a2
Author: Hans-Christoph Steiner <hans at eds.org>
Date:   Wed Jun 3 16:00:09 2015 -0400

    update ant setup script to get all settings from their original sources
    
    * target comes from project.properties
    
    *
---
 .gitignore          |    4 ++++
 BUILD               |    2 +-
 setup-ant           |   28 ++++++++++++++++++++++++++++
 update-ant-build.sh |    7 -------
 4 files changed, 33 insertions(+), 8 deletions(-)

diff --git a/.gitignore b/.gitignore
index 64134ea..028e6d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,7 @@ builds
 /patches/*
 obj
 releases
+
+# ant build products
+build.xml
+proguard-project.txt
diff --git a/BUILD b/BUILD
index bd53587..625252e 100644
--- a/BUILD
+++ b/BUILD
@@ -54,7 +54,7 @@ into < 1M chunks because some Android devices don't like resources larger than
 
 Now build the Android app
 
-    ./update-ant-build
+    ./setup-ant
 	ant release
 
 This will produce an unsigned Tor package in ./bin/Orbot-unsigned.apk!
diff --git a/setup-ant b/setup-ant
new file mode 100755
index 0000000..fab844e
--- /dev/null
+++ b/setup-ant
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+set -x
+
+if ! which android > /dev/null; then
+    if [ -z $ANDROID_HOME ]; then
+        if [ -e ~/.android/bashrc ]; then
+            . ~/.android/bashrc
+        else
+            echo "'android' not found, ANDROID_HOME must be set!"
+            exit
+        fi
+    else
+        export PATH="${ANDROID_HOME}/tools:$PATH"
+    fi
+fi
+
+# fetch target from project.properties
+eval `grep '^target=' project.properties`
+
+projectname=`sed -n 's,.*name="app_name">\(.*\)<.*,\1,p' res/values/strings.xml`
+
+android update project --path . --name $projectname --target $target --subprojects
+
+for lib in `sed -n 's,^android\.library\.reference\.[0-9][0-9]*=\(.*\),\1,p' project.properties`; do
+    android update lib-project --path $lib --target $target
+done
diff --git a/update-ant-build.sh b/update-ant-build.sh
deleted file mode 100755
index 2fa1bca..0000000
--- a/update-ant-build.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-# make sure your Android SDK tools path is set in SDK_BASE
-android update project -t android-21 --path . --name Orbot --subprojects
-android update lib-project -t android-21 --path external/appcompat
-android update lib-project -t android-21 --path external/superuser-commands/RootCommands-Library/
-android update lib-project -t android-21 --path external/jsocks/jsockslib





More information about the tor-commits mailing list