Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For posterity, I did something similar to zoul for iPhone applications, by adding a revision.h to my project, then adding the following as a Run Script build phase:</p> <pre><code>REV=`/usr/bin/svnversion -nc ${PROJECT_DIR} | /usr/bin/sed -e 's/^[^:]*://;s/[A-Za-z]//'` echo "#define kRevisionNumber @\"$REV\"" &gt; ${PROJECT_DIR}/revision.h </code></pre> <p>I did this to grab a simple revision number, as opposed to the more detailed string that svnversion produces in zoul's solution.</p> <p>For Mac applications, I based my approach on <a href="http://www.latenightcode.com/devblog/automated-build-numbering-in-xcode/" rel="noreferrer">this post</a>, and instead created a buildnumber.xcconfig file. Under the build settings for the target, I changed the Based On value in the lower-right-hand corner of the dialog to buildnumber.xcconfig. Within the Info.plist, I edited the following lines:</p> <pre><code>&lt;key&gt;CFBundleVersion&lt;/key&gt; &lt;string&gt;${BUILD_NUMBER}&lt;/string&gt; &lt;key&gt;CFBundleShortVersionString&lt;/key&gt; &lt;string&gt;Version 1.0&lt;/string&gt; </code></pre> <p>So that my About dialog would display a version string similar to Version 1.0 (1234), where 1234 is the Subversion revision number. Finally, I created a Run Script build phase with the following code:</p> <pre><code>REV=`/usr/bin/svnversion -nc ${PROJECT_DIR} | /usr/bin/sed -e 's/^[^:]*://;s/[A-Za-z]//'` echo "BUILD_NUMBER = $REV" &gt; ${PROJECT_DIR}/buildnumber.xcconfig </code></pre> <p>This may not be the cleanest way, as it requires a clean cycle before building for the new revision to take hold in the application, but it works.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload