fix debug tree to build again, this time with a paramaterized common

xml file
This commit is contained in:
Eric House 2014-04-16 21:06:41 -07:00
parent 79dc66b3a7
commit f5f7428683
9 changed files with 139 additions and 133 deletions

View file

@ -70,7 +70,7 @@
android:name=".XWApp"
>
<activity android:name="GamesList"
<activity android:name="GamesListActivity"
android:label="@string/app_name"
android:launchMode="standard"
android:configChanges="keyboardHidden|orientation|screenSize"
@ -103,7 +103,7 @@
android:screenOrientation="portrait"
/>
<activity android:name="GameConfig"
<activity android:name="GameConfigActivity"
android:screenOrientation="sensor"
android:configChanges="keyboardHidden|orientation|screenSize"
>
@ -128,7 +128,7 @@
android:theme="@android:style/Theme.Dialog"
/>
<activity android:name="StudyList"
<activity android:name="StudyListActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
/>
@ -195,6 +195,9 @@
<activity android:name="ChatActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
/>
<activity android:name=".loc.LocActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
/>
<service android:name="RelayService"/>

View file

@ -39,6 +39,9 @@
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- An attempt to define stuff to be included from multiple build.xml files -->
<import file="../scripts/common_targets.xml" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
@ -50,72 +53,11 @@
in between standard targets -->
<property name="INITIAL_CLIENT_VERS" value="3"/>
<target name="-pre-clean">
<exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null">
<arg value="${build.target}"/>
</exec>
<exec dir="." executable="../scripts/ndkbuild.sh" output="/dev/null">
<arg value="clean"/>
</exec>
<target name="-pre-clean" depends="my-pre-clean"/>
<property name="VARIANT_NAME" value="xw4dbg"/>
<property name="APP_NAME" value="cWords-DBG"/>
<target name="-pre-build" depends="my-copy-src,my-pre-build"/>
<exec dir="." executable="../scripts/mkimages.sh"
failonerror="true" >
<arg value="--clean"/>
</exec>
</target>
<target name="-pre-build">
<exec dir="." executable="../scripts/mkvariant.sh" failonerror="true"
output="/dev/null">
<arg value="--variant-name"/>
<arg value="xw4dbg"/>
<arg value="--app-name"/>
<arg value="cWords-DBG"/>
<arg value="--dest-dir"/>
<arg value="./res"/>
<arg value="--dest-dir"/>
<arg value="./src"/>
<arg value="--dest-dir"/>
<arg value="./jni"/>
<arg value="--dest-dir"/>
<arg value="./assets"/>
<arg value="--dest-dir"/>
<arg value="./libs"/>
<arg value="--dest-dir"/>
<arg value="./img_src"/>
</exec>
<exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null">
<arg value="${build.target}"/>
</exec>
<property name="CHAT_ENABLED" value="true" />
<property name="THUMBNAIL_ENABLED" value="true" />
<exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true">
<arg value="BUILD_TARGET=${build.target}" />
<arg value="-j3"/>
<arg value="INITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS}" />
<arg value="CHAT_ENABLED=${CHAT_ENABLED}" />
<arg value="THUMBNAIL_ENABLED=${THUMBNAIL_ENABLED}" />
</exec>
<exec dir="." executable="../scripts/mkimages.sh"
failonerror="true" output="/dev/null"
/>
<exec dir="." executable="../scripts/gen_gcmid.sh"
output="src/org/eehouse/android/xw4dbg/GCMConsts.java"
failonerror="true" logError="true"
>
<arg value="xw4dbg"/>
</exec>
<exec dir=".." executable="./scripts/genvers.sh">
<arg value="XWords4-dbg"/>
<arg value="xw4dbg"/>
<arg value="${INITIAL_CLIENT_VERS}" />
<arg value="${CHAT_ENABLED}" />
<arg value="${THUMBNAIL_ENABLED}" />
</exec>
</target>
<!--
<target name="-pre-compile">
</target>

View file

@ -32,3 +32,5 @@ game_list_group.xml
smsinviter_item.xml
smsinviter.xml
studylist.xml
loc_list_item.xml
loc_main.xml

View file

@ -5,3 +5,4 @@ games_list_item_menu.xml
games_list_menu.xml
dicts_menu.xml
studylist.xml
loc_menu.xml

View file

@ -90,3 +90,15 @@ DlgID.java
GamesListActivity.java
GamesListDelegate.java
LookupAlert.java
BoardDelegate.java
ChatDelegate.java
DictBrowseDelegate.java
DictImportDelegate.java
DictsDelegate.java
DrawSelDelegate.java
GameConfigActivity.java
GameConfigDelegate.java
NewGameDelegate.java
RelayGameDelegate.java
StudyListActivity.java
StudyListDelegate.java

View file

@ -0,0 +1,8 @@
LocActivity.java
LocDelegate.java
LocIDsData.java
LocIDs.java
LocListAdapter.java
LocListItem.java
LocSearcher.java
LocUtils.java

View file

@ -39,6 +39,9 @@
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- An attempt to define stuff to be included from multiple build.xml files -->
<import file="../scripts/common_targets.xml" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
@ -50,64 +53,10 @@
in between standard targets -->
<property name="INITIAL_CLIENT_VERS" value="3"/>
<target name="-pre-clean">
<exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null"
failonerror="true" >
<arg value="${build.target}"/>
</exec>
<exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true" >
<arg value="clean"/>
</exec>
<exec dir="." executable="../scripts/mkimages.sh"
failonerror="true" output="/dev/null" >
<arg value="--clean"/>
</exec>
</target>
<target name="-pre-build">
<exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null">
<arg value="${build.target}"/>
</exec>
<property name="CHAT_ENABLED" value="true" />
<property name="THUMBNAIL_ENABLED" value="true" />
<exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true">
<arg value="BUILD_TARGET=${build.target}" />
<arg value="-j3"/>
<arg value="INITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS}" />
<arg value="CHAT_ENABLED=${CHAT_ENABLED}" />
<arg value="THUMBNAIL_ENABLED=${THUMBNAIL_ENABLED}" />
</exec>
<exec dir="." executable="../scripts/mkimages.sh"
failonerror="true" output="/dev/null"
/>
<exec dir="." executable="../scripts/mk_xml.py"
failonerror="true"
>
<arg value="-o"/>
<arg value="src/org/eehouse/android/xw4/loc/LocIDsData.java"/>
<arg value="-t"/>
<arg value="${build.target}"/>
</exec>
<exec dir="." executable="../scripts/gen_gcmid.sh"
output="src/org/eehouse/android/xw4/GCMConsts.java"
logError="true" failonerror="true"
>
<arg value="xw4"/>
</exec>
<exec dir=".." executable="./scripts/genvers.sh" output="ant_out.txt">
<arg value="XWords4"/>
<arg value="xw4"/>
<arg value="${INITIAL_CLIENT_VERS}" />
<arg value="${CHAT_ENABLED}" />
<arg value="${THUMBNAIL_ENABLED}" />
</exec>
</target>
<target name="-pre-clean" depends="my-pre-clean"/>
<property name="VARIANT_NAME" value="xw4"/>
<property name="APP_NAME" value="Crosswords"/>
<target name="-pre-build" depends="my-pre-build"/>
<!--
<target name="-pre-compile">

View file

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="XWords4">
<target name="my-pre-clean">
<exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null"
failonerror="true" >
<arg value="${build.target}"/>
</exec>
<exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true" >
<arg value="clean"/>
</exec>
<exec dir="." executable="../scripts/mkimages.sh"
failonerror="true" output="/dev/null" >
<arg value="--clean"/>
</exec>
</target>
<target name="my-pre-build">
<exec dir="." executable="../scripts/ndksetup.sh" output="/dev/null">
<arg value="${build.target}"/>
</exec>
<property name="CHAT_ENABLED" value="true" />
<property name="THUMBNAIL_ENABLED" value="true" />
<exec dir="." executable="../scripts/ndkbuild.sh" failonerror="true">
<arg value="BUILD_TARGET=${build.target}" />
<arg value="-j3"/>
<arg value="INITIAL_CLIENT_VERS=${INITIAL_CLIENT_VERS}" />
<arg value="CHAT_ENABLED=${CHAT_ENABLED}" />
<arg value="THUMBNAIL_ENABLED=${THUMBNAIL_ENABLED}" />
</exec>
<exec dir="." executable="../scripts/mkimages.sh"
failonerror="true" output="/dev/null"
/>
<exec dir="." executable="../scripts/mk_xml.py"
failonerror="true"
>
<arg value="-o"/>
<arg value="src/org/eehouse/android/${VARIANT_NAME}/loc/LocIDsData.java"/>
<arg value="-t"/>
<arg value="${build.target}"/>
<arg value="-v"/>
<arg value="${VARIANT_NAME}"/>
</exec>
<exec dir="." executable="../scripts/gen_gcmid.sh"
output="src/org/eehouse/android/${VARIANT_NAME}/GCMConsts.java"
logError="true" failonerror="true"
>
<arg value="${VARIANT_NAME}"/>
</exec>
<exec dir=".." executable="./scripts/genvers.sh" output="ant_out.txt">
<arg value="${APP_NAME}"/>
<arg value="${VARIANT_NAME}"/>
<arg value="${INITIAL_CLIENT_VERS}" />
<arg value="${CHAT_ENABLED}" />
<arg value="${THUMBNAIL_ENABLED}" />
</exec>
</target>
<target name="my-copy-src">
<exec dir="." executable="../scripts/mkvariant.sh" failonerror="true"
output="/dev/null">
<arg value="--variant-name"/>
<arg value="${VARIANT_NAME}"/>
<arg value="--app-name"/>
<arg value="${APP_NAME}"/>
<arg value="--dest-dir"/>
<arg value="./res"/>
<arg value="--dest-dir"/>
<arg value="./src"/>
<arg value="--dest-dir"/>
<arg value="./jni"/>
<arg value="--dest-dir"/>
<arg value="./assets"/>
<arg value="--dest-dir"/>
<arg value="./libs"/>
<arg value="--dest-dir"/>
<arg value="./img_src"/>
</exec>
</target>
</project>

View file

@ -78,7 +78,7 @@ def checkText( text ):
seen.add( digit )
return text
def printStrings( pairs, outfile, target ):
def printStrings( pairs, outfile, target, variant ):
match = CLASS_NAME.match(outfile)
if not match:
print "did you give me a java file?:", outfile
@ -91,18 +91,18 @@ def printStrings( pairs, outfile, target ):
/***********************************************************************
* Generated file; do not edit!!!
***********************************************************************/
package org.eehouse.android.xw4.loc;
package org.eehouse.android.%s.loc;
import android.content.Context;
import org.eehouse.android.xw4.R;
import org.eehouse.android.xw4.DbgUtils;
import org.eehouse.android.%s.R;
import org.eehouse.android.%s.DbgUtils;
public class %s {
public static final int NOT_FOUND = -1;
protected static final int[] S_IDS = {
"""
fil.write( lines % name )
fil.write( lines % (variant, variant, variant, name) )
keys = pairs.keys()
for ii in range( len( keys ) ):
@ -160,10 +160,12 @@ def main():
outfile = ''
outfileDbg = ''
target=''
pairs, rest = getopt.getopt(sys.argv[1:], "o:t:d:")
variant=''
pairs, rest = getopt.getopt(sys.argv[1:], "o:t:d:v:")
for option, value in pairs:
if option == '-o': outfile = value
elif option == '-t': target = value
elif option == '-v': variant = value
# Gather all localizable strings
pairs = getStrings("res/values/strings.xml")
@ -174,7 +176,7 @@ def main():
# dest = src.replace( 'res_src', 'res', 1 )
# xform( src, dest )
if outfile: printStrings( pairs, outfile, target )
if outfile: printStrings( pairs, outfile, target, variant )
##############################################################################
if __name__ == '__main__':