Skip to content
Snippets Groups Projects
nibbuild.sh 894 B
Newer Older
EthanRDoesMC's avatar
EthanRDoesMC committed
#!/bin/sh

#  nibbuild.sh
#  brooklyn
#
#  Created by EthanRDoesMC on 1/1/21.
EthanRDoesMC's avatar
EthanRDoesMC committed
#

# make sure this is macos
if [[ "$OSTYPE" == "darwin"* ]]; then
# our xibs are in resources
EthanRDoesMC's avatar
EthanRDoesMC committed
cd ./Resources
EthanRDoesMC's avatar
EthanRDoesMC committed
# build xib with xcode-only ibtool
echo "Building xibs"
EthanRDoesMC's avatar
EthanRDoesMC committed
find . -name "*.xib" -type f | awk '{sub(/.xib/,"");print}' | xargs -I % ibtool --compile %.nib %.xib
EthanRDoesMC's avatar
EthanRDoesMC committed
# ok now handle xcassets
cd ..
/Applications/Xcode.app/Contents/Developer/usr/bin/actool BeeperAppIcon.xcassets --compile ./Resources --platform iphoneos  --minimum-deployment-target 8.0 --app-icon BeeperAppIcon --output-partial-info-plist tmp.plist
/usr/libexec/PlistBuddy -x -c "Merge tmp.plist" ./Resources/Info.plist
rm tmp.plist
echo "good luck"
EthanRDoesMC's avatar
EthanRDoesMC committed
else
    echo "Not macOS. Xibs will not be built."
    echo "If changes have been made to Xibs but nibs are not up-to-date: compile with macOS, then make sure to commit and push the nib files."
fi