mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
19a3f40d66
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.
38 lines
656 B
Bash
Executable file
38 lines
656 B
Bash
Executable file
#!/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
|