common/tools/summary/brag_script.pl
author Dario Sestito <darios@symbian.org>
Thu, 20 Aug 2009 10:44:38 +0100
changeset 370 6a77c1534c7f
parent 366 cde2244c8ea6
child 382 63fdf0583f67
permissions -rw-r--r--
Truclean should not be performed if the sources.csv line doesn't have a sysdef field

# 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);