Merge branch 'android_branch' into android_bt

This commit is contained in:
Eric House 2012-03-05 20:08:43 -08:00
commit fdfbd792f7
7 changed files with 45 additions and 20 deletions

View file

@ -49,6 +49,12 @@
<!-- extension targets. Uncomment the ones where you want to do custom work <!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets --> in between standard targets -->
<target name="-pre-clean">
<exec dir="." executable="../scripts/ndkbuild.sh" output="/dev/null" >
<arg value="clean"/>
</exec>
</target>
<target name="-pre-build"> <target name="-pre-build">
<exec dir="." executable="../scripts/mkvariant.sh" output="/dev/null" > <exec dir="." executable="../scripts/mkvariant.sh" output="/dev/null" >
<arg value="--variant-name"/> <arg value="--variant-name"/>

View file

@ -49,6 +49,12 @@
<!-- extension targets. Uncomment the ones where you want to do custom work <!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets --> in between standard targets -->
<target name="-pre-clean">
<exec dir="." executable="../scripts/ndkbuild.sh" output="/dev/null">
<arg value="clean"/>
</exec>
</target>
<target name="-pre-build"> <target name="-pre-build">
<exec dir="." executable="../scripts/ndkbuild.sh" > <exec dir="." executable="../scripts/ndkbuild.sh" >
<arg value="-j3"/> <arg value="-j3"/>

View file

@ -139,9 +139,9 @@ andMakeBitmap( AndDictionaryCtxt* ctxt, XP_U8 const** ptrp,
} }
JNIEnv* env = ctxt->env; JNIEnv* env = ctxt->env;
bitmap = and_util_makeJBitmap( ctxt->jniutil, nCols, nRows, colors ); jobject tmp = and_util_makeJBitmap( ctxt->jniutil, nCols, nRows, colors );
(*env)->DeleteLocalRef( env, bitmap ); bitmap = (*env)->NewGlobalRef( env, tmp );
bitmap = (*env)->NewGlobalRef( env, bitmap ); (*env)->DeleteLocalRef( env, tmp );
XP_FREE( ctxt->super.mpool, colors ); XP_FREE( ctxt->super.mpool, colors );
#endif #endif
} }

View file

@ -56,9 +56,9 @@ makeJRect( AndDraw* draw, int indx, const XP_Rect* rect )
(*env)->DeleteLocalRef( env, rclass ); (*env)->DeleteLocalRef( env, rclass );
draw->jCache[indx] = (*env)->NewGlobalRef( env, robj );
(*env)->DeleteLocalRef( env, robj ); (*env)->DeleteLocalRef( env, robj );
robj = (*env)->NewGlobalRef( env, robj ); robj = draw->jCache[indx];
draw->jCache[indx] = robj;
} else { } else {
setInt( env, robj, "left", rect->left ); setInt( env, robj, "left", rect->left );
setInt( env, robj, "top", rect->top ); setInt( env, robj, "top", rect->top );
@ -81,9 +81,9 @@ makeDSI( AndDraw* draw, int indx, const DrawScoreInfo* dsi )
dsiobj = (*env)->NewObject( env, rclass, initId ); dsiobj = (*env)->NewObject( env, rclass, initId );
(*env)->DeleteLocalRef( env, rclass ); (*env)->DeleteLocalRef( env, rclass );
draw->jCache[indx] = (*env)->NewGlobalRef( env, dsiobj );
(*env)->DeleteLocalRef( env, dsiobj ); (*env)->DeleteLocalRef( env, dsiobj );
dsiobj = (*env)->NewGlobalRef( env, dsiobj ); dsiobj = draw->jCache[indx];
draw->jCache[indx] = dsiobj;
} }
setInt( env, dsiobj, "playerNum", dsi->playerNum ); setInt( env, dsiobj, "playerNum", dsi->playerNum );

View file

@ -4,30 +4,34 @@ set -u -e
TAGNAME="" TAGNAME=""
FILES="" FILES=""
VARIANT="XWords4"
XW_WWW_PATH=${XW_WWW_PATH:-""} XW_WWW_PATH=${XW_WWW_PATH:-""}
usage() { usage() {
echo "Error: $*" echo "Error: $*"
echo "usage: $0 [--tag <name>] [<package-unsigned.apk>]" >&2 echo "usage: $0 [--tag <name>] [--variant variant] [<package-unsigned.apk>]" >&2
exit 1 exit 1
} }
do_build() { do_build() {
WD=$(pwd) WD=$(pwd)
cd $(dirname $0)/../XWords4/ cd $(dirname $0)/../${VARIANT}/
touch jni/Android.mk
../scripts/ndkbuild.sh -j3
rm -rf bin/ gen/ rm -rf bin/ gen/
ant release ant clean release
cd $WD cd $WD
} }
while [ "$#" -gt 0 ]; do while [ "$#" -gt 0 ]; do
case $1 in case $1 in
--tag) TAGNAME=$2 --tag)
TAGNAME=$2
git describe $TAGNAME || usage "$TAGNAME not a valid git tag" git describe $TAGNAME || usage "$TAGNAME not a valid git tag"
shift shift
;; ;;
--variant)
VARIANT=$2
shift
;;
*) *)
FILES="$1" FILES="$1"
;; ;;

View file

@ -3,13 +3,14 @@
set -e -u set -e -u
usage () { usage () {
echo "usage: $(basename $0) [--tag tagname | --branch branchname]" echo "usage: $(basename $0) [--tag tagname | --branch branchname] [--variant variant]"
echo " # (uses current branch as default)" echo " # (uses current branch as default)"
exit 0 exit 0
} }
TAG="" TAG=""
BRANCH="" BRANCH=""
VARIANT="XWords4"
while [ 0 -lt $# ] ; do while [ 0 -lt $# ] ; do
case $1 in case $1 in
@ -21,6 +22,10 @@ while [ 0 -lt $# ] ; do
BRANCH=$2 BRANCH=$2
shift shift
;; ;;
--variant)
VARIANT=$2
shift
;;
*) *)
usage usage
;; ;;
@ -28,6 +33,8 @@ while [ 0 -lt $# ] ; do
shift shift
done done
echo "VARIANT=$VARIANT"
if [ -n "$TAG" ]; then if [ -n "$TAG" ]; then
if ! git tag | grep -w "$TAG"; then if ! git tag | grep -w "$TAG"; then
echo "tag $TAG not found" echo "tag $TAG not found"
@ -37,7 +44,7 @@ elif [ -z $BRANCH ]; then
BRANCH=$(git branch | grep '^*' | sed 's,^.* ,,') BRANCH=$(git branch | grep '^*' | sed 's,^.* ,,')
fi fi
echo "building with ${TAG}${BRANCH}" echo "building $VARIANT with ${TAG}${BRANCH}"
BUILDIR=/tmp/$(basename $0)_build_$$ BUILDIR=/tmp/$(basename $0)_build_$$
SRCDIR=$(pwd)/$(dirname $0)/../../../ SRCDIR=$(pwd)/$(dirname $0)/../../../
@ -49,9 +56,11 @@ cd $BUILDIR
git clone $SRCDIR BUILD git clone $SRCDIR BUILD
cd BUILD cd BUILD
git checkout ${TAG}${BRANCH} git checkout ${TAG}${BRANCH}
./xwords4/android/scripts/setup_local_props.sh cd ./xwords4/android/${VARIANT}
./xwords4/android/scripts/arelease.sh ../scripts/setup_local_props.sh
cp *.apk /tmp ../scripts/arelease.sh --variant ${VARIANT}
mkdir -p /tmp/releases_${VARIANT}
cp *.apk /tmp/releases_${VARIANT}
cd $CURDIR cd $CURDIR
rm -rf $BUILDIR rm -rf $BUILDIR

View file

@ -7,7 +7,7 @@
<?php <?php
include "pwd.php"; include "pwd.php";
$limit = 10; $limit = 50;
class Column { class Column {
public $colname; public $colname;
@ -87,7 +87,7 @@ function strip_quotes($str) {
function print_date( $str ) { function print_date( $str ) {
$str = strip_quotes( $str ); $str = strip_quotes( $str );
$time = strtotime( $str ); $time = strtotime( $str );
return strftime( "%x@%R", $time ); return strftime( "%y%m%d %R", $time );
} }
$cols = array( new Column("dead", "D", "capitalize", false ), $cols = array( new Column("dead", "D", "capitalize", false ),