In the spirit of setting constants in only one place, pass

INITIAL_CLIENT_VERS in from build.xml rather than the jni makefile,
and make it available in java world as well.
This commit is contained in:
Eric House 2013-08-20 08:42:12 -07:00
parent 2157706dcd
commit 5197033de3
3 changed files with 7 additions and 2 deletions

View file

@ -49,6 +49,7 @@
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<property name="INITIAL_CLIENT_VERS" value="3"/>
<target name="-pre-clean">
<exec dir="." executable="../scripts/ndkbuild.sh" output="/dev/null">
<arg value="clean"/>
@ -58,6 +59,7 @@
<target name="-pre-build">
<exec dir="." executable="../scripts/ndkbuild.sh" >
<arg value="-j3"/>
<arg value="INITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS}" />
</exec>
<exec dir="." executable="../scripts/gen_gcmid.sh"
output="src/org/eehouse/android/xw4/GCMConsts.java"
@ -66,6 +68,7 @@
<exec dir=".." executable="./scripts/genvers.sh" output="ant_out.txt">
<arg value="XWords4"/>
<arg value="xw4"/>
<arg value="${INITIAL_CLIENT_VERS}" />
</exec>
</target>
<!--

View file

@ -10,7 +10,7 @@ local_C_INCLUDES+= \
local_LDLIBS += -llog
# local_DEBUG = -DMEM_DEBUG -DDEBUG -DENABLE_LOGGING -DCOMMS_CHECKSUM
local_DEBUG = -DMEM_DEBUG -DDEBUG -DENABLE_LOGGING -DCOMMS_CHECKSUM
local_DEFINES += \
$(local_DEBUG) \
-DXWFEATURE_RELAY \
@ -36,7 +36,7 @@ local_DEFINES += \
-DHASH_STREAM \
-DXWFEATURE_BASE64 \
-DXWFEATURE_DEVID \
-DINITIAL_CLIENT_VERS=3 \
-DINITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS} \
-DRELAY_ROOM_DEFAULT=\"\" \
-D__LITTLE_ENDIAN \

View file

@ -4,6 +4,7 @@ set -e -u
DIR=$1
VARIANT=$2
CLIENT_VERS_RELAY=$3
cd $(dirname $0)
cd ../../
@ -31,6 +32,7 @@ cat <<EOF > android/${DIR}/src/org/eehouse/android/${VARIANT}/GitVersion.java
package org.eehouse.android.${VARIANT};
class GitVersion {
public static final String VERS = "$SHORTVERS";
public static final short CLIENT_VERS_RELAY = $CLIENT_VERS_RELAY;
}
EOF