📄 build_watch.pl
字号:
#-----------------------------------------------------------------------------
# Project :
# Modul : J:\g23m\condat\int\bin\build_watch.pl
#-----------------------------------------------------------------------------
# Copyright 2002 Texas Instruments Berlin, AG
# All rights reserved.
#
# This file is confidential and a trade secret of Texas
# Instruments Berlin, AG
# The receipt of or possession of this file does not convey
# any rights to reproduce or disclose its contents or to
# manufacture, use, or sell anything it may describe, in
# whole, or in part, without the specific written consent of
# Texas Instruments Berlin, AG.
#-----------------------------------------------------------------------------
#| Purpose :
#-----------------------------------------------------------------------------
open (HTML,">build_status.html");
print HTML"<html><head><meta http-equiv=\"refresh\" content=\"5\"><title> Make Status </title> </head>\n";
print HTML"<body bgcolor=#ffffff>\n";
print HTML"Build Started";
print HTML"<body>";
close (HTML);
#system("start /b build_status.html");
while(1)
{
rename"temp.html","build_status.html";
sleep(2);
$mod_size=(stat("report.txt"))[7];
unless($mod_size>$old_size) #check if something has changed
{
$check_time=time;
if(($check_time-$file_time) > 120) #nothing changed for 2 minutes
{
open (HTML,">temp.html");
$sys_error="Build stopped!!";
print HTML "<html>
<head>
<title> Make Status </title>
</head>
<body bgcolor=\"#ffffff\">
$time <br><strong>$sys_error</strong><br>".join(' ',reverse @error)."<br>".join(' ',reverse @content)."
</body>
</html>";
close (HTML);
rename"temp.html","build_status.html";
exit;
}
if($last_line =~ m|Leaving directory.*GSM'$|)
{
open (HTML,">temp.html");
$sys_error="Build finished!";
print HTML "<html>
<head>
<title> Make Status </title>
</head>
<body bgcolor=\"#ffffff\">
$time <br><strong>$sys_error</strong><br><font color=\"#008800\"><br> number of warnings: $warning<br> </font>".join(' ',reverse @error)."<br>".join(' ',reverse @content)."
</body>
</html>";
close (HTML);
rename"temp.html","build_status.html";
exit;
}
if($last_line =~ m|\*\*\* Error|)
{
open (HTML,">temp.html");
$sys_error="Build failed!";
print HTML "<html>
<head>
<title> Make Status </title>
</head>
<body bgcolor=\"#ffffff\">
$time <br><strong>$sys_error</strong><br>".join(' ',reverse @error)."<br>".join(' ',reverse @content)."
</body>
</html>";
close (HTML);
rename"temp.html","build_status.html";
exit;
}
}
else #report.txt has changed
{
$warning=0;
@content=();
@error=();
$file_time=time;
$old_size=$mod_size;
open (REP,"<report.txt");
$time = time;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($time);
if($year >= 100)
{
$year -= 100;
}
$time=sprintf ("%02d:%02d:%02d %02d/%02d/%02d",$hour,$min,$sec,$mday,$mon+1,$year);
while(<REP>)
{
chomp;
if (m|^\[(.*)\]|)
{
push @content,'<br>'.$1; #file compilation of $file in progress
next;
}
if (m|\[[FE]|)
{
push @content,'<br>'.' <font color="#ff0000">'.$_.'</font>';
push @error,'<br>'.' <font color="#ff0000">'.$_.'</font>';
next;
}
if (m|\[W|)
{
$warning ++;
next;
}
if (m|Don\'t know how to make|)
{
push @content,'<br>'.' <font color="#ff0000">'.$_.'</font>';
push @error,'<br>'.' <font color="#ff0000">'.$_.'</font>';
next:
}
unless(m|^\s*$|)
{
$last_line=$_;
}
}
close (REP);
open (HTML,">temp.html");
print HTML"<html>
<head>
<meta http-equiv=\"refresh\" content=\"5\">
<title> Make Status </title>
</head>
<body bgcolor=#ffffff>
$time <br>".join(' ',reverse @content)."<br>$sys_error
</body>
</html>";
close (HTML);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -