diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /devtools/bin/buildtest.pl | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'devtools/bin/buildtest.pl')
| -rw-r--r-- | devtools/bin/buildtest.pl | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/devtools/bin/buildtest.pl b/devtools/bin/buildtest.pl new file mode 100644 index 0000000..16730b5 --- /dev/null +++ b/devtools/bin/buildtest.pl @@ -0,0 +1,83 @@ +use strict; + +sub DoBuild +{ + my @output; + my $buildtype = shift; + if( $buildtype eq "release" ) + { + open BUILD, "dev_build_all.bat|"; + } + elsif( $buildtype eq "debug" ) + { + open BUILD, "dev_build_all.bat debug|"; + } + else + { + die; + } + my $buildfailed = 0; + while( <BUILD> ) + { + if( /Build Errors\!/ ) + { + $buildfailed = 1; + } + print; + push @output, $_; + } + close build; + + if( $buildfailed ) + { + open CHANGES, "p4 changes -m 10 -s submitted //ValveGames/main/src/...|"; + my @changes = <CHANGES>; + close CHANGES; + open EMAIL, ">email.txt"; + print EMAIL "LAST 10 SUBMITS TO MAIN:\n"; + print EMAIL @changes; + print EMAIL "\n"; + my $line; + foreach $line ( @output ) + { + if( $line =~ m/error/i ) + { + print EMAIL $line; + } + } + print EMAIL "--------------------------------------------\n\n\n\n"; + print EMAIL @output; + close EMAIL; + system "devtools\\bin\\smtpmail.exe -to srcdev\@valvesoftware.com -from srcdev\@valvesoftware.com -subject \"FIX THE BUILD\! ($buildtype)\" -verbose email.txt"; +# system "devtools\\bin\\smtpmail.exe -to gary\@valvesoftware.com -from srcdev\@valvesoftware.com -subject \"FIX THE BUILD\! ($buildtype)\" -verbose email.txt"; + } +} + +while( 1 ) +{ + $ENV{"USE_INCREDIBUILD"} = "1"; + system "p4 sync > sync.txt 2>&1"; + my $hasChange = 1; + my $line; + open SYNC, "<sync.txt"; + while( <SYNC> ) + { + if( m/File\(s\) up-to-date/ ) + { + $hasChange = 0; + } + print; + } + close SYNC; + if( $hasChange ) + { + print "changes checked in\n"; + &DoBuild( "release" ); + &DoBuild( "debug" ); + } + else + { + print "no changes checked in\n"; + sleep 30; + } +}
\ No newline at end of file |