# HG changeset patch # User Simon Howkins # Date 1250242638 -3600 # Node ID f9ce0418735beb551573965bd8fab5aef9aff7eb # Parent 11662e122465083b27c788486ee996cc4365c257# Parent 26128bd2e266297bda5e1caa19b2f2c29d44527b Merge diff -r 11662e122465 -r f9ce0418735b build.xml --- a/build.xml Fri Aug 14 09:44:15 2009 +0100 +++ b/build.xml Fri Aug 14 10:37:18 2009 +0100 @@ -1,17 +1,31 @@ - + - + + + - + + + + + + + + + + + + + - + \ No newline at end of file diff -r 11662e122465 -r f9ce0418735b common/build.xml --- a/common/build.xml Fri Aug 14 09:44:15 2009 +0100 +++ b/common/build.xml Fri Aug 14 10:37:18 2009 +0100 @@ -232,6 +232,7 @@ + @@ -347,6 +348,15 @@ + + [SF-TAG-BUILD] + + + ant: antProperties() + + + + [SF-POSTBUILD] @@ -502,7 +512,7 @@ - + [SF-BUILD-NOPREP] @@ -539,23 +549,26 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -711,7 +724,6 @@ - @@ -869,7 +881,7 @@ - + diff -r 11662e122465 -r f9ce0418735b common/common_props.ant.xml --- a/common/common_props.ant.xml Fri Aug 14 09:44:15 2009 +0100 +++ b/common/common_props.ant.xml Fri Aug 14 10:37:18 2009 +0100 @@ -54,6 +54,7 @@ + diff -r 11662e122465 -r f9ce0418735b common/diamonds/config.xml.ftl --- a/common/diamonds/config.xml.ftl Fri Aug 14 09:44:15 2009 +0100 +++ b/common/diamonds/config.xml.ftl Fri Aug 14 10:37:18 2009 +0100 @@ -71,6 +71,7 @@ defer="true"/> + diff -r 11662e122465 -r f9ce0418735b common/diamonds/sf-tag-build.xml.ftl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/diamonds/sf-tag-build.xml.ftl Fri Aug 14 10:37:18 2009 +0100 @@ -0,0 +1,8 @@ + + + + 10 + + ${ant['sf.spec.publish.diamonds.tag']} + + \ No newline at end of file diff -r 11662e122465 -r f9ce0418735b common/sysdefdowngrade/sysdefdowngrade.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/sysdefdowngrade/sysdefdowngrade.pl Fri Aug 14 10:37:18 2009 +0100 @@ -0,0 +1,93 @@ +# 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: +# Extracts output text in context which doesn't belong to 's + +use strict; +use Getopt::Long; + +my $XALAN_PATH = "xalan-j_2_7_1"; +my $XSLT_FILE = "sysdefdowngrade.xsl"; + +my $modelfile = ''; +my $csvsourcesfile = ''; +my $help = 0; +GetOptions(( + 'model=s' => \$modelfile, + 'sources=s' => \$csvsourcesfile, + 'help!' => \$help +)); + +$help = 1 if (!$modelfile or !$csvsourcesfile); + +if ($help) +{ + print "Checks that a model file is not in version 3.0.0. If it is transforms it to a version usable by Raptor\n"; + print "Usage: perl sysdefdowngrade.pl --model=MODELFILE --sources=SOURCESFILE\n\n"; + exit(0); +} + +my $isversion3 = 0; +open(MODELFILE, "$modelfile") or die("Can't open model file $modelfile"); +while() +{ + if ($_ =~ /) +{ + if ($_ =~ m{[^,]*,([\\/]sf[\\/][^,]*),[^,]*,[^,]*,[^,]*}) + { + $param_path = $1; + #print "param_path= $param_path\n"; + last; + } +} +close(SOURCESFILE); + +if (!$param_path) +{ + print "Error: could not determine path parameter from sources file. Quitting.\n"; + exit(0); +} + +$param_path =~ s,\\,/,g; + +my $transformcmd = "java -jar $XALAN_PATH\\xalan.jar -xsl $XSLT_FILE -in $modelfile -out $modelfile.transformed"; +$transformcmd .= " -param Path $param_path"; + +print "Executing: $transformcmd\n"; +system("$transformcmd"); + +# ren doesn't work with forward slashes +$modelfile =~ s,/,\\,g; + +$modelfile =~ m,.*[\\/](.*),; +my $modelfile_name = $1; +print "Executing: ren $modelfile $modelfile_name.orig\n"; +system("ren $modelfile $modelfile_name.orig"); + +print "Executing: ren $modelfile.transformed $modelfile_name\n"; +system("ren $modelfile.transformed $modelfile_name"); diff -r 11662e122465 -r f9ce0418735b common/sysdefdowngrade/sysdefdowngrade.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/sysdefdowngrade/sysdefdowngrade.xsl Fri Aug 14 10:37:18 2009 +0100 @@ -0,0 +1,355 @@ + + + + + os/deviceplatformrelease/foundation_system/system_model + + + + Cannot process this document + + + + + + + + + + + + + + + + + + + + Package definition cannot link another package + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error: IDs do not match: vs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Excessive nesting of packages: Ignoring + + + + + + + + + + + + + + + + + + + + + Y + + + plugin + + placeholder + PC + + + + + + + + + + + + + + + + + + + + + + + Y + N + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +]> +]]> + + \ No newline at end of file diff -r 11662e122465 -r f9ce0418735b common/sysdefdowngrade/xalan-j_2_7_1/serializer.jar Binary file common/sysdefdowngrade/xalan-j_2_7_1/serializer.jar has changed diff -r 11662e122465 -r f9ce0418735b common/sysdefdowngrade/xalan-j_2_7_1/xalan.jar Binary file common/sysdefdowngrade/xalan-j_2_7_1/xalan.jar has changed diff -r 11662e122465 -r f9ce0418735b common/sysdefdowngrade/xalan-j_2_7_1/xercesImpl.jar Binary file common/sysdefdowngrade/xalan-j_2_7_1/xercesImpl.jar has changed diff -r 11662e122465 -r f9ce0418735b common/sysdefdowngrade/xalan-j_2_7_1/xml-apis.jar Binary file common/sysdefdowngrade/xalan-j_2_7_1/xml-apis.jar has changed diff -r 11662e122465 -r f9ce0418735b common/tools/csvToSysDef.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/tools/csvToSysDef.pl Fri Aug 14 10:37:18 2009 +0100 @@ -0,0 +1,195 @@ +#!perl -w + +use strict; + +use FindBin; +use lib "$FindBin::Bin/lib"; + +use XML::Parser; +use Text::CSV; + +my $sourcesCSV = shift or die "First arg must be source csv file"; +my $backupBaseDir = shift or die "Second arg must be path to tree of package_definitions to use if not found in the source packages"; +shift and die "No more than two arguments please"; + +# Load CSV +open my $csvText, "<", $sourcesCSV or die; +my $csv = Text::CSV->new(); +my @keys; +my @packages; +while (my $line = <$csvText>) +{ + chomp $line; + next unless $line; + unless ($csv->parse($line)) + { + my $err = $csv->error_input(); + die "Failed to parse line '$line': $err"; + } + + if (! @keys) + { + # First line - note the column names + @keys = $csv->fields(); + } + else + { + # Already got the keys, so get the data + my %package; + # Read into a hash slice + @package{@keys} = $csv->fields(); + push @packages, \%package; + } +} +close $csvText; + +my $parser = new XML::Parser(Style => "Objects") or die; +my $outTree; + +# For each package in CSV... +foreach my $package (@packages) +{ + # If the sources.csv does not include a sys def for this package, it doesn't get built + next unless $package->{sysdef}; + # If it's in the "backup" location, use that one (ie our copy overrides the package's own copy) + my $pkgDef = "$package->{dst}/$package->{sysdef}"; + $pkgDef =~ s{^/sf/}{}; + $pkgDef =~ s{/[^/]*$}{}; + $pkgDef = "$backupBaseDir/$pkgDef/package_definition.xml"; + if (!-f $pkgDef) + { + # Not there, so look for the pkg defn in the root of the package tree + warn "Warning: Package $package->{dst} does not appear on the local system\n" unless -d $package->{dst}; + $pkgDef = "$package->{dst}/$package->{sysdef}"; + } + die "Unable to locate any package_definition at all for $package->{dst}" unless -f $pkgDef; + + warn "Including $pkgDef for $package->{dst}\n"; + my $pkgTree = eval { $parser->parsefile($pkgDef) } or die "Failed to parse $pkgDef : $@"; + if (!$outTree) + { + # The first file is taken verbatim + $outTree = $pkgTree; + } + else + { + # Merge into output Tree + mergeTrees($outTree->[0], $pkgTree->[0]); + } +} + +# Output total tree +print "\n"; +printTree($outTree->[0]); +print "\n"; + +exit; + +sub mergeTrees +{ + my $baseTree = shift or die; + my $extrasTree = shift or die; + + die ("Package Definitions do not match: ".(ref $baseTree)." vs ".(ref $extrasTree)) unless ref $baseTree eq ref $extrasTree; + return if ref $baseTree eq "main::Characters"; + + foreach my $extraChild (@{$extrasTree->{Kids}}) + { + # Work out whether this child should be merged with a namesake, or appended + my $mergeIt = undef; + + my $extraChildTag = ref $extraChild; + $extraChildTag =~ s{^main::}{}; + + if ($extraChildTag =~ m{^(SystemDefinition|systemModel)$}) + { + # Should be merged if there's already one there + # Look for a namesake in the base + $mergeIt = matchTag($baseTree->{Kids}, $extraChild, undef); + } + elsif ($extraChildTag =~ m{layer|block|package|collection|component}) + { + # Should be merged if there is another tag with the same "name" attribute + # Look for a namesake in the base + $mergeIt = matchTag($baseTree->{Kids}, $extraChild, "name"); + } + + if ($mergeIt) + { + # Merge children + mergeTrees($mergeIt, $extraChild); + } + else + { + # Add this child + push @{$baseTree->{Kids}}, $extraChild; + } + } +} + +sub matchTag +{ + my $peers = shift; + my $outsider = shift; + my $attr = shift; + + foreach my $peer (@$peers) + { + if (ref $peer eq ref $outsider && (!defined $attr || $peer->{$attr} eq $outsider->{$attr})) + { + return $peer; + } + } + + return undef; +} + +sub printTree +{ + my $tree = shift or die; + die unless ref $tree; + + my $tagName = ref $tree; + $tagName =~ s{^main::}{}; + if ($tagName eq "Characters") + { + print $tree->{Text}; + return; + } + + print "<$tagName"; + + foreach my $attr ( + sort { + my $order = "name long-name tech_domain level span schema levels filter introduced deprecated purpose class plugin origin-model bldFile mrp version priority"; + my $ixA = index $order, $a; + my $ixB = index $order, $b; + die "$a $b" if $ixA + $ixB == -2; + $ixA - $ixB; + } + grep { + ! ref $tree->{$_} + } + keys %$tree) + { + print " $attr=\"$tree->{$attr}\""; + } + + my $children = $tree->{Kids}; + if (scalar @$children) + { + print ">"; + foreach my $child (@$children) + { + printTree($child); + } + print ""; +} + diff -r 11662e122465 -r f9ce0418735b common/tools/raptor/RaptorCommon.pm --- a/common/tools/raptor/RaptorCommon.pm Fri Aug 14 09:44:15 2009 +0100 +++ b/common/tools/raptor/RaptorCommon.pm Fri Aug 14 10:37:18 2009 +0100 @@ -19,9 +19,26 @@ our $CATEGORY_RAPTORERROR = 'raptor_error'; our $CATEGORY_RAPTORERROR_CANNOTPROCESSSCHEMAVERSION = 'cannot_process_schema_version'; our $CATEGORY_RAPTORERROR_NOBLDINFFOUND = 'no_bld_inf_found'; +our $CATEGORY_RAPTORERROR_CANTFINDMMPFILE = 'cant_find_mmp_file'; +our $CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS = 'make_exited_with_errors'; +our $CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION = 'tool_didnot_return_version'; our $SEVERITY_UNKNOWN = 'unknown'; our $SEVERITY_CRITICAL = 'critical'; +our $SEVERITY_MAJOR = 'major'; +our $SEVERITY_NORMAL = 'normal'; +our $SEVERITY_MINOR = 'minor'; + +sub init +{ + my $filename = "$::basedir/summary.csv"; + if (!-f$filename) + { + print "Writing summary file $filename\n"; + open(SUMMARY, ">$filename"); + close(SUMMARY); + } +} sub dump_fault { diff -r 11662e122465 -r f9ce0418735b common/tools/raptor/RaptorError.pm --- a/common/tools/raptor/RaptorError.pm Fri Aug 14 09:44:15 2009 +0100 +++ b/common/tools/raptor/RaptorError.pm Fri Aug 14 10:37:18 2009 +0100 @@ -27,6 +27,7 @@ $buildlog_status->{name} = 'buildlog_status'; $buildlog_status->{next_status} = {error=>$buildlog_error_status}; +$buildlog_status->{on_start} = 'RaptorError::on_start_buildlog'; $buildlog_error_status->{name} = 'buildlog_error_status'; $buildlog_error_status->{next_status} = {}; @@ -54,22 +55,51 @@ } elsif ($text =~ m,No bld\.inf found at,) { + $severity = $RaptorCommon::SEVERITY_MAJOR; + my $subcategory = $RaptorCommon::CATEGORY_RAPTORERROR_NOBLDINFFOUND; + RaptorCommon::dump_fault($category, $subcategory, $severity, $component, $phase, $recipe, $file, $line); + } + elsif ($text =~ m,Can't find mmp file,) + { + $severity = $RaptorCommon::SEVERITY_NORMAL; + my $subcategory = $RaptorCommon::CATEGORY_RAPTORERROR_CANTFINDMMPFILE; + RaptorCommon::dump_fault($category, $subcategory, $severity, $component, $phase, $recipe, $file, $line); + } + elsif ($text =~ m,The make-engine exited with errors,) + { $severity = $RaptorCommon::SEVERITY_CRITICAL; - my $subcategory = $RaptorCommon::CATEGORY_RAPTORERROR_NOBLDINFFOUND; + my $subcategory = $RaptorCommon::CATEGORY_RAPTORERROR_MAKEEXITEDWITHERRORS; + RaptorCommon::dump_fault($category, $subcategory, $severity, $component, $phase, $recipe, $file, $line); + } + elsif ($text =~ m,tool .* from config .* did not return version .* as required,) + { + $severity = $RaptorCommon::SEVERITY_CRITICAL; + my $subcategory = $RaptorCommon::CATEGORY_RAPTORERROR_TOOLDIDNOTRETURNVERSION; RaptorCommon::dump_fault($category, $subcategory, $severity, $component, $phase, $recipe, $file, $line); } else # log everything by default { - $severity = $RaptorCommon::SEVERITY_UNKNOWN; + $severity = $RaptorCommon::SEVERITY_NORMAL; my $subcategory = ''; RaptorCommon::dump_fault($category, $subcategory, $severity, $component, $phase, $recipe, $file, $line); } } +sub on_start_buildlog +{ + RaptorCommon::init(); + + $filename = "$::basedir/errors.txt"; + if (!-f$filename) + { + print "Writing error file $filename\n"; + open(FILE, ">$filename"); + close(FILE); + } +} + sub on_start_buildlog_error { - $filename = "$::basedir/errors.txt"; - print "Writing error file $filename\n" if (!-f$filename); open(FILE, ">>$filename"); } diff -r 11662e122465 -r f9ce0418735b common/tools/raptor/RaptorReleaseable.pm --- a/common/tools/raptor/RaptorReleaseable.pm Fri Aug 14 09:44:15 2009 +0100 +++ b/common/tools/raptor/RaptorReleaseable.pm Fri Aug 14 10:37:18 2009 +0100 @@ -35,6 +35,7 @@ $buildlog_status->{name} = 'buildlog_status'; $buildlog_status->{next_status} = {whatlog=>$whatlog_status}; +$buildlog_status->{on_start} = 'RaptorReleaseable::on_start_buildlog'; $whatlog_status->{name} = 'whatlog_status'; $whatlog_status->{next_status} = {bitmap=>$bitmap_status, resource=>$resource_status, build=>$build_status, export=>$export_status, stringtable=>$stringtable_status, archive=>$archive_status, '?default?'=>$whatlog_default_status}; @@ -88,6 +89,11 @@ my $curfiletype = 'unknown'; my $characters = ''; +sub on_start_buildlog +{ + mkdir("$::basedir/releaseables"); +} + sub on_start_whatlog { my ($el) = @_; @@ -223,7 +229,6 @@ my $layer = $1; my $package = $2; - mkdir("$::basedir/releaseables"); mkdir("$::basedir/releaseables/$layer"); mkdir("$::basedir/releaseables/$layer/$package"); diff -r 11662e122465 -r f9ce0418735b sf-package/build.xml --- a/sf-package/build.xml Fri Aug 14 09:44:15 2009 +0100 +++ b/sf-package/build.xml Fri Aug 14 10:37:18 2009 +0100 @@ -13,6 +13,15 @@ + + + + + + + + + @@ -21,72 +30,127 @@ - - - + + + + + + - - - - - + + - - - - + + + + + - - + + --> - - - - + + + + + + - - - - + + - - - + + + + + + - - - + - + diff -r 11662e122465 -r f9ce0418735b sf-package/package_props.ant.xml --- a/sf-package/package_props.ant.xml Fri Aug 14 09:44:15 2009 +0100 +++ b/sf-package/package_props.ant.xml Fri Aug 14 10:37:18 2009 +0100 @@ -4,7 +4,7 @@ - + @@ -12,6 +12,10 @@ + + + + diff -r 11662e122465 -r f9ce0418735b sf-package/package_refs.ant.xml --- a/sf-package/package_refs.ant.xml Fri Aug 14 09:44:15 2009 +0100 +++ b/sf-package/package_refs.ant.xml Fri Aug 14 10:37:18 2009 +0100 @@ -4,8 +4,8 @@ - + - - \ No newline at end of file + + \ No newline at end of file