From f2b86b2a71e4c6f8c2eac9b0c874d74bdccaf729 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 12 Feb 2012 21:22:36 -0800 Subject: [PATCH] work-in-progress on scripts to generate a second app from the same source tree. --- xwords4/android/XWords4-dbg/.gitignore | 2 + .../android/XWords4-dbg/AndroidManifest.xml | 151 ++++++++++++++++++ xwords4/android/XWords4-dbg/build.xml | 95 +++++++++++ .../android/XWords4-dbg/project.properties | 11 ++ xwords4/android/scripts/Variant.mk | 1 + xwords4/android/scripts/mkvariant.sh | 58 +++++++ 6 files changed, 318 insertions(+) create mode 100644 xwords4/android/XWords4-dbg/.gitignore create mode 100644 xwords4/android/XWords4-dbg/AndroidManifest.xml create mode 100644 xwords4/android/XWords4-dbg/build.xml create mode 100644 xwords4/android/XWords4-dbg/project.properties create mode 100644 xwords4/android/scripts/Variant.mk create mode 100755 xwords4/android/scripts/mkvariant.sh diff --git a/xwords4/android/XWords4-dbg/.gitignore b/xwords4/android/XWords4-dbg/.gitignore new file mode 100644 index 000000000..93735433f --- /dev/null +++ b/xwords4/android/XWords4-dbg/.gitignore @@ -0,0 +1,2 @@ +proguard.cfg +local.properties diff --git a/xwords4/android/XWords4-dbg/AndroidManifest.xml b/xwords4/android/XWords4-dbg/AndroidManifest.xml new file mode 100644 index 000000000..842b9203a --- /dev/null +++ b/xwords4/android/XWords4-dbg/AndroidManifest.xml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xwords4/android/XWords4-dbg/build.xml b/xwords4/android/XWords4-dbg/build.xml new file mode 100644 index 000000000..967408b0b --- /dev/null +++ b/xwords4/android/XWords4-dbg/build.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xwords4/android/XWords4-dbg/project.properties b/xwords4/android/XWords4-dbg/project.properties new file mode 100644 index 000000000..5a7094538 --- /dev/null +++ b/xwords4/android/XWords4-dbg/project.properties @@ -0,0 +1,11 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system use, +# "ant.properties", and override values to adapt the script to your +# project structure. + +# Project target. +target=android-7 diff --git a/xwords4/android/scripts/Variant.mk b/xwords4/android/scripts/Variant.mk new file mode 100644 index 000000000..ba612e74a --- /dev/null +++ b/xwords4/android/scripts/Variant.mk @@ -0,0 +1 @@ +# -*- mode: Makefile; -*- diff --git a/xwords4/android/scripts/mkvariant.sh b/xwords4/android/scripts/mkvariant.sh new file mode 100755 index 000000000..d47266b4a --- /dev/null +++ b/xwords4/android/scripts/mkvariant.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +set -u -e + +MAKEFILE=./Variant.mk +DIRS="" +VARIANT="" + +usage() { + [ $# -ge 1 ] && echo "ERROR: $1" + echo "usage: $0 [--dest-dir ]* --variant-name " + exit 1 +} + +do_dir() { + local SRC_PATH=$1 + local DEST_PATH=$2 + local DIR=$3 + + SRC_PATH=$SRC_PATH/$DIR + + [ -d $SRC_PATH ] || usage "$SRC_PATH not found" + DEST_PATH=$DEST_PATH/$DIR + mkdir -p $DEST_PATH + + for FILE in $SRC_PATH; do + if [ -d $FILE ]; then + do_dir $SRC_PATH $DEST_PATH $FILE + else + make -f $MAKEFILE SRC_PATH=$SRC_PATH $DEST_PATH=$DEST_PATH make_file + fi + done +} + +pwd +echo "$0 $*" + +while [ $# -ge 1 ]; do + echo "\"$1\"" + case $1 in + --variant-name) + shift + VARIANT=$1 + ;; + --dest-dir) + shift + DIRS="$DIRS $1" + ;; + *) + usage "unexpected param $1" + ;; + esac + shift +done + +echo "$0 DIRS: $DIRS" + +[ -n "$VARIANT" ] || usage "--variant-name not supplied"