# HG changeset patch # User Jason Maltzen # Date 2015-12-26 04:09:36 # Node ID 3f17947ff0660680617c0a8cb68c0a3dd187ac69 # Parent 339712c9aa0a9fb8ad87f56d53049119ade393db Add a publish script to simplify packaging diff --git a/mac/build-mac-bundle.sh b/mac/build-mac-bundle.sh --- a/mac/build-mac-bundle.sh +++ b/mac/build-mac-bundle.sh @@ -1,12 +1,16 @@ #!/bin/sh -if [ $# -ne 1 ]; then - echo "Usage: $0 " +if [ $# -ne 2 ]; then + echo "Usage: $0 " exit 1 fi + VERSION=$1 -if [ -d DesertPaintLab.app ]; then - /bin/mv bin/DesertPaintLab.app bin/DesertPaintLab.app.`/bin/date +"%Y%m%d%H%M%S"` +BUILD_NAME=$2 + +if [ -d bin/DesertPaintLab.app ]; then + mkdir -p old + /bin/mv bin/DesertPaintLab.app old/DesertPaintLab.app.`/bin/date +"%Y%m%d%H%M%S"` fi /bin/mkdir -p bin/DesertPaintLab.app /bin/mkdir -p bin/DesertPaintLab.app/Contents/MacOS @@ -21,4 +25,4 @@ fi /usr/bin/defaults write `pwd`/bin/DesertPaintLab.app/Contents/Info.plist CFBundleVersion ${VERSION} # package up into a DMG -/usr/bin/hdiutil create -volname DesertPaintLab -srcfolder bin/ -ov -format UDIF -fs HFS+ DesertPaintLab.dmg +/usr/bin/hdiutil create -volname DesertPaintLab -srcfolder bin/ -ov -format UDIF -fs HFS+ ../publish/DesertPaintLab_${BUILD_NAME}.dmg diff --git a/publish.sh b/publish.sh new file mode 100755 --- /dev/null +++ b/publish.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +if [ $# -ne 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +VERSION=$1 +BUILD_NAME=$2 + +mkdir -p publish +# Windows Release build +( cd ./bin/Release ; /usr/bin/zip -r ../../publish/DesertPaintLab_${BUILD_NAME}.zip . -x .DS_Store ) + +( cd ./mac ; ./build-mac-bundle.sh "${VERSION}" "${BUILD_NAME}" ) +