<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>John Bafford &#187; svn</title>
	<atom:link href="http://bafford.com/tag/svn/feed/" rel="self" type="application/rss+xml" />
	<link>http://bafford.com</link>
	<description>coding in purple</description>
	<lastBuildDate>Tue, 07 Jun 2011 14:48:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Automatic Build Versioning in Xcode with Subversion</title>
		<link>http://bafford.com/2010/11/17/automatic-build-versioning-in-xcode-with-subversion/</link>
		<comments>http://bafford.com/2010/11/17/automatic-build-versioning-in-xcode-with-subversion/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 02:52:48 +0000</pubDate>
		<dc:creator>John Bafford</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://bafford.com/?p=554</guid>
		<description><![CDATA[For awhile, I had wanted to include the svn revision number in my iOS app, and when I came across a blog post by Daniel Jalkut from a few years ago, I thought I had found an answer. No sooner than I implemented his script, though, did I discover that Apple doesn&#8217;t allow build numbers [...]]]></description>
			<content:encoded><![CDATA[<p>For awhile, I had wanted to include the svn revision number in my <a href="http://bafford.com/software/gpstrack/">iOS app</a>, and when I came across <a href="http://www.red-sweater.com/blog/23/automatic-build-sub-versioning-in-xcode">a blog post by Daniel Jalkut</a> from a few years ago, I thought I had found an answer. No sooner than I implemented his script, though, did I discover that Apple doesn&#8217;t allow build numbers in iOS app packages.</p>
<p>I still really wanted this information in my dev builds so it would be easier to keep track of what version I was working with, so wound up I made a number of modifications to the script to make it suit my needs:<br />
<span id="more-554"></span><br />
* When building, if the current build style is Debug, do nothing.<br />
* Use the INFOPLIST_PATH environment variable to dynamically generate the path to the Info.plist (so it works on iOS as well as Mac OS apps).<br />
* Dynamically insert the revision information into the plist, rather than requiring a marker.<br />
* Read and write out the plist to the binary format iOS apps want.</p>
<p>This code is free to use. Enjoy!</p>
<h3>Installation Instructions</h3>
<p>You&#8217;ll need to add this as a new build phase in Xcode. For your target, you&#8217;ll want to create a new &#8220;Run Script&#8221; build phase, and copy and paste the code in. You&#8217;ll want to set the shell to your perl interpreter; I use /usr/bin/perl -w.</p>
<h3>The Code</h3>
<div style="border: black 1px solid">
<pre class="brush: perl; light: true; title: ;">
# Xcode auto-versioning script for Subversion
# Original version by Axel Andersson
# Modifications by Daniel Jalkut &lt;http://www.red-sweater.com/blog/23/automatic-build-sub-versioning-in-xcode&gt;
# Further improvements by John Bafford &lt;http://bafford.com&gt;

use strict;

die &quot;$0: Must be run from Xcode&quot; unless $ENV{&quot;BUILT_PRODUCTS_DIR&quot;};

# Do nothing in a Debug build.
exit(0) if($ENV{'BUILD_STYLE'} ne 'Debug');

# Get the current subversion revision number and use it to set the CFBundleVersion value
my $version;
my $REV = `/usr/bin/svnversion -n ./`;
my $INFO = &quot;$ENV{BUILT_PRODUCTS_DIR}/$ENV{INFOPLIST_PATH}&quot;;

# (Match the last group of digits and optional letter M/S); regex via Kevin &quot;Regex Nerd&quot; Ballard
($REV =~ m/\d+[MS]*$/) &amp;&amp; ($version = $&amp;);

die &quot;$0: No Subversion revision found&quot; unless $version;

my $match = &quot;(&lt;key&gt;CFBundleVersion&lt;/key&gt;\n\t&lt;string&gt;)((.*?)( \(.*\))?)(&lt;/string&gt;)&quot;;

my $info = `plutil -convert xml1 $INFO -o -`;
$info =~ s/$match/$1$3 ($version)$6/;

open(FH, &quot;|plutil -convert binary1 -o $INFO -&quot;) or die &quot;$0: $INFO: $!&quot;;
print FH $info;
close(FH);
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://bafford.com/2010/11/17/automatic-build-versioning-in-xcode-with-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Safari 4 beta and WebKit release analysis</title>
		<link>http://bafford.com/2009/02/24/safari-4-beta-and-webkit-release-analysis/</link>
		<comments>http://bafford.com/2009/02/24/safari-4-beta-and-webkit-release-analysis/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 17:20:27 +0000</pubDate>
		<dc:creator>John Bafford</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://bafford.com/?p=144</guid>
		<description><![CDATA[Earlier today, Apple released a beta version of Safari 4, with the version number 528.16. As is common knowledge, Safari is based on the open-source WebKit rendering engine, which releases nightly builds. For reference, the current WebKit version is 520.1+. Because WebKit is open source, using WebKit&#8217;s version history tracker, it&#8217;s possible to determine the [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier today, Apple released a beta version of <a href="http://www.apple.com/safari/download/">Safari 4</a>, with the version number 528.16.</p>
<p>As is common knowledge, Safari is based on the open-source <a href="http://webkit.org/">WebKit</a> rendering engine, which releases <a href="http://nightly.webkit.org/">nightly builds</a>. For reference, the current WebKit version is 520.1+.</p>
<p>Because WebKit is open source, using WebKit&#8217;s <a href="http://trac.webkit.org/">version history tracker</a>, it&#8217;s possible to determine the following interesting information:</p>
<p>* The <a href="http://trac.webkit.org/browser/branches/Safari-6528">Safari-6528</a> branch was created on January 29th based on the state of the WebKit trunk at r40289, from January 27th.</p>
<p>* There have been 75 merges of code (presumably bug fixes) into the 6528 branch since then. The last of these merges was r41097 (merging r41091) on February 19.</p>
<p>* The release is tagged in WebKit svn as <a href="http://trac.webkit.org/changeset/41182">r41182</a>, the<a href="http://trac.webkit.org/browser/releases/Apple/Safari%204%20Public%20Beta?rev=41182">/releases/Apple/Safari 4 Public Beta</a> tag.</p>
<p>This means that the Safari 4 beta is based roughly on the state of WebKit as it was at the end of January, one month behind current development. Considering the importance of WebKit to Safari in general, and Mac OS X as a whole, a one month delay for QA purposes is probably pretty good.</p>
<p>Kudos to all of the people working on WebKit! Keep up the good work!</p>
]]></content:encoded>
			<wfw:commentRss>http://bafford.com/2009/02/24/safari-4-beta-and-webkit-release-analysis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

