From d0999d194476c4e941bd5133102a0aad42b8c575 Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 2 Jan 2012 18:11:36 -0800 Subject: [PATCH] update build scripts to use newer NDK. --- xwords4/android/XWords4/jni/Android.mk | 2 +- xwords4/android/XWords4/project.properties | 2 +- xwords4/android/scripts/arelease.sh | 9 +++++--- xwords4/android/scripts/ndkbuild.sh | 25 ++++------------------ 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/xwords4/android/XWords4/jni/Android.mk b/xwords4/android/XWords4/jni/Android.mk index 37d25f3f0..4966018aa 100644 --- a/xwords4/android/XWords4/jni/Android.mk +++ b/xwords4/android/XWords4/jni/Android.mk @@ -1,4 +1,4 @@ -# -*- mode: Makefile; compile-command: "../../scripts/ndkbuild.sh"; -*- +# -*- mode: Makefile; compile-command: "cd ../; ${NDK_ROOT}/ndk-build -j3"; -*- LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) diff --git a/xwords4/android/XWords4/project.properties b/xwords4/android/XWords4/project.properties index 0f9958b87..797fb4fc3 100644 --- a/xwords4/android/XWords4/project.properties +++ b/xwords4/android/XWords4/project.properties @@ -10,4 +10,4 @@ # Indicates whether an apk should be generated for each density. split.density=false # Project target. -target=android-5 +target=android-7 diff --git a/xwords4/android/scripts/arelease.sh b/xwords4/android/scripts/arelease.sh index bced9f20b..d10d92031 100755 --- a/xwords4/android/scripts/arelease.sh +++ b/xwords4/android/scripts/arelease.sh @@ -1,5 +1,10 @@ #!/bin/bash +set -u -e + +TAGNAME="" +FILES="" + usage() { echo "Error: $*" echo "usage: $0 [--tag ] []" >&2 @@ -9,7 +14,6 @@ usage() { do_build() { WD=$(pwd) cd $(dirname $0)/../XWords4/ - pwd touch jni/Android.mk ../scripts/ndkbuild.sh rm -rf bin/ gen/ @@ -17,7 +21,7 @@ do_build() { cd $WD } -while [ -n "$1" ]; do +while [ "$#" -gt 0 ]; do case $1 in --tag) TAGNAME=$2 git describe $TAGNAME || usage "$TAGNAME not a valid git tag" @@ -52,7 +56,6 @@ if [ -z "$FILES" ]; then fi for PACK_UNSIGNED in $FILES; do - echo $FILE PACK_SIGNED=$(basename $PACK_UNSIGNED) echo "base: $PACK_SIGNED" diff --git a/xwords4/android/scripts/ndkbuild.sh b/xwords4/android/scripts/ndkbuild.sh index ee75447fd..d0f840723 100755 --- a/xwords4/android/scripts/ndkbuild.sh +++ b/xwords4/android/scripts/ndkbuild.sh @@ -1,33 +1,16 @@ #!/bin/sh -APP=xwords4 - OLDDIR=$(pwd) if [ -z "$NDK_ROOT" ]; then echo -n "NDK_ROOT not set... " - NDK_ROOT="$HOME/android-ndk-1.6_r1" - if [ -d $NDK_ROOT ]; then - echo "using $NDK_ROOT" - else - echo "NDK not found; install and set NDK_ROOT to point to it" - exit 1 - fi + echo "NDK not found; install and set NDK_ROOT to point to it" + exit 1 fi -cd $(dirname $0) -cd ../ +cd $(dirname $0)/../XWords4 -if [ -h $NDK_ROOT/apps/$APP -a $(readlink $NDK_ROOT/apps/$APP) != $(pwd) ]; then - rm $NDK_ROOT/apps/$APP -fi -if [ ! -h $NDK_ROOT/apps/$APP ]; then - echo "adding symlink to apps" - ln -sf $(pwd) $NDK_ROOT/apps/$APP -fi - -cd $NDK_ROOT -make -j3 APP=$APP $* +${NDK_ROOT}/ndk-build $* cd $OLDDIR echo "$0 done"