common/tools/summary/brag_script.pl
changeset 366 cde2244c8ea6
child 375 63fdf0583f67
equal deleted inserted replaced
365:95e054b2bec1 366:cde2244c8ea6
       
     1 # Copyright (c) 2009 Symbian Foundation Ltd
       
     2 # This component and the accompanying materials are made available
       
     3 # under the terms of the License "Eclipse Public License v1.0"
       
     4 # which accompanies this distribution, and is available
       
     5 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     6 #
       
     7 # Initial Contributors:
       
     8 # Symbian Foundation Ltd - initial contribution.
       
     9 #
       
    10 # Contributors:
       
    11 #
       
    12 # Description:
       
    13 # Generate build summary with BRAG status
       
    14 
       
    15 use Getopt::Long;
       
    16 
       
    17 my $buildid = '';
       
    18 my $basedir = '';
       
    19 my $help = 0;
       
    20 GetOptions((
       
    21 	'buildid=s' => \$buildid,
       
    22 	'basedir=s' => \$basedir,
       
    23 	'help!' => \$help
       
    24 ));
       
    25 
       
    26 $help = 1 if (!$buildid or !$basedir);
       
    27 
       
    28 if ($help)
       
    29 {
       
    30 	print "Generate build summary with BRAG status\n";
       
    31 	print "Usage: perl brag_script.pl --buildid=ID --basedir=DIR\n";
       
    32 	exit(0);
       
    33 }
       
    34 
       
    35 $buildid =~ /^([^_]*)_([^.]*)\./;
       
    36 my $project = $1;
       
    37 my $codeline = $2;
       
    38 
       
    39 my $logdir = "$basedir\\$buildid\\output\\logs";
       
    40 
       
    41 opendir(DIR, $logdir);
       
    42 my @dir_content = readdir(DIR);
       
    43 close(DIR);
       
    44 #my @asSimilarDirs = grep(/^$sBaseName(\.|$)/, @asDirs);
       
    45 
       
    46 my $nfiles = scalar(@dir_content);
       
    47 
       
    48 
       
    49 open(FILE, ">$logdir\\build_summary.html");
       
    50 print FILE "<html><body>build summary<br/>build id: $buildid<br/>log files: $nfiles</body></html>";
       
    51 close(FILE);
       
    52 
       
    53 my $copy_cmd = "copy $logdir\\build_summary.html \\\\bishare\\sf_builds\\$project\\builds\\$codeline\\$buildid";
       
    54 print "Exec: $copy_cmd\n";
       
    55 system($copy_cmd);
       
    56 
       
    57