/ld27

To get this branch, use:
bzr branch http://9ix.org/bzr/ld27
40 by Josh C
android build script
1
#!/bin/sh
2
3
export LAS2=$HOME/code/love-android-sdl2
4
5
export ANDROID_SDK=$HOME/Downloads/android-sdk-linux
6
export ANDROID_NDK=$HOME/Downloads/android-ndk-r9d
7
export ANDROID_SWT=/usr/share/java
8
export ANDROID_HOME=${ANDROID_SDK}
9
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_NDK
10
11
echo "checking device..."
12
if [ "`adb get-state`" != 'device' ]; then
13
    echo "device not connected"
14
    echo "adb connect 192.168.1.117 (or similar)"
15
    exit 1
16
fi
17
18
while getopts "dn" opt; do
19
    case $opt in
20
        d) DEV=true ;;
21
        n) NOPUSH=true ;;
22
    esac
23
done
24
25
# make the love file
26
V=`bzr version-info --custom --template={revno}`
27
echo "VERSION = '$V'" >version.lua
28
rm -f deploy/decimaze.love
29
bzr ls -RV |zip -q@ deploy/decimaze.love
30
bzr revert --no-backup version.lua
31
32
#zip deploy/decimaze.love inspect.lua
33
grep 'LOVEBIRD = true' main.lua && zip deploy/decimaze.love lovebird.lua
34
35
36
if [ $DEV ]; then
37
    adb push deploy/decimaze.love /sdcard/Download/
38
    adb shell "am start -S -n org.love2d.android/.GameActivity -d file:///sdcard/Download/decimaze.love || am start -n org.love2d.android/.GameActivity -d file:///sdcard/Download/decimaze.love"
39
    exit 0
40
fi
41
42
cp deploy/decimaze.love $LAS2/assets/game.love
43
44
#mv $LAS2/AndroidManifest.xml /tmp/
45
#cp ouya/AndroidManifest.xml $LAS2/
46
#mkdir -p $LAS2/src/org9ix/ld26/
47
#cp ouya/GameActivity.java $LAS2/src/org9ix/ld26/
48
#cp ouya/ouya_icon.png $LAS2/res/drawable-xhdpi/
49
50
cd $LAS2
51
ant debug
52
if [ ! $NOPUSH ]; then
53
    adb install -r bin/love_android_sdl2-debug.apk
54
fi
55
56
#mv /tmp/AndroidManifest.xml $LAS2/
57
#rm -r $LAS2/src/org9ix/
58
#rm $LAS2/res/drawable-xhdpi/ouya_icon.png