First drop of script to generate build summary
authorDario Sestito <darios@symbian.org>
Wed, 19 Aug 2009 11:53:12 +0100
changeset 366 cde2244c8ea6
parent 365 95e054b2bec1
child 367 bed8f6bc974b
child 375 63fdf0583f67
First drop of script to generate build summary
common/build.xml
common/diamonds/sf-run-analysis.xml.ftl
common/tools/summary/brag_script.pl
--- a/common/build.xml	Tue Aug 18 15:39:56 2009 +0100
+++ b/common/build.xml	Wed Aug 19 11:53:12 2009 +0100
@@ -77,6 +77,16 @@
         <echo>[SF-BUILD-ALL]</echo>
     </target>
     
+    <target name="sf-summary" depends="">
+        <echo>[SF-SUMMARY]</echo>
+        <echo message="Generating build summary"/>
+        <exec executable="perl" dir="${sf.common.config.dir}/tools/summary" failonerror="true">
+          <arg value="brag_script.pl"/>
+          <arg value="--buildid=${sf.spec.job.name}_${sf.spec.job.codeline}.${sf.spec.job.number}"/>
+          <arg value="--basedir=${sf.spec.job.rootdir}"/>
+        </exec>
+    </target>
+    
     <target name="sf-build-and-pack" depends="sf-build-noprep,sf-postbuild">
         <echo>[SF-BUILD-AND-PACK]</echo>
     </target>
--- a/common/diamonds/sf-run-analysis.xml.ftl	Tue Aug 18 15:39:56 2009 +0100
+++ b/common/diamonds/sf-run-analysis.xml.ftl	Wed Aug 19 11:53:12 2009 +0100
@@ -32,6 +32,11 @@
       <name>Raptor summary</name>
       <url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\logs\raptorbits\summary.csv</url>
     </file>
+    <file>
+      <type>log</type>
+      <name>Build Summary</name>
+      <url>file:///${ant['sf.spec.publish.networkdrive']}\${ant['sf.spec.job.name']}\builds\${ant['sf.spec.job.codeline']}\${ant['build.id']}\build_summary.html</url>
+    </file>
   </files>
   
 </diamonds-build>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/tools/summary/brag_script.pl	Wed Aug 19 11:53:12 2009 +0100
@@ -0,0 +1,57 @@
+# 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);
+
+