/ld27

To get this branch, use:
bzr branch http://9ix.org/bzr/ld27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh

export LAS2=$HOME/code/love-android-sdl2

export ANDROID_SDK=$HOME/Downloads/android-sdk-linux
export ANDROID_NDK=$HOME/Downloads/android-ndk-r9d
export ANDROID_SWT=/usr/share/java
export ANDROID_HOME=${ANDROID_SDK}
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_NDK

echo "checking device..."
if [ "`adb get-state`" != 'device' ]; then
    echo "device not connected"
    echo "adb connect 192.168.1.117 (or similar)"
    exit 1
fi

while getopts "dn" opt; do
    case $opt in
        d) DEV=true ;;
        n) NOPUSH=true ;;
    esac
done

# make the love file
V=`bzr version-info --custom --template={revno}`
echo "VERSION = '$V'" >version.lua
rm -f deploy/decimaze.love
bzr ls -RV |zip -q@ deploy/decimaze.love
bzr revert --no-backup version.lua

#zip deploy/decimaze.love inspect.lua
grep '^[^-]*require .lovebird.' main.lua && zip deploy/decimaze.love lovebird.lua


if [ $DEV ]; then
    adb push deploy/decimaze.love /sdcard/Download/
    if adb shell am |grep -- -S; then DASH_S=-S ; fi
    adb shell am start $DASH_S -n org.love2d.android/.GameActivity -d file:///sdcard/Download/decimaze.love
    exit 0
fi

echo ERROR: not ready for deploying the package yet
exit 1

cp deploy/decimaze.love $LAS2/assets/game.love

#mv $LAS2/AndroidManifest.xml /tmp/
#cp ouya/AndroidManifest.xml $LAS2/
#mkdir -p $LAS2/src/org9ix/ld26/
#cp ouya/GameActivity.java $LAS2/src/org9ix/ld26/
#cp ouya/ouya_icon.png $LAS2/res/drawable-xhdpi/

cd $LAS2
ant debug
if [ ! $NOPUSH ]; then
    adb install -r bin/love_android_sdl2-debug.apk
fi

#mv /tmp/AndroidManifest.xml $LAS2/
#rm -r $LAS2/src/org9ix/
#rm $LAS2/res/drawable-xhdpi/ouya_icon.png