fix clean builds

This commit is contained in:
Eric House 2014-04-18 19:25:40 -07:00
parent dbc42c3ad2
commit e0404801ba
2 changed files with 18 additions and 15 deletions

View file

@ -18,7 +18,8 @@
</target> </target>
<target name="my-pre-build"> <target name="my-pre-build">
<exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null"> <exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null"
failonerror="true">
<arg value="${build.target}"/> <arg value="${build.target}"/>
</exec> </exec>
@ -53,8 +54,8 @@
> >
<arg value="${VARIANT_NAME}"/> <arg value="${VARIANT_NAME}"/>
</exec> </exec>
<exec dir=".." executable="./scripts/genvers.sh" output="ant_out.txt"> <exec dir="." executable="../scripts/genvers.sh" output="ant_out.txt"
<arg value="${APP_NAME}"/> failonerror="true">
<arg value="${VARIANT_NAME}"/> <arg value="${VARIANT_NAME}"/>
<arg value="${INITIAL_CLIENT_VERS}" /> <arg value="${INITIAL_CLIENT_VERS}" />
<arg value="${CHAT_ENABLED}" /> <arg value="${CHAT_ENABLED}" />

View file

@ -2,21 +2,21 @@
set -e -u set -e -u
DIR=$1 VARIANT=$1
VARIANT=$2 CLIENT_VERS_RELAY=$2
CLIENT_VERS_RELAY=$3 CHAT_SUPPORTED=$3
CHAT_SUPPORTED=$4 THUMBNAIL_SUPPORTED=$4
THUMBNAIL_SUPPORTED=$5
BUILD_DIR=$(basename $(pwd))
cd $(dirname $0) cd $(dirname $0)
cd ../../ cd ../
GITVERSION=$(scripts/gitversion.sh) GITVERSION=$(../scripts/gitversion.sh)
# TODO: deal with case where there's no hash available -- exported # TODO: deal with case where there's no hash available -- exported
# code maybe? Better: gitversion.sh does that. # code maybe? Better: gitversion.sh does that.
cat <<EOF > android/${DIR}/res/values/git_string.xml cat <<EOF > ${BUILD_DIR}/res/values/git_string.xml
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- auto-generated; do not edit --> <!-- auto-generated; do not edit -->
@ -29,7 +29,7 @@ EOF
# the way to mark a release # the way to mark a release
SHORTVERS="$(git describe --always $GITVERSION 2>/dev/null || echo unknown)" SHORTVERS="$(git describe --always $GITVERSION 2>/dev/null || echo unknown)"
cat <<EOF > android/${DIR}/src/org/eehouse/android/${VARIANT}/BuildConstants.java cat <<EOF > ${BUILD_DIR}/src/org/eehouse/android/${VARIANT}/BuildConstants.java
// auto-generated; do not edit // auto-generated; do not edit
package org.eehouse.android.${VARIANT}; package org.eehouse.android.${VARIANT};
class BuildConstants { class BuildConstants {
@ -44,6 +44,8 @@ EOF
# touch the files that depend on git_string.xml. (I'm not sure that # touch the files that depend on git_string.xml. (I'm not sure that
# this list is complete or if ant and java always get dependencies # this list is complete or if ant and java always get dependencies
# right. Clean builds are the safest.) # right. Clean builds are the safest.)
touch android/${DIR}/res/xml/xwprefs.xml touch ${BUILD_DIR}/res/xml/xwprefs.xml
touch android/${DIR}/gen/org/eehouse/android/${VARIANT}/R.java echo "touched ${BUILD_DIR}/res/xml/xwprefs.xml"
touch android/${DIR}/src/org/eehouse/android/${VARIANT}/Utils.java mkdir -p ${BUILD_DIR}/gen/org/eehouse/android/${VARIANT}
touch ${BUILD_DIR}/gen/org/eehouse/android/${VARIANT}/R.java
touch ${BUILD_DIR}/src/org/eehouse/android/${VARIANT}/Utils.java