<?xml version="1.0" encoding="UTF-8"?>
<Scheme
   LastUpgradeVersion = "0460"
   version = "1.7">
   <BuildAction
      parallelizeBuildables = "YES"
      buildImplicitDependencies = "YES">
      <PreActions>
         <ExecutionAction
            ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
            <ActionContent
               title = "Run Script"
               scriptText = "&#10;if [[ $CONFIGURATION == Release &amp;&amp; $DEPLOYMENT_LOCATION == YES ]]; then&#10;    # Reconfigure output to file (overwrite)&#10;#    exec &gt; $PROJECT_DIR/build.log 2&gt;&amp;1&#10;    echo &quot;Updating build info...&quot;&#10;else&#10;    # Bail out during normal build&#10;    exit&#10;fi&#10;&#10;# Update build info&#10;PLIST=${PROJECT_DIR}/${INFOPLIST_FILE}&#10;&#10;# Get build date&#10;BUILD_DATE=$(date +&apos;%m/%d/%Y&apos;)&#10;/usr/libexec/Plistbuddy -c &quot;Delete :BuildDate&quot; &quot;${PLIST}&quot;&#10;/usr/libexec/Plistbuddy -c &quot;Add :BuildDate string ${BUILD_DATE}&quot; &quot;${PLIST}&quot;&#10;echo &quot;note: Changed build date to ${BUILD_DATE}&quot;&#10;&#10;# Get and increment build number&#10;BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c &quot;Print :CFBundleVersion&quot; &quot;${PLIST}&quot;)&#10;if [[ &quot;${BUILD_NUMBER}&quot; == &quot;&quot; ]]; then&#10;    BUILD_NUMBER=&quot;1&quot;&#10;else&#10;    BUILD_NUMBER=$(($BUILD_NUMBER + 1))&#10;fi&#10;/usr/libexec/Plistbuddy -c &quot;Set :CFBundleVersion ${BUILD_NUMBER}&quot; &quot;${PLIST}&quot;&#10;echo &quot;note: Changed build number to ${BUILD_NUMBER}&quot;&#10;">
               <EnvironmentBuildable>
                  <BuildableReference
                     BuildableIdentifier = "primary"
                     BlueprintIdentifier = "667AC23617390A6000E01C15"
                     BuildableName = "Piper.app"
                     BlueprintName = "Perforce"
                     ReferencedContainer = "container:Perforce.xcodeproj">
                  </BuildableReference>
               </EnvironmentBuildable>
            </ActionContent>
         </ExecutionAction>
      </PreActions>
      <BuildActionEntries>
         <BuildActionEntry
            buildForTesting = "YES"
            buildForRunning = "YES"
            buildForProfiling = "YES"
            buildForArchiving = "YES"
            buildForAnalyzing = "YES">
            <BuildableReference
               BuildableIdentifier = "primary"
               BlueprintIdentifier = "667AC23617390A6000E01C15"
               BuildableName = "Piper.app"
               BlueprintName = "Perforce"
               ReferencedContainer = "container:Perforce.xcodeproj">
            </BuildableReference>
         </BuildActionEntry>
      </BuildActionEntries>
   </BuildAction>
   <TestAction
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      shouldUseLaunchSchemeArgsEnv = "YES"
      buildConfiguration = "Debug">
      <Testables>
      </Testables>
      <MacroExpansion>
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "667AC23617390A6000E01C15"
            BuildableName = "Piper.app"
            BlueprintName = "Perforce"
            ReferencedContainer = "container:Perforce.xcodeproj">
         </BuildableReference>
      </MacroExpansion>
   </TestAction>
   <LaunchAction
      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
      launchStyle = "0"
      useCustomWorkingDirectory = "NO"
      buildConfiguration = "Debug"
      ignoresPersistentStateOnLaunch = "NO"
      debugDocumentVersioning = "YES"
      allowLocationSimulation = "YES">
      <BuildableProductRunnable>
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "667AC23617390A6000E01C15"
            BuildableName = "Piper.app"
            BlueprintName = "Perforce"
            ReferencedContainer = "container:Perforce.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
      <AdditionalOptions>
      </AdditionalOptions>
   </LaunchAction>
   <ProfileAction
      shouldUseLaunchSchemeArgsEnv = "YES"
      savedToolIdentifier = ""
      useCustomWorkingDirectory = "NO"
      buildConfiguration = "Release"
      debugDocumentVersioning = "YES">
      <BuildableProductRunnable>
         <BuildableReference
            BuildableIdentifier = "primary"
            BlueprintIdentifier = "667AC23617390A6000E01C15"
            BuildableName = "Piper.app"
            BlueprintName = "Perforce"
            ReferencedContainer = "container:Perforce.xcodeproj">
         </BuildableReference>
      </BuildableProductRunnable>
   </ProfileAction>
   <AnalyzeAction
      buildConfiguration = "Debug">
   </AnalyzeAction>
   <ArchiveAction
      buildConfiguration = "Release"
      revealArchiveInOrganizer = "NO">
      <PostActions>
         <ExecutionAction
            ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
            <ActionContent
               title = "Run Script"
               scriptText = "&#10;if [[ $CONFIGURATION == Release &amp;&amp; $DEPLOYMENT_LOCATION == YES ]]; then&#10;    # Reconfigure output to file (append)&#10;#    exec &gt;&gt; $PROJECT_DIR/build.log 2&gt;&amp;1&#10;    echo &quot;Archiving...&quot;&#10;else&#10;    # Bail out during normal build&#10;    exit&#10;fi&#10;&#10;# Dump environment variables&#10;#printenv &gt; ~/Desktop/printenv.txt&#10;&#10;PROJECT=&quot;${PRODUCT_NAME//[[:space:]]/}&quot;&#10;&#10;DMG_DIR=$PROJECT_DIR/dist&#10;BIN_DIR=$PROJECT_DIR/bin&#10;&#10;DMG_FILE=$DMG_DIR/$PROJECT.dmg&#10;BIN_FILE=$BIN_DIR/$FULL_PRODUCT_NAME&#10;&#10;PRODUCT_DIR=$ARCHIVE_PATH/Products$INSTALL_PATH&#10;PRODUCT_FILE=$PRODUCT_DIR/$FULL_PRODUCT_NAME&#10;&#10;# Print variables&#10;&#10;echo &quot;note: PROJECT=${PROJECT}&quot;&#10;echo &quot;note: DMG_DIR=${DMG_DIR}&quot;&#10;echo &quot;note: BIN_DIR=${BIN_DIR}&quot;&#10;echo &quot;note: DMG_FILE=${DMG_FILE}&quot;&#10;echo &quot;note: BIN_FILE=${BIN_FILE}&quot;&#10;echo &quot;note: PRODUCT_DIR=${PRODUCT_DIR}&quot;&#10;echo &quot;note: PRODUCT_FILE=${PRODUCT_FILE}&quot;&#10;&#10;# Create directories&#10;&#10;echo &quot;note: Creating folders: ${DMG_DIR} ${BIN_DIR}&quot;&#10;mkdir -p &quot;${DMG_DIR}&quot;&#10;mkdir -p &quot;${BIN_DIR}&quot;&#10;&#10;# Creating dmg&#10;&#10;if [ -a &quot;/tmp/tmp.dmg&quot; ]; then&#10;    rm &quot;/tmp/tmp.dmg&quot;&#10;fi&#10;&#10;hdiutil create /tmp/tmp.dmg -ov -volname &quot;${PROJECT}&quot; -fs HFS+ -srcfolder &quot;${PRODUCT_DIR}/..&quot;&#10;&#10;if [ -a &quot;${DMG_FILE}&quot; ]; then&#10;    echo &quot;note: Removing dmg: ${DMG_FILE}&quot;&#10;    rm &quot;${DMG_FILE}&quot;&#10;fi&#10;&#10;echo &quot;note: Creating dmg: ${DMG_FILE}&quot;&#10;hdiutil convert /tmp/tmp.dmg -format UDZO -o &quot;${DMG_FILE}&quot;&#10;&#10;# Copy executable&#10;&#10;if [ -a &quot;${BIN_FILE}&quot; ]; then&#10;    echo &quot;note: Removing executable: ${BIN_FILE}&quot;&#10;    rm -r &quot;${BIN_FILE}&quot;&#10;fi&#10;&#10;echo &quot;note: Copying executable: ${PRODUCT_FILE}&quot;&#10;cp -r &quot;${PRODUCT_FILE}&quot; &quot;${BIN_FILE}&quot;&#10;&#10;# Checking for errors&#10;&#10;if [[ ! -d &quot;${DMG_FILE}&quot; &amp;&amp; ! -e &quot;${DMG_FILE}&quot; ]] ; then&#10;    osascript -e &apos;display notification &quot;dmg creation failed&quot; with title &quot;Xcode Error&quot;&apos;&#10;    echo &quot;error: dmg creation failed&quot;&#10;    exit 1&#10;fi&#10;&#10;if [[ ! -d &quot;${BIN_FILE}&quot; &amp;&amp; ! -e &quot;${BIN_FILE}&quot; ]] ; then&#10;    osascript -e &apos;display notification &quot;Copying executable creation failed&quot; with title &quot;Xcode Error&quot;&apos;&#10;    echo &quot;error: Copying executable creation failed&quot;&#10;    exit 1&#10;fi&#10;&#10;echo &quot;note: Archive completed&quot;&#10;osascript -e &apos;display notification &quot;Archive DMG completed&quot; with title &quot;Xcode&quot;&apos;">
               <EnvironmentBuildable>
                  <BuildableReference
                     BuildableIdentifier = "primary"
                     BlueprintIdentifier = "667AC23617390A6000E01C15"
                     BuildableName = "Piper.app"
                     BlueprintName = "Perforce"
                     ReferencedContainer = "container:Perforce.xcodeproj">
                  </BuildableReference>
               </EnvironmentBuildable>
            </ActionContent>
         </ExecutionAction>
      </PostActions>
   </ArchiveAction>
</Scheme>