Re: Automatic build number incrementing
Re: Automatic build number incrementing
- Subject: Re: Automatic build number incrementing
- From: Axel Andersson <email@hidden>
- Date: Sun, 22 May 2005 12:57:48 +0200
On May 22, 2005, at 04:50, email@hidden wrote:
Yep, it's that time of year again where we do our annual "Why the
bleep doesn't PB/Xcode have auto-incrementing build numbers
yet?!? ...and how can we get around it?".
I use the following Perl script to inject my Subversion repository
revision into the built products Info.plist CFBundleVersion. It runs
as a last script build phase in my application target. It shouldn't
be that difficult to make it write out an arbitrary build number
instead. Works in Xcode 2.0.
#!/usr/bin/perl -w
use strict;
die "$0: Must be run from Xcode" unless $ENV{"BUILT_PRODUCTS_DIR"};
my $REV = `svn info | grep "^Revision:"`;
my $INFO = "$ENV{BUILT_PRODUCTS_DIR}/$ENV{WRAPPER_NAME}/Contents/
Info.plist";
my $version = $REV;
$version =~ s/^Revision: (\d+)\n/$1/;
die "$0: No Subversion revision found" unless $version;
open(FH, "$INFO") or die "$0: $INFO: $!";
my $info = join("", <FH>);
close(FH);
$info =~ s/([\t ]+<key>CFBundleVersion<\/key>\n[\t ]+<string>).*?(<\/
string>)/$1$version$2/;
open(FH, ">$INFO") or die "$0: $INFO: $!";
print FH $info;
close(FH);
--
Axel Andersson
email@hidden
http://www.zankasoftware.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden