BlockColor-Engine/build/iOS/assets.sh

55 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2016-11-05 23:14:22 +01:00
#!/bin/bash -e
if [ ! -d BlockColor/BlockColor.xcodeproj ]; then
2016-11-05 23:14:22 +01:00
echo "Run this in build/iOS"
exit 1
fi
FOLDER=$(pwd)
DEST=$(mktemp -d)
for dir in builtin textures; do
cp -r ../../$dir $DEST/$dir
done
mkdir -p $DEST/fonts
2019-05-27 02:10:00 +02:00
cp ../../fonts/Retron2000.ttf $DEST/fonts/ # no PNG fonts because freetype
2016-11-05 23:14:22 +01:00
mkdir -p $DEST/games
cp -r ../../games/default $DEST/games/default
2016-11-23 19:20:42 +01:00
pushd ../../po
for lang in *; do
[ ${#lang} -ne 2 ] && continue
mopath=$DEST/locale/$lang/LC_MESSAGES
mkdir -p $mopath
pushd $lang
for fn in *.po; do
# brew install gettext
/usr/local/Cellar/gettext/*/bin/msgfmt -o $mopath/${fn/.po/.mo} $fn
done
popd
done
popd
2016-11-05 23:14:22 +01:00
find $DEST -type d -name '.git' -print0 | xargs -0 -- rm -r
find $DEST -type f -name '.git*' -delete
find $DEST -type f -name '.DS_Store' -delete
# remove broken languages
find $DEST -type d -name 'ja' -print0 | xargs -0 -- rm -r
find $DEST -type d -name 'ko' -print0 | xargs -0 -- rm -r
find $DEST -type d -name 'he' -print0 | xargs -0 -- rm -r
2016-11-05 23:14:22 +01:00
echo "Creating assets.zip"
ZIPDEST=$FOLDER/assets.zip
rm -f $ZIPDEST
2016-12-19 22:20:21 +01:00
cd $DEST; zip -1r $ZIPDEST -- *
2016-11-05 23:14:22 +01:00
cd $FOLDER; rm -rf $DEST
###########
echo "Creating worlds.zip"
ZIPDEST=$FOLDER/worlds.zip
rm -f $ZIPDEST
cd ../..; zip -0r $ZIPDEST -- worlds