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.

82 lines
1.6 KiB

  1. use strict;
  2. sub DoBuild
  3. {
  4. my @output;
  5. my $buildtype = shift;
  6. if( $buildtype eq "release" )
  7. {
  8. open BUILD, "dev_build_all.bat|";
  9. }
  10. elsif( $buildtype eq "debug" )
  11. {
  12. open BUILD, "dev_build_all.bat debug|";
  13. }
  14. else
  15. {
  16. die;
  17. }
  18. my $buildfailed = 0;
  19. while( <BUILD> )
  20. {
  21. if( /Build Errors\!/ )
  22. {
  23. $buildfailed = 1;
  24. }
  25. print;
  26. push @output, $_;
  27. }
  28. close build;
  29. if( $buildfailed )
  30. {
  31. open CHANGES, "p4 changes -m 10 -s submitted //ValveGames/main/src/...|";
  32. my @changes = <CHANGES>;
  33. close CHANGES;
  34. open EMAIL, ">email.txt";
  35. print EMAIL "LAST 10 SUBMITS TO MAIN:\n";
  36. print EMAIL @changes;
  37. print EMAIL "\n";
  38. my $line;
  39. foreach $line ( @output )
  40. {
  41. if( $line =~ m/error/i )
  42. {
  43. print EMAIL $line;
  44. }
  45. }
  46. print EMAIL "--------------------------------------------\n\n\n\n";
  47. print EMAIL @output;
  48. close EMAIL;
  49. system "devtools\\bin\\smtpmail.exe -to srcdev\@valvesoftware.com -from srcdev\@valvesoftware.com -subject \"FIX THE BUILD\! ($buildtype)\" -verbose email.txt";
  50. # system "devtools\\bin\\smtpmail.exe -to gary\@valvesoftware.com -from srcdev\@valvesoftware.com -subject \"FIX THE BUILD\! ($buildtype)\" -verbose email.txt";
  51. }
  52. }
  53. while( 1 )
  54. {
  55. $ENV{"USE_INCREDIBUILD"} = "1";
  56. system "p4 sync > sync.txt 2>&1";
  57. my $hasChange = 1;
  58. my $line;
  59. open SYNC, "<sync.txt";
  60. while( <SYNC> )
  61. {
  62. if( m/File\(s\) up-to-date/ )
  63. {
  64. $hasChange = 0;
  65. }
  66. print;
  67. }
  68. close SYNC;
  69. if( $hasChange )
  70. {
  71. print "changes checked in\n";
  72. &DoBuild( "release" );
  73. &DoBuild( "debug" );
  74. }
  75. else
  76. {
  77. print "no changes checked in\n";
  78. sleep 30;
  79. }
  80. }