mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
script to swap resources for small-device testing
Setting up an emulator that'll grab {menu,layout}-small resources is a pain so this script exchanges them with regular resources so that a subsequent compile will produce something that (when run) will catch missing resources etc.
This commit is contained in:
parent
c4d7626ae1
commit
19a3f40d66
1 changed files with 38 additions and 0 deletions
38
xwords4/android/scripts/test-small.sh
Executable file
38
xwords4/android/scripts/test-small.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e -u
|
||||
|
||||
usage() {
|
||||
[ $# -ge 1 ] && echo "ERROR: $1"
|
||||
echo "usage: $0" >&2
|
||||
echo "Move small-device resources around so they build for normal ones" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
checkFile() {
|
||||
FILE=$1
|
||||
[ -z "$(git ls-files -m $FILE)" ] || usage "$FILE is modified"
|
||||
}
|
||||
|
||||
swapFiles() {
|
||||
SRC_FILE=$1
|
||||
DEST_DIR=$2
|
||||
|
||||
NAME=$(basename $SRC_FILE)
|
||||
mv $DEST_DIR/$NAME /tmp/
|
||||
mv $SRC_FILE $DEST_DIR
|
||||
mv /tmp/$NAME $SRC_FILE
|
||||
}
|
||||
|
||||
for DIR in layout menu ; do
|
||||
for FILE in res/${DIR}-small/*.xml; do
|
||||
checkFile $FILE
|
||||
checkFile res/$DIR/$(basename $FILE)
|
||||
done
|
||||
done
|
||||
|
||||
for DIR in layout menu ; do
|
||||
for FILE in res/${DIR}-small/*.xml; do
|
||||
swapFiles $FILE res/$DIR
|
||||
done
|
||||
done
|
Loading…
Reference in a new issue