PBProject -> Xcode

This commit is contained in:
AJ Kelly
2010-05-12 12:21:02 -05:00
parent 42e2d09d90
commit 6f98b30294
45 changed files with 0 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/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";
EOF
close FH;
move '.ver.tmp', 'ver.cpp';
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/perl -w
use strict;
use File::Copy;
use File::Path;
use File::Basename;
use File::Temp qw/tempfile tempdir/;
use Cwd;
my @docs = (
"Licenses.txt",
"Changelog_sm-ssc.txt",
"CommandLineArgs.txt",
"credits.txt",
"Themerdocs/"
);
# Passing a date for a CVS release gives StepMania-CVS-date.
# Otherwise you get StepMania-ver.
die "usage: $0 [date]\n" if @ARGV > 1;
my $root = getcwd;
my $scripts = dirname $0;
my $srcdir = ( $scripts =~ m{^/} ? "$scripts/../.." :
"$root/$scripts/../.." );
my $family;
my $id;
my $ver;
open FH, "$srcdir/src/ProductInfo.h" or die "Where am I?\n";
while( <FH> )
{
if( /^#define\s+PRODUCT_FAMILY_BARE\s+(.*?)\s*$/ ) {
$family = $1;
} elsif( /^#define\s+PRODUCT_ID_BARE\s+(.*?)\s*$/ ) {
$id = $1;
} elsif( /^#define\s+PRODUCT_VER_BARE\s+(.*?)\s*$/ ) {
$ver = $1;
}
}
close FH;
my $destname = @ARGV ? "$id-$ARGV[0]" : "$family-$ver";
$destname =~ s/\s+/-/g;
my $tmp = tempdir;
# Copy StepMania and make smzip
system 'cp', '-r', "$srcdir/sm-ssc.app", $tmp and die "cp -r failed: $!\n";
system 'strip', '-x', "$tmp/sm-ssc.app/Contents/MacOS/sm-ssc";
mkdir "$tmp/Packages";
system "$srcdir/Utils/CreatePackage.pl", $srcdir, "$tmp/Packages" and die "mksmdata.pl failed: $!\n";
# Copy docs
mkdir "$tmp/Docs";
copy "$srcdir/Docs/$_", "$tmp/Docs/$_" for @docs;
# Make a dmg
system qw/hdiutil create -ov -format UDZO -imagekey zlib-level=9 -srcfolder/, $tmp, '-volname', $destname, "$root/$destname-mac.dmg";
rmtree $tmp;