summaryrefslogtreecommitdiff
path: root/vpc_scripts/generateSnapshot.pl
diff options
context:
space:
mode:
Diffstat (limited to 'vpc_scripts/generateSnapshot.pl')
-rw-r--r--vpc_scripts/generateSnapshot.pl74
1 files changed, 74 insertions, 0 deletions
diff --git a/vpc_scripts/generateSnapshot.pl b/vpc_scripts/generateSnapshot.pl
new file mode 100644
index 0000000..4022b08
--- /dev/null
+++ b/vpc_scripts/generateSnapshot.pl
@@ -0,0 +1,74 @@
+use strict;
+use File::Path;
+
+print( "\nDeleting old backup\n" );
+system( "rmdir \/s \/q backup" );
+
+print( "\nMoving previous snapshot to backup\n" );
+system( "ren snapshot backup" );
+
+print( "\nSearching for .vcproj files...\n" );
+
+# Find all vcproj's in src
+system( "dir \/s U:\\main\\src\\*.vcproj \> vcproj.txt" );
+
+# Read in the source file
+
+open(INFILE, "vcproj.txt" );
+my @lines = <INFILE>;
+close( INFILE );
+
+# Process the file one line at a time
+
+my @output;
+
+# print the header lines
+push( @output, "\/\/ VGC file\n" );
+push( @output, "\n" );
+push( @output, "\/\/\n" );
+push( @output, "\/\/ Project definitions\n" );
+push( @output, "\/\/\n" );
+push( @output, "\n" );
+
+for( my($i) = 0; $i < @lines; ++$i )
+{
+ # Grab the path
+ if ( $lines[$i] =~ /Directory of U:\\main\\src\\(.*)/ )
+ {
+ my($path) = $1;
+ ++$i;
+
+ # ignore projects in vpc_scripts!
+ if ( $path =~ /vpc_scripts/ )
+ {
+ next;
+ }
+
+ # Grab the .vcproj filenames
+ while ( $lines[++$i] =~ /[\d+\/]{2}\d+\s+\S+\s+\w{2}\s+\S+\s+(\w+).vcproj/ )
+ {
+ if ( $1 =~ /_x360/ )
+ {
+ next;
+ }
+ my($projectName) = $1;
+
+ my($fullpath) = join('\\', "snapshot", $path );
+ mkpath ($fullpath);
+
+ my($fullname) = join('\\', $fullpath, $projectName );
+
+ print "\nProcessing $projectName\n\n";
+
+ # generate the vpc
+ system ( "generateVPC2005.pl ..\\$path\\$projectName -o $fullpath" );
+
+ # copy the .vcproj into the script tree
+ system ( "copy /y ..\\$path\\$projectName.vcproj $fullpath" );
+ }
+ }
+}
+
+
+
+