Re: Automatic versioning
Re: Automatic versioning
- Subject: Re: Automatic versioning
- From: Steve Checkoway <email@hidden>
- Date: Sat, 3 Feb 2007 17:34:29 -0800
On Feb 3, 2007, at 4:48 PM, Steve Checkoway wrote:
I have a version target upon which my main target depends. This is
a custom build tool target. The build tool configuration uses /bin/
sh as the build tool and scripts/increment_version.sh as the
argument. The bash script is the following:
Just to follow up on my last reply, using /usr/bin/perl as the tool
and converting the bash script to the following perl script worked.
#!/usr/bin/perl -w
$ver = 0;
if( open FH, '<ver.cpp' )
{
$_ = <FH>;
/version_num = (\d+);/ and $ver = $1+1;
close FH;
}
chop( $date = `date` );
open FH, '>ver.cpp' or die $!;
# Cannot use const here since gcc will strip it out...
print FH <<"EOF";
unsigned long version_num = $ver;
const char *version_time = "$date";
EOF
close FH;
No need for extra files with strange extensions.
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden