Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.5 KiB

  1. use strict;
  2. use File::Path;
  3. print( "\nDeleting old backup\n" );
  4. system( "rmdir \/s \/q backup" );
  5. print( "\nMoving previous snapshot to backup\n" );
  6. system( "ren snapshot backup" );
  7. print( "\nSearching for .vcproj files...\n" );
  8. # Find all vcproj's in src
  9. system( "dir \/s U:\\main\\src\\*.vcproj \> vcproj.txt" );
  10. # Read in the source file
  11. open(INFILE, "vcproj.txt" );
  12. my @lines = <INFILE>;
  13. close( INFILE );
  14. # Process the file one line at a time
  15. my @output;
  16. # print the header lines
  17. push( @output, "\/\/ VGC file\n" );
  18. push( @output, "\n" );
  19. push( @output, "\/\/\n" );
  20. push( @output, "\/\/ Project definitions\n" );
  21. push( @output, "\/\/\n" );
  22. push( @output, "\n" );
  23. for( my($i) = 0; $i < @lines; ++$i )
  24. {
  25. # Grab the path
  26. if ( $lines[$i] =~ /Directory of U:\\main\\src\\(.*)/ )
  27. {
  28. my($path) = $1;
  29. ++$i;
  30. # ignore projects in vpc_scripts!
  31. if ( $path =~ /vpc_scripts/ )
  32. {
  33. next;
  34. }
  35. # Grab the .vcproj filenames
  36. while ( $lines[++$i] =~ /[\d+\/]{2}\d+\s+\S+\s+\w{2}\s+\S+\s+(\w+).vcproj/ )
  37. {
  38. if ( $1 =~ /_x360/ )
  39. {
  40. next;
  41. }
  42. my($projectName) = $1;
  43. my($fullpath) = join('\\', "snapshot", $path );
  44. mkpath ($fullpath);
  45. my($fullname) = join('\\', $fullpath, $projectName );
  46. print "\nProcessing $projectName\n\n";
  47. # generate the vpc
  48. system ( "generateVPC2005.pl ..\\$path\\$projectName -o $fullpath" );
  49. # copy the .vcproj into the script tree
  50. system ( "copy /y ..\\$path\\$projectName.vcproj $fullpath" );
  51. }
  52. }
  53. }