Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
if [ "${CONFIGURATION}" != "Release" ]; then | ||
echo "[SKIP] Not building an Release configuration, skipping DMG creation" | ||
exit | ||
fi | ||
|
||
RSYNCOSX_DMG_VERSION=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "${PROJECT_DIR}/RsyncOSX/Info.plist") | ||
RSYNCOSX_DMG="${BUILT_PRODUCTS_DIR}/RsyncOSX-${RSYNCOSX_DMG_VERSION}.dmg" | ||
RSYNCOSX_APP="${BUILT_PRODUCTS_DIR}/RsyncOSX.app" | ||
RSYNCOSX_APP_RESOURCES="${RSYNCOSX_APP}/Contents/Resources" | ||
|
||
CREATE_DMG="${SOURCE_ROOT}/3thparty/github.com/andreyvit/create-dmg/create-dmg" | ||
STAGING_DIR="${BUILT_PRODUCTS_DIR}/staging/dmg" | ||
STAGING_APP="${STAGING_DIR}/RsyncOSX.app" | ||
DMG_TEMPLATE_DIR="${SOURCE_ROOT}/Scripts/Templates/DMG" | ||
DEFAULT_IDENTITY=$(security find-identity -v -p codesigning | grep "Developer ID" | head -1 | cut -f 4 -d " " || true) | ||
|
||
if [ -f "${RSYNCOSX_DMG}" ]; then | ||
echo "-- RsyncOSX dmg already created" | ||
echo " > ${RSYNCOSX_DMG}" | ||
else | ||
echo "-- Creating RsyncOSX dmg" | ||
echo " > ${RSYNCOSX_DMG}" | ||
|
||
${CREATE_DMG} \ | ||
--volname "RsyncOSX" \ | ||
--volicon "${RSYNCOSX_APP_RESOURCES}/AppIcon.icns" \ | ||
--background "${DMG_TEMPLATE_DIR}/background.png" \ | ||
--window-pos -1 -1 \ | ||
--window-size 480 540 \ | ||
--icon "RsyncOSX.app" 240 130 \ | ||
--hide-extension RsyncOSX.app \ | ||
--app-drop-link 240 380 \ | ||
${RSYNCOSX_DMG} \ | ||
${RSYNCOSX_APP} | ||
fi |