summaryrefslogtreecommitdiffstats
path: root/run
blob: 92f47d09b5e8ba9aad96acb41a156d9debd356e6 (plain)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/bash
[ -d out ] && rm -fr out

ARGS="desktop:run"
ALIAS=jeyzu
KEYSTORE="/home/jeyzu/etc/sync/jeyzu-key.keystore"
APK="./android/build/apk/android-release-unsigned.apk"
ZIPALIGN="/opt/android-sdk/build-tools/23.0.3/zipalign"
APK_OUT="./RustAndDust-signed-aligned.apk"
DB_FILES="./android/assets/data/*.sqlite"

function gradlew_do()
{
    echo "./gradlew $ARGS" && ./gradlew $ARGS
}

case "$1" in
    "c")
        shift;
        ARGS="clean assets:build $ARGS"
        gradlew_do
        ;;
    "a")
        shift;
        ARGS="android:installDebug android:run $@"
        gradlew_do
        echo "on failure: sudo adb kill-server; (sudo adb start-server;) sudo adb devices"
        echo "  adb logcat RustAndDust:D *:S"
        ;;
    "r")
        shift;
        ARGS="android:assembleRelease$@"
        gradlew_do
        ;;
    "q")
        shift;
        ARGS="$ARGS $@"
        rm $DB_FILES 2>/dev/null
        gradlew_do
        ;;
    "s")
        shift;
        ARGS="android:assembleRelease$@"
        gradlew_do
        jarsigner -verbose -tsa http://timestamp.digicert.com -sigalg SHA1withRSA -digestalg SHA1 -keystore $KEYSTORE $APK $ALIAS
        jarsigner -verify $APK
        [ -f $APK_OUT ] && rm $APK_OUT
        $ZIPALIGN -v 4 $APK $APK_OUT
        ;;
    "t")
        shift;
        ARGS="core:test $@"
        gradlew_do
        ;;
    "j")
        shift;
        ARGS="core:javadocs ctags $@"
        gradlew_do
        ;;
    "d")
        shift;
        ARGS="desktop:dist $@"
        gradlew_do
        ;;
    "f")
        # java -cp gdx.jar:gdx-natives.jar:gdx-backend-lwjgl.jar:gdx-backend-lwjgl-natives.jar:extensions/gdx-tools/gdx-tools.jar:hiero.jar com.badlogic.gdx.tools.hiero.Hiero
        java -cp ./data/misc/hiero.jar com.badlogic.gdx.tools.hiero.Hiero $@
        exit
        ;;
    *)
        ARGS="$ARGS $@"
        gradlew_do
        ;;
esac