Added StopForErrors() and DontStopForErrors(). The former is the default, though logging must be on to allow errors to be noticed.
git-svn-id: svn://10.0.0.236/trunk@2066 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -22,7 +22,7 @@ require Exporter;
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw();
|
||||
@EXPORT_OK = qw(BuildProject,OpenErrorLog,CloseErrorLog,UseCodeWarriorLib,Configure);
|
||||
@EXPORT_OK = qw(BuildProject,OpenErrorLog,CloseErrorLog,UseCodeWarriorLib,Configure,StopForErrors,DontStopForErrors);
|
||||
|
||||
use Cwd;
|
||||
|
||||
@@ -76,6 +76,7 @@ sub Configure($)
|
||||
|
||||
$logging = 0;
|
||||
$recent_errors_file = "";
|
||||
$stop_on_1st_error = 1;
|
||||
|
||||
sub CloseErrorLog()
|
||||
{
|
||||
@@ -103,6 +104,16 @@ sub OpenErrorLog($)
|
||||
}
|
||||
}
|
||||
|
||||
sub StopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 1;
|
||||
}
|
||||
|
||||
sub DontStopForErrors()
|
||||
{
|
||||
$stop_on_1st_error = 0;
|
||||
}
|
||||
|
||||
sub log_message($)
|
||||
{
|
||||
if ( $logging )
|
||||
@@ -124,18 +135,30 @@ sub log_message_with_time($)
|
||||
|
||||
sub log_recent_errors()
|
||||
{
|
||||
my $found_errors = 0;
|
||||
|
||||
if ( $logging )
|
||||
{
|
||||
open(RECENT_ERRORS, "<$recent_errors_file");
|
||||
|
||||
while( <RECENT_ERRORS> )
|
||||
{
|
||||
if ( $_ =~ m/^Error/ )
|
||||
{
|
||||
$found_errors = 1;
|
||||
}
|
||||
print ERROR_LOG $_;
|
||||
}
|
||||
|
||||
close(RECENT_ERRORS);
|
||||
unlink("$recent_errors_file");
|
||||
}
|
||||
|
||||
if ( $stop_on_1st_error && $found_errors )
|
||||
{
|
||||
print ERROR_LOG "### Build failed.\n";
|
||||
die "### Build failed with errors, stopped";
|
||||
}
|
||||
}
|
||||
|
||||
sub BuildProject($;$)
|
||||
|
||||
Reference in New Issue
Block a user