Sleds/masterbuild/updateCodeCoverageMasterIndex.pl

54 lines
1.6 KiB
Perl

#!/usr/bin/perl
# updateCodeCoverageMasterIndex.pl {path to un-jarred documentation}
# updateCodeCoverageMasterIndex.pl /var/www/html/development
# This script will find all the project documentation's index.html
# files, and create a top level 'master' for use with docserv.
if (@ARGV != 1)
{
print "Usage:\n";
print "updateCodeCoverageMasterIndex.pl {path to un-jarred documentation}\n";
}
else
{
#@indexFiles = `find $ARGV[0] -name "index.html"`;
@projects = `ls $ARGV[0]`;
if (@projects > 0)
{
# Create a file called "masterIndex.html" in the dest directory.
if (open(MASTER_IDX_FILE, ">$ARGV[0]/masterCodeCoverageIndex.html"))
{
print MASTER_IDX_FILE <<ENDOFHEADER;
<html>
<head>
<title>Sequence Logic Unit Test Code Coverage</title>
</head>
<body>
ENDOFHEADER
print MASTER_IDX_FILE " <H1>Projects</h1>\n <ul>\n";
foreach $project (@projects)
{
chomp $project;
$project =~ s/$ARGV[0]//g;
$indexFile = $project;
$indexFile .= "/index.html";
#print "Found project: $project, index file is $indexFile\n";
if (-f $ARGV[0] . "/" . $indexFile)
{
print "Found index: $indexFile\n";
print MASTER_IDX_FILE " <a href=\"$indexFile\">$project</a><br>\n"
}
}
print MASTER_IDX_FILE <<ENDOFFOOTER;
</body>
</html>
ENDOFFOOTER
close MASTER_IDX_FILE;
}
}
}