Maksim Gamarnik a68186451b iOS: 1.0.4
2016-12-19 23:20:21 +02:00

51 lines
1.0 KiB
Bash
Executable File

#!/bin/bash -e
if [ ! -d MultiCraft/MultiCraft.xcodeproj ]; then
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
cp ../../fonts/retrovillenc.ttf $DEST/fonts/ # no PNG fonts because freetype
mkdir -p $DEST/games
cp -r ../../games/default $DEST/games/default
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
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
echo "Creating assets.zip"
ZIPDEST=$FOLDER/assets.zip
rm -f $ZIPDEST
cd $DEST; zip -1r $ZIPDEST -- *
cd $FOLDER; rm -rf $DEST
###########
echo "Creating worlds.zip"
ZIPDEST=$FOLDER/worlds.zip
rm -f $ZIPDEST
cd ../..; zip -9r $ZIPDEST -- worlds