common/tools/summary/brag_script.pl
author Simon Howkins <simonh@symbian.org>
Tue, 25 Aug 2009 11:06:23 +0100
changeset 380 d4dac57985d9
parent 366 cde2244c8ea6
child 382 63fdf0583f67
permissions -rw-r--r--
Bug 299 populateziptemplate.pl aborts if it cannot determine the license for a source component Changed so that even if it encounters an error it will still generate the output file before it exits with a failure error code.

# Copyright (c) 2009 Symbian Foundation Ltd
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Symbian Foundation Ltd - initial contribution.
#
# Contributors:
#
# Description:
# Generate build summary with BRAG status

use Getopt::Long;

my $buildid = '';
my $basedir = '';
my $help = 0;
GetOptions((
	'buildid=s' => \$buildid,
	'basedir=s' => \$basedir,
	'help!' => \$help
));

$help = 1 if (!$buildid or !$basedir);

if ($help)
{
	print "Generate build summary with BRAG status\n";
	print "Usage: perl brag_script.pl --buildid=ID --basedir=DIR\n";
	exit(0);
}

$buildid =~ /^([^_]*)_([^.]*)\./;
my $project = $1;
my $codeline = $2;

my $logdir = "$basedir\\$buildid\\output\\logs";

opendir(DIR, $logdir);
my @dir_content = readdir(DIR);
close(DIR);
#my @asSimilarDirs = grep(/^$sBaseName(\.|$)/, @asDirs);

my $nfiles = scalar(@dir_content);


open(FILE, ">$logdir\\build_summary.html");
print FILE "<html><body>build summary<br/>build id: $buildid<br/>log files: $nfiles</body></html>";
close(FILE);

my $copy_cmd = "copy $logdir\\build_summary.html \\\\bishare\\sf_builds\\$project\\builds\\$codeline\\$buildid";
print "Exec: $copy_cmd\n";
system($copy_cmd);