Files
itgmania212121/Xcode/scripts/increment_version.pl
T
Jason Felds 736338dab6 Make sure product_version is set for OS X.
This may go away when we move to cmake for good.
2015-03-22 10:03:50 -04:00

21 lines
506 B
Raku

#!/usr/bin/perl -w
use File::Copy;
$ver = 0;
if( open FH, '<ver.cpp' )
{
<FH> =~ /version_num = (\d+);/ and $ver = $1 + 1;
close FH;
}
chop( $date = `date` );
chop( $time = `time` );
open FH, '>.ver.tmp' or die $!;
print FH <<"EOF";
extern const unsigned long version_num = $ver;
extern const char *const version_date = "$date";
extern const char *const version_time = "$time";
extern char const * const product_version = "5.0-git-UNKNOWN";
EOF
close FH;
move '.ver.tmp', 'ver.cpp';