diff options
author | rowanbeentje <rowan@beent.je> | 2015-05-29 22:31:51 +0100 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2015-05-29 22:31:51 +0100 |
commit | 99502208026f3a6e3593ab8ec4586b45e55346a9 (patch) | |
tree | 3ede575836558181335f1c67465d7ed9129dc49e /Scripts/build.sh | |
parent | f94aeb596a00c455063993dceacba308723bf7da (diff) | |
download | sequelpro-99502208026f3a6e3593ab8ec4586b45e55346a9.tar.gz sequelpro-99502208026f3a6e3593ab8ec4586b45e55346a9.tar.bz2 sequelpro-99502208026f3a6e3593ab8ec4586b45e55346a9.zip |
Update distribution build process to use the new process written by Max for the nightly builds
Diffstat (limited to 'Scripts/build.sh')
-rwxr-xr-x | Scripts/build.sh | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/Scripts/build.sh b/Scripts/build.sh index 24343ee9..5348152a 100755 --- a/Scripts/build.sh +++ b/Scripts/build.sh @@ -149,7 +149,43 @@ then if [ -e "${SRCROOT}/ResourcesToCopy" ] then - find "${SRCROOT}/ResourcesToCopy" \( -name "*.lproj" \) | while read FILE; do; printf "\tCopying localization: ${FILE}\n"; cp -R "$FILE" "${BUILD_PRODUCT}/Contents/Resources/"; done; + TRANSLATIONS_BASE="${SRCROOT}/languagetranslations" + IBSTRINGSDIR="${SRCROOT}/ibstrings" + XIB_BASE="${SRCROOT}/Interfaces/English.lproj" + rm -rf "${IBSTRINGSDIR}" &> /dev/null + rm -rf "${TRANSLATIONS_BASE}" &> /dev/null + + echo "Creating IB strings files for rekeying..." + cp -R "${SRCROOT}/ResourcesToCopy" "${TRANSLATIONS_BASE}" + mkdir -p "$IBSTRINGSDIR/English.lproj" + find "${XIB_BASE}" \( -name "*.xib" \) | while read FILE; do + ibtool "$FILE" --export-strings-file "$IBSTRINGSDIR/English.lproj/`basename "$FILE" .xib`.strings" + done + + echo "Rekeying localization files, translating xibs, merging localizations..." + find "${TRANSLATIONS_BASE}" \( -name "*.lproj" \) | while read FILE; do + loc=`basename "$FILE"` + mkdir "$IBSTRINGSDIR/$loc" + printf "\tProcessing: $loc\n" + find "$FILE" \( -name "*.strings" \) | while read STRFILE; do + file=`basename "$STRFILE" .strings` + ibkeyfile="$IBSTRINGSDIR/English.lproj/$file.strings" + xibfile="$XIB_BASE/$file.xib" + transfile="$IBSTRINGSDIR/$loc/$file.strings" + if [ -e "$ibkeyfile" ] && [ -e "$xibfile" ]; then + "${BUILT_PRODUCTS_DIR}/xibLocalizationPostprocessor" "$STRFILE" "$ibkeyfile" "$transfile" + + # we no longer need the original file and don't want to copy it + rm -f "$STRFILE" + + ibtool "$xibfile" --import-strings-file "$transfile" --compile "${TRANSLATIONS_BASE}/$loc/$file.nib" + fi + done + cp -R "$FILE" "${BUILD_PRODUCT}/Contents/Resources/" + done + + rm -rf "${IBSTRINGSDIR}" &> /dev/null + rm -rf "${TRANSLATIONS_BASE}" &> /dev/null else echo 'No localizations to copy.' fi |