/ld27

To get this branch, use:
bzr branch http://9ix.org/bzr/ld27

« back to all changes in this revision

Viewing changes to andbuild.sh

  • Committer: Josh C
  • Date: 2014-07-03 15:28:23 UTC
  • Revision ID: josh@9ix.org-20140703152823-4241je58pflhx7ec
scaling

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 '^[^-]*require .lovebird.' main.lua && zip deploy/decimaze.love lovebird.lua
34
 
 
35
 
 
36
 
if [ $DEV ]; then
37
 
    adb push deploy/decimaze.love /sdcard/Download/
38
 
    if adb shell am |grep -- -S; then DASH_S=-S ; fi
39
 
    adb shell am start $DASH_S -n org.love2d.android/.GameActivity -d file:///sdcard/Download/decimaze.love
40
 
    exit 0
41
 
fi
42
 
 
43
 
echo ERROR: not ready for deploying the package yet
44
 
exit 1
45
 
 
46
 
cp deploy/decimaze.love $LAS2/assets/game.love
47
 
 
48
 
#mv $LAS2/AndroidManifest.xml /tmp/
49
 
#cp ouya/AndroidManifest.xml $LAS2/
50
 
#mkdir -p $LAS2/src/org9ix/ld26/
51
 
#cp ouya/GameActivity.java $LAS2/src/org9ix/ld26/
52
 
#cp ouya/ouya_icon.png $LAS2/res/drawable-xhdpi/
53
 
 
54
 
cd $LAS2
55
 
ant debug
56
 
if [ ! $NOPUSH ]; then
57
 
    adb install -r bin/love_android_sdl2-debug.apk
58
 
fi
59
 
 
60
 
#mv /tmp/AndroidManifest.xml $LAS2/
61
 
#rm -r $LAS2/src/org9ix/
62
 
#rm $LAS2/res/drawable-xhdpi/ouya_icon.png