diff -r 000000000000 -r 83f4b4db085c bldsystemtools/commonbldutils/PC_P4Table.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bldsystemtools/commonbldutils/PC_P4Table.pm Tue Feb 02 01:39:43 2010 +0200 @@ -0,0 +1,202 @@ +# Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "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: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# Script generates PC and Perforce table when called from +# BuildLaunch.xml file. +# +# + +#!/usr/bin/perl -w +package PC_P4Table; +use strict; +use Time::Local; + +my $iBuildLaunchFileLocation; +my $iLinkPathLocation = "http://IntWeb/bitr/review_release.php"; +my $iBuildLaunchFileFound = "1"; +my $iClientSpecFileLocation = ""; + +my @gProduct_Clientinfo = ( + ['7.0s','Symbian_OS_v7.0'], + ['7.0e','Symbian_OS_v7.0_enhance'], + ['7.0','Symbian_OS_v7.0'], + ['8.0a','Symbian_OS_8.0'], + ['8.1a','Symbian_OS_v8.1'], + ['8.1b','Symbian_OS_v8.1'], + ['9.1','master'], + ['9.2','master'], + ['9.3','master'], + ['Future','master'], + ['9.4','master'], + ['9.5','master'], + ['9.6','master'], + ['tb92','master'], + ['tb101sf','master'] + ); + +##################################################################### +#Sub-Routine Name:getbuildloc +#Inputs :Product version +#Outputs :Returns log directory Location for product +#Description : +##################################################################### +sub getbuildloc + { + my $iProducts = shift; + my $i = 0; + + while($i < $#gProduct_Clientinfo+1) + { + if ($iProducts eq $gProduct_Clientinfo[$i][0]) + { + return $gProduct_Clientinfo[$i][1]; + } + $i++; + } + + return("Logs location not Found for product"); + } + + +# outline style sheet internally +my $gStyleSheet = " \n + + "; + + +########################################################################## +# +# Name : setBrowserFriendlyLinks() +# Synopsis: Re-formats UNC path to file, with a Opera/Fire-Fox friendly +# version. Lotus Notes may cause problems though. +# Inputs : UNC Path scalar +# Outputs : Scalar +# +########################################################################## +sub setBrowserFriendlyLinks { + my ($iOldLink) = @_; + + $iOldLink =~ s/\\/\//g; # swap backslashes to fwd slashes + return "file:///".$iOldLink; +} +########################################################################## +# +# Name : getBuildTime +# Synopsis : Create a string containing the build timestamp +# Inputs : None +# Outputs : GMT timestamp +########################################################################## +sub getBuildTime +{ + my $time = gmtime(time); # Get current GMT time + $time .= " GMT"; # Append GMT marker + return $time; # Return it +} + +########################################################################## +# +# Name : generateHTMLSummary() +# Synopsis: Creates an HTML report for the specified build. +# Inputs : Scalar containing the build snapshot and product type +# Outputs : HTML report, published in current working dir +########################################################################## +sub generateHTMLSummary { + + my ($iSnapshot, $iProduct,$iChangeList, $iClientSpec) = @_; + my $iLogLocation = getbuildloc( $iProduct ); + $iClientSpec =~ s/\/\/cedar/\/cedar/g; + my $iBuildLaunchFileLocation = "\\Builds01\\devbuilds\\$iLogLocation\\$iSnapshot\_Symbian_OS_v$iProduct\\logs\\BuildLaunch.xml"; + + open (SUMMARY, "+> $iSnapshot"."_"."$iProduct"."PC_Perforce_report.html") or die "ERROR:Can't open file : $!"; + + my $html_start = "\n + + " . + $gStyleSheet . + "" . "$iSnapshot "."$iProduct ". "PC and Perforce Reference + + + + ". + + "" . + " ". + " ". + "\n + + " . + "". + "\n". + "\n + + " . + " + ". + "\n". + "\n + + " . + "" . + "\n". + "\n + + " . + "". + "\n". + "
PC and Perforce Reference for $iProduct
+ +

+ [ External Builds Info ] + "."\n

+
+
BuildMachineName".`hostname`."" ."
ClientSpec$iClientSpec
Perforce Changelist$iChangeList
Build Start Time".getBuildTime()."" ."
+ + + "; + + + print SUMMARY $html_start; + + close SUMMARY; +}