tsrc/scripts/buildcheck.cmd
changeset 0 f0cf47e981f9
equal deleted inserted replaced
-1:000000000000 0:f0cf47e981f9
       
     1 rem
       
     2 rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 rem All rights reserved.
       
     4 rem This component and the accompanying materials are made available
       
     5 rem under the terms of "Eclipse Public License v1.0"
       
     6 rem which accompanies this distribution, and is available
       
     7 rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 rem
       
     9 rem Initial Contributors:
       
    10 rem Nokia Corporation - initial contribution.
       
    11 rem
       
    12 rem Contributors:
       
    13 rem
       
    14 rem Description:
       
    15 rem
       
    16 
       
    17 @goto invoke_perl
       
    18 
       
    19 #!perl
       
    20 #line 5
       
    21 
       
    22 ################################################################################################################
       
    23 # This Script will be used to count errors and warnings in abld
       
    24 ################################################################################################################
       
    25 
       
    26 #	Packages needed
       
    27 use strict;					# strict naming rules
       
    28 use Getopt::Long;		# parameter handling
       
    29 use Cwd;						# Directory operations
       
    30 Getopt::Long::Configure( "bundling_override","ignore_case_always" );
       
    31 
       
    32 my($param_help,
       
    33 	 $param_dest);
       
    34 my($ecount)=0;
       
    35 my($wcount)=0;
       
    36 my($destination)=cwd;
       
    37 
       
    38 # read commandline parameters
       
    39 my $result = GetOptions('help'			=> \$param_help,						# Display help info												
       
    40 												'dest=s' 		=> \$param_dest);					  # Destination directory												
       
    41 if(defined $param_dest){
       
    42 	$destination=$param_dest ;		
       
    43 	}
       
    44 else{
       
    45 	print "\n Note: No results destination directory specified.\n";
       
    46 	$destination=~s/\//\\/g;
       
    47 	$destination=$destination."\\";
       
    48 	}	
       
    49 	
       
    50 $destination.="\Build";
       
    51 mkdir($destination);
       
    52 print " Note: Results will be copied to $destination\n";
       
    53 open SUMMARY,">$destination\\summary.txt" or die "Can't Open $!";
       
    54 system("bldmake bldfiles");
       
    55 display_critical_error() if($?!=0);   
       
    56 system("abld reallyclean winscw urel");
       
    57 print "\n *** Building for winscw urel and logging in file $destination\\winscw_log.txt *** \n";
       
    58 system("abld build winscw urel >$destination\\winscw_log.txt");
       
    59 display_critical_error() if($?!=0);   
       
    60 print "\n *** End of Building for winscw urel *** \n";
       
    61 open LOGFILE,"$destination\\winscw_log.txt" or die "Can't Open $!";
       
    62 print "\n *** Writing summary for winscw *** \n";
       
    63 while(<LOGFILE>){
       
    64  if($_=~/error/){
       
    65  $ecount++;
       
    66  }
       
    67  if($_=~/warning/){
       
    68  $wcount++;
       
    69  }
       
    70 }
       
    71 close LOGFILE;
       
    72 print SUMMARY "WINSCW build Errors\t=$ecount \n";
       
    73 print SUMMARY "WINSCW build Warnings\t=$wcount \n";
       
    74 $ecount=0;
       
    75 $wcount=0;
       
    76 print "\n *** Building for armv5 urel and logging in $destination\\armv5_log.txt *** \n";
       
    77 system("abld reallyclean armv5 urel");
       
    78 system("abld build armv5 urel >$destination\\armv5_log.txt");
       
    79 display_critical_error() if($?!=0);
       
    80 print "\n *** End of Building for armv5 urel *** \n";
       
    81 open LOGFILE,"$destination\\armv5_log.txt" or die "Can't Open $!";
       
    82 print "\n *** Writing summary for armv5 *** \n ";
       
    83 while(<LOGFILE>){
       
    84  if($_=~/error/){
       
    85  $ecount++;
       
    86  }
       
    87  if($_=~/warning/){
       
    88  $wcount++;
       
    89  }
       
    90 }
       
    91 close LOGFILE;
       
    92 print SUMMARY "ARMV5 build Errors\t=$ecount \n";
       
    93 print SUMMARY "ARMV5 build Warnings\t=$wcount \n";
       
    94 close LOGFILE;
       
    95 close SUMMARY;
       
    96 print "\n *** DONE *** \n";
       
    97 
       
    98 sub display_critical_error {  
       
    99   print "\n-> Critical Error Occured : ".$?."\n" if(!@_[0]);  
       
   100   print "\n-> Critical Error Occured : ".@_[0]."\n" if(@_[0]);  	  
       
   101   exit 1;
       
   102   }	
       
   103 __END__
       
   104 
       
   105 :invoke_perl
       
   106 @perl -x -S buildcheck.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9