diff --git a/Makefile b/Makefile index 6cf04b97f..8025a32e3 100755 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ release: xcodebuild -derivedDataPath $(PWD) -configuration Release -scheme RsyncOSX dmg: xcodebuild -derivedDataPath $(PWD) -configuration Release -scheme rsyncosx-dmg +dmg-release: + xcodebuild -derivedDataPath $(PWD) -configuration Release -scheme rsyncosx-dmg-notarize clean: rm -Rf Build rm -Rf ModuleCache.noindex diff --git a/RsyncOSX.xcodeproj/project.pbxproj b/RsyncOSX.xcodeproj/project.pbxproj index 38356efea..67cb48612 100644 --- a/RsyncOSX.xcodeproj/project.pbxproj +++ b/RsyncOSX.xcodeproj/project.pbxproj @@ -19,6 +19,17 @@ name = "rsyncosx-dmg"; productName = "rsyncosx-dmg"; }; + E9D63661217FB8EA004B634E /* rsyncosx-dmg-notarize */ = { + isa = PBXAggregateTarget; + buildConfigurationList = E9D63665217FB8EA004B634E /* Build configuration list for PBXAggregateTarget "rsyncosx-dmg-notarize" */; + buildPhases = ( + E9D63664217FB8EA004B634E /* ShellScript */, + ); + dependencies = ( + ); + name = "rsyncosx-dmg-notarize"; + productName = "rsyncosx-dmg"; + }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ @@ -762,6 +773,10 @@ DevelopmentTeam = 93M47F4H9T; ProvisioningStyle = Automatic; }; + E9D63661217FB8EA004B634E = { + DevelopmentTeam = 93M47F4H9T; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = A044927D1D658EE800B3CE17 /* Build configuration list for PBXProject "RsyncOSX" */; @@ -779,6 +794,7 @@ targets = ( A04492811D658EE800B3CE17 /* RsyncOSX */, E94FB2032124A8FE0007DCAF /* rsyncosx-dmg */, + E9D63661217FB8EA004B634E /* rsyncosx-dmg-notarize */, ); }; /* End PBXProject section */ @@ -809,6 +825,19 @@ shellPath = /bin/sh; shellScript = "${SOURCE_ROOT}/RsyncOSX/Scripts/create-dmg.sh"; }; + E9D63664217FB8EA004B634E /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "${SOURCE_ROOT}/RsyncOSX/Scripts/create-dmg-notarize.sh\n"; + }; E9DF3E6D1F1B5F180055DB66 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -1156,6 +1185,24 @@ }; name = Release; }; + E9D63666217FB8EA004B634E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 93M47F4H9T; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + E9D63667217FB8EA004B634E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 93M47F4H9T; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1186,6 +1233,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + E9D63665217FB8EA004B634E /* Build configuration list for PBXAggregateTarget "rsyncosx-dmg-notarize" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E9D63666217FB8EA004B634E /* Debug */, + E9D63667217FB8EA004B634E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = A044927A1D658EE800B3CE17 /* Project object */; diff --git a/RsyncOSX.xcodeproj/xcuserdata/thomas.xcuserdatad/xcschemes/xcschememanagement.plist b/RsyncOSX.xcodeproj/xcuserdata/thomas.xcuserdatad/xcschemes/xcschememanagement.plist index 6e4f16905..a7facc4a8 100644 --- a/RsyncOSX.xcodeproj/xcuserdata/thomas.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/RsyncOSX.xcodeproj/xcuserdata/thomas.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,6 +9,11 @@ orderHint 0 + rsyncosx-dmg copy.xcscheme + + orderHint + 2 + rsyncosx-dmg.xcscheme orderHint diff --git a/RsyncOSX/Scripts/create-dmg-notarize.dmg b/RsyncOSX/Scripts/create-dmg-notarize.dmg new file mode 100755 index 000000000..9bccc9b25 --- /dev/null +++ b/RsyncOSX/Scripts/create-dmg-notarize.dmg @@ -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