Skip to content

Commit 25050fb

Browse files
committed
Merge pull request #6 from loudnate/update-tagging-script
Create tags in "v0.0.0" format
2 parents 72192a7 + d53c318 commit 25050fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
104104
<ActionContent
105105
title = "Run Script"
106-
scriptText = "#!/bin/bash&#10;&#10;if [[ ! -d $SRCROOT ]]; then&#10;echo &quot;This script must be run from an Xcode Build Phase&quot;&#10;exit 1;&#10;fi&#10;&#10;# Globals&#10;Tag=&#10;Logfile=&#10;CFBundleVersion=&#10;CFBundleShortVersionString=&#10;&#10;function init_logging () {&#10; logdir=&quot;$HOME/Library/Logs/$PRODUCT_BUNDLE_IDENTIFIER&quot;&#10; mkdir -p $logdir&#10; Logfile=&quot;$logdir/archive_post_actions.log&quot;&#10; exec &gt;&gt; $Logfile 2&gt;&amp;1&#10;&#10; echo &quot;\n\n\n$(date) Beginning archive post-actions for $CONFIGURATION&quot;&#10;}&#10;&#10;function increment_bundle_version () {&#10; srcPlist=&quot;$1&quot;&#10; PlistBuddy=&quot;/usr/libexec/PlistBuddy&quot;&#10;&#10; CFBundleVersion=`$PlistBuddy -c &quot;Print CFBundleVersion&quot; $srcPlist`&#10; CFBundleShortVersionString=`$PlistBuddy -c &quot;Print CFBundleShortVersionString&quot; $srcPlist`&#10; Tag=&quot;$PRODUCT_NAME$PRODUCT_NAME_SUFFIX-$CFBundleShortVersionString-$CFBundleVersion&quot;&#10;&#10; # Increment the bundle version for future builds&#10; CFBundleVersionNext=$(($CFBundleVersion + 1))&#10; $PlistBuddy -c &quot;Set :CFBundleVersion $CFBundleVersionNext&quot; $srcPlist&#10;&#10; echo &quot;Updated build number of $srcPlist to $CFBundleVersionNext&quot;&#10;&#10; # Copy the new version to the settings bundle&#10; # settingsPlist=&quot;$SRCROOT/$PRODUCT_NAME/Settings.bundle/Root.plist&quot;&#10; # $PlistBuddy -c &quot;Set :PreferenceSpecifiers:0:DefaultValue $CFBundleShortVersionString ($CFBundleVersionNext)&quot; $settingsPlist&#10;&#10; git add $srcPlist &gt;&gt; $Logfile 2&gt;&amp;1&#10;}&#10;&#10;function commit_and_tag_changes () {&#10; cd &quot;$SRCROOT&quot;&#10;&#10; git commit -m &quot;Auto-commit with archive $Tag&quot; &gt;&gt; $Logfile 2&gt;&amp;1&#10; git tag $Tag &gt;&gt; $Logfile 2&gt;&amp;1&#10; git push &gt;&gt; $Logfile 2&gt;&amp;1&#10; git push --tags &gt;&gt; $Logfile 2&gt;&amp;1&#10;&#10; cd -&#10;}&#10;&#10;function merge_to_master () {&#10; cd &quot;$SRCROOT&quot;&#10;&#10; branch=$(git symbolic-ref --short HEAD)&#10;&#10; git checkout master &gt;&gt; $Logfile 2&gt;&amp;1&#10; git merge &quot;$branch&quot; &gt;&gt; $Logfile 2&gt;&amp;1&#10; git push &gt;&gt; $Logfile 2&gt;&amp;1&#10; git checkout &quot;$branch&quot; &gt;&gt; $Logfile 2&gt;&amp;1&#10;&#10; cd -&#10;}&#10;&#10;## Run&#10;&#10;init_logging&#10;increment_bundle_version &quot;$SRCROOT/$INFOPLIST_FILE&quot;&#10;increment_bundle_version &quot;$SRCROOT/WatchApp/Info.plist&quot;&#10;commit_and_tag_changes&#10;">
106+
scriptText = "#!/bin/bash&#10;&#10;if [[ ! -d $SRCROOT ]]; then&#10;echo &quot;This script must be run from an Xcode Build Phase&quot;&#10;exit 1;&#10;fi&#10;&#10;# Globals&#10;Tag=&#10;Logfile=&#10;CFBundleVersion=&#10;CFBundleShortVersionString=&#10;&#10;function init_logging () {&#10; logdir=&quot;$HOME/Library/Logs/$PRODUCT_BUNDLE_IDENTIFIER&quot;&#10; mkdir -p $logdir&#10; Logfile=&quot;$logdir/archive_post_actions.log&quot;&#10; exec &gt;&gt; $Logfile 2&gt;&amp;1&#10;&#10; echo &quot;\n\n\n$(date) Beginning archive post-actions for $CONFIGURATION&quot;&#10;}&#10;&#10;function increment_bundle_version () {&#10; srcPlist=&quot;$1&quot;&#10; PlistBuddy=&quot;/usr/libexec/PlistBuddy&quot;&#10;&#10; CFBundleVersion=`$PlistBuddy -c &quot;Print CFBundleVersion&quot; $srcPlist`&#10; CFBundleShortVersionString=`$PlistBuddy -c &quot;Print CFBundleShortVersionString&quot; $srcPlist`&#10; Tag=&quot;v$CFBundleShortVersionString&quot;&#10;&#10; # Increment the bundle version for future builds&#10; CFBundleVersionNext=$(($CFBundleVersion + 1))&#10; $PlistBuddy -c &quot;Set :CFBundleVersion $CFBundleVersionNext&quot; $srcPlist&#10;&#10; echo &quot;Updated build number of $srcPlist to $CFBundleVersionNext&quot;&#10;&#10; # Copy the new version to the settings bundle&#10; # settingsPlist=&quot;$SRCROOT/$PRODUCT_NAME/Settings.bundle/Root.plist&quot;&#10; # $PlistBuddy -c &quot;Set :PreferenceSpecifiers:0:DefaultValue $CFBundleShortVersionString ($CFBundleVersionNext)&quot; $settingsPlist&#10;&#10; git add $srcPlist &gt;&gt; $Logfile 2&gt;&amp;1&#10;}&#10;&#10;function commit_and_tag_changes () {&#10; cd &quot;$SRCROOT&quot;&#10;&#10; git commit -m &quot;Auto-commit with archive $Tag&quot; &gt;&gt; $Logfile 2&gt;&amp;1&#10; git tag $Tag &gt;&gt; $Logfile 2&gt;&amp;1&#10; git push &gt;&gt; $Logfile 2&gt;&amp;1&#10; git push --tags &gt;&gt; $Logfile 2&gt;&amp;1&#10;&#10; cd -&#10;}&#10;&#10;function merge_to_master () {&#10; cd &quot;$SRCROOT&quot;&#10;&#10; branch=$(git symbolic-ref --short HEAD)&#10;&#10; git checkout master &gt;&gt; $Logfile 2&gt;&amp;1&#10; git merge &quot;$branch&quot; &gt;&gt; $Logfile 2&gt;&amp;1&#10; git push &gt;&gt; $Logfile 2&gt;&amp;1&#10; git checkout &quot;$branch&quot; &gt;&gt; $Logfile 2&gt;&amp;1&#10;&#10; cd -&#10;}&#10;&#10;## Run&#10;&#10;init_logging&#10;increment_bundle_version &quot;$SRCROOT/$INFOPLIST_FILE&quot;&#10;increment_bundle_version &quot;$SRCROOT/WatchApp/Info.plist&quot;&#10;commit_and_tag_changes&#10;">
107107
<EnvironmentBuildable>
108108
<BuildableReference
109109
BuildableIdentifier = "primary"

0 commit comments

Comments
 (0)