Merge from wip.
authorDaniel Jacobs <daniel.jacobs@nokia.com>
Thu, 13 May 2010 14:14:32 +0100
changeset 553 7d4971eaf863
parent 552 0d12d79bd42d (diff)
parent 509 a337b022f8a8 (current diff)
child 554 e7dd8533063f
Merge from wip.
sbsv2/raptor/RELEASE-NOTES.html
sbsv2/raptor/lib/flm/e32abiv2.flm
sbsv2/raptor/python/filter_list.py
sbsv2/raptor/python/raptor.py
sbsv2/raptor/python/raptor_make.py
sbsv2/raptor/test/smoke_suite/annofile2log.py
--- a/.hgtags	Tue May 04 14:01:37 2010 +0100
+++ b/.hgtags	Thu May 13 14:14:32 2010 +0100
@@ -7,3 +7,10 @@
 7006bcce52990f33d0c20c51bebc2b58ed36db60 stable
 7006bcce52990f33d0c20c51bebc2b58ed36db60 stable
 679d97112f986e16e9dbed3f7a016388d42e04f8 stable
+679d97112f986e16e9dbed3f7a016388d42e04f8 2.13.0
+7006bcce52990f33d0c20c51bebc2b58ed36db60 2.12.5
+976aca38ffe5ce30d7753ea77a8de44e5cbd0dc8 2.12.4
+4e477ddf2eed2b478793a7c7ff22320e5ee6ce21 2.12.1
+2bc875af320017a5952adb544e78306e7807865c 2.12.0
+007900c31eef0363e705cf15d131740d4eeb6208 2.12.3
+1e23e973ab856a45d9e3e2dcd9a72a9e466c03c7 2.12.2
--- a/bintools/elftools/group/elftran.mmp	Tue May 04 14:01:37 2010 +0100
+++ b/bintools/elftools/group/elftran.mmp	Thu May 13 14:14:32 2010 +0100
@@ -45,5 +45,5 @@
 source          byte_pair.cpp pagedCompress.cpp
 
 systeminclude   ../inc /epoc32/include ../../../imgtools/imglib/compress /epoc32/include/tools/
-
+OS_LAYER_SYSTEMINCLUDE
 VENDORID        0x70000001
--- a/bintools/evalid/EvalidCompare.pm	Tue May 04 14:01:37 2010 +0100
+++ b/bintools/evalid/EvalidCompare.pm	Thu May 13 14:14:32 2010 +0100
@@ -27,6 +27,29 @@
 use File::Path;
 use File::Basename;
 use File::Copy;
+use Config;
+
+# Search for tools with Raptor...
+sub FindTool($)
+{
+  my $tool = shift;
+  my $location = $tool;
+  if ($Config{osname} =~ m/MSWin32/i && $ENV{SBS_HOME} && -e $ENV{SBS_HOME}."/win32/mingw/bin/".$tool.".exe")
+  {
+    $location = $ENV{SBS_HOME}."/win32/mingw/bin/".$tool.".exe"; 
+  }
+  elsif(-e $ENV{EPOCROOT}."epoc32/gcc_mingw/bin/".$tool.".exe")
+  {
+    $location = $ENV{EPOCROOT}."epoc32/gcc_mingw/bin/".$tool.".exe";
+  }
+  elsif(-e $FindBin::Bin."/".$tool.".exe")
+  {
+    $location = $FindBin::Bin."/".$tool.".exe"; 
+  }
+  return $location;
+}
+
+
 
 #
 # Constants.
@@ -71,11 +94,11 @@
 # they also enabled an order of expandor arguments where the filename is not last
 my %typeHandler = (
       e32 => {reader => 'elf2e32 --dump --e32input=', filter => \&Elf2E32Filter},
-      arm => {reader => 'nm --no-sort', filter => \&NmFilter, retry => 1, relative_paths => 1},
+      arm => {reader => FindTool("nm").' --no-sort', filter => \&NmFilter, retry => 1, relative_paths => 1},
       elf => {reader => 'elfdump -i', filter => \&ElfDumpFilter, rawretry => 1},
-      intel => {reader => '%EPOCROOT%epoc32\gcc_mingw\bin\nm --no-sort', filter => \&NmFilter, rawretry => 1, relative_paths => 1, skipstderr => 1},
+      intel => {reader => FindTool("nm").' --no-sort', filter => \&NmFilter, rawretry => 1, relative_paths => 1, skipstderr => 1},
       intel_pe => {reader => 'pe_dump', filter => \&FilterNone, rawretry => 1},
-	  zip => {reader => '"'.$FindBin::Bin.'/unzip" -l -v', filter => \&UnzipFilter, rawretry => 1},
+	  zip => {reader => FindTool("unzip").' -l -v', filter => \&UnzipFilter, rawretry => 1},
       map => {filter => \&MapFilter, skipblanks => 1},
       sgml => {filter => \&SgmlFilter},
       preprocessed_text => {filter => \&PreprocessedTextFilter},
@@ -231,7 +254,7 @@
     }
   }
 
-  if ($typeBuf =~ /^!<arch>\x0A(.{48}([0-9 ]{10})\x60\x0A(......))/s) {
+  if ($typeBuf =~ /^!<arch>\x0A(.{48}([0-9 ]{9}).\x60\x0A(......))/s) {
     # library - could be MARM or WINS
 
     $typeBuf = $1;
@@ -240,7 +263,7 @@
     open (FILE, $file) or die "Error: Couldn't open \"$file\" for reading: $!\n";
     binmode (FILE);
     
-    while ($typeBuf =~ /^.{48}([0-9 ]{10})\x60\x0A(......)/s) {
+    while ($typeBuf =~ /^.{48}([0-9 ]{9}).\x60\x0A(......)/s) {
       # $1 is the size of the archive member, $2 is first 6 bytes of the file
       # There may be several different sorts of file in the archive, and we
       # need to scan through until we find a type we recognize:
--- a/e32tools/e32lib/group/seclib.mmp	Tue May 04 14:01:37 2010 +0100
+++ b/e32tools/e32lib/group/seclib.mmp	Thu May 13 14:14:32 2010 +0100
@@ -45,7 +45,7 @@
 userinclude     ../setcap 
 userinclude     ../../e32lib/e32image/inc
 systeminclude   /epoc32/include
-
+OS_LAYER_SYSTEMINCLUDE
 OPTION          GCC -w
 
 //macro __PLACEMENT_NEW_INLINE
--- a/e32tools/elf2e32/group/elf2e32.mmp	Tue May 04 14:01:37 2010 +0100
+++ b/e32tools/elf2e32/group/elf2e32.mmp	Thu May 13 14:14:32 2010 +0100
@@ -27,6 +27,7 @@
 source	 	pl_elfrelocation.cpp  pl_elfrelocations.cpp  pl_symbol.cpp  polydll_fb_target.cpp  polydll_rebuild_target.cpp  usecasebase.cpp 
 source	 	byte_pair.cpp  pagedcompress.cpp checksum.cpp stdexe_target.cpp
 
+OS_LAYER_SYSTEMINCLUDE
 systeminclude    /epoc32/include  /epoc32/include/tools  
 userinclude		../source ../include
 
--- a/imgtools/imaker/src/imaker.pm	Tue May 04 14:01:37 2010 +0100
+++ b/imgtools/imaker/src/imaker.pm	Thu May 13 14:14:32 2010 +0100
@@ -351,7 +351,7 @@
 {
     (my $dir = shift()) =~ s/^>>?(?!>)//;
     my $absdir = "";
-    eval { local $SIG{__DIE__}; $absdir = Cwd::abs_path($dir) };
+    if (-e $dir) {$absdir = Cwd::abs_path($dir) };
     return(PathConv($absdir || File::Spec->rel2abs($dir,
         $dir !~ /^$gWorkdrive/i && $dir =~ /^([a-z]:)/i ? "$1/" : ""), shift(), shift()));
 }
--- a/sbsv2/raptor/RELEASE-NOTES.html	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/RELEASE-NOTES.html	Thu May 13 14:14:32 2010 +0100
@@ -8,14 +8,30 @@
 
 <h2>next version</h2>
 
-<h3> New Features</h3>
+<h3>New Features</h3>
 <ul>
-
+<li><a href="notes/tcomsupport.txt">           Support new Trace Compiler commandline interface, autogen header location   </a></li>
 <li><a href="notes/parametric_log_filters.txt">   Pass parameters to log filters from the command line </a></li>
 <li><a href="notes/delete_on_failed_compile.txt"> Work-around for failed RVCT 2.2 compiles             </a></li>
 <li><a href="notes/query_cli.txt">                Obtain configuration data using --query option       </a></li>
 <li>                                              Carbide.xml now contains *_gcce aliases                  </li>
 <li><a href="notes/abiv1_implibs.txt">            ABIv1 import libraries not generated by default      </a></li>
+</ul>
+
+<h3>Defect Fixes</h3>
+<ul>
+
+<li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2605"> SF Bug 2605 </a> - [Raptor] ROMFILE creation using Raptor is not clean </li>
+<li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2495"> SF Bug 2495 </a> - [Raptor] KDLL TARGETTYPEs do not support .def file freezing </li>
+<li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2420"> SF Bug 2420 </a> - [Raptor] Output from recipes is mis-recognised as "what" output </li>
+<li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2297"> SF Bug 2297 </a> Python exception in raptor_meta.py when processing bld.inf file </li>
+<li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2174"> SF Bug 2174 </a> - [Raptor] -- layer option shows errors when bld.inf missing in another layer </li>
+<li><a href="notes/tcomsupport.txt">Fix: ensure trace paths exist before build starts to avoid clashes during the build with some make engines    </a></li>
+<li><a href="notes/tcomsupport.txt">Fix: permit traces header directory to be specified in systemincludes - helps Qt    </a></li>
+<li><a href="notes/localresourcecopying.txt">Fix: (performance in cluster builds) do resource copying on local host.</a></li>
+<li>Fix: don't generate multiple copies of the same resource just because there are several target paths. Generate it once and copy that to the different target paths. Helps when winscw is built after an arm build.</li>
+<li>Fix: (performance) remove unnecessary copying of rpp files into epoc32\localisation as they are not used.</li>
+<li>Fix: (performance) remove -C option when preprocessing rpp files - causes comments to be stripped from the rpp resulting in smaller files that improves performance.</li>
 
 </ul>
 
@@ -36,21 +52,20 @@
 <h3>Defect Fixes</h3>
 <ul>
 
-<li>                                                                  DPDEF143018      - Raptor doesn't handle spaces in GCCE installation directory correctly                                                </li>
-<li>                                                                  DPDEF143101      - GCC-E isn't tested as part of the tool checking mechanism                                                            </li>
-<li>                                                                  DPDEF141195      - Raptor doesn't handle spaces in tool paths                                                                           </li>
+<li>DPDEF143018      - Raptor doesn't handle spaces in GCCE installation directory correctly                                                </li>
+<li>DPDEF143101      - GCC-E isn't tested as part of the tool checking mechanism                                                            </li>
+<li>DPDEF141195      - Raptor doesn't handle spaces in tool paths                                                                           </li>
 <li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2172"> SF Bug 2172 </a> - [Raptor] Resource builds warn on encountering trigraph-like strings                                                  </li>
 <li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2308"> SF Bug 2308 </a> - [Raptor] PLUGIN3 TARGETTYPEs don't set resource output offsets correctly                                             </li>
-<li>                                                                  Fix: in copylogfromannofile mode, ensure that the build id and duration are included in the log.  These are not critical but are useful </li>
-<li>                                                                  Fix: remove unnecessary empty lines in log output in copylogfromannofile mode                                                           </li>
+<li>Fix: in copylogfromannofile mode, ensure that the build id and duration are included in the log.  These are not critical but are useful </li>
+<li>Fix: remove unnecessary empty lines in log output in copylogfromannofile mode                                                           </li>
 <li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=1939"> SF Bug 1939 </a> - [Raptor] PAGED keyword in MMP files should imply byte pair compressed                                                </li>
-<li>                                                                  DPDEF144648      - Raptor failed to build tools_deb objects under Windows XP                                                            </li>
+<li>DPDEF144648      - Raptor failed to build tools_deb objects under Windows XP                                                            </li>
 <li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2134"> SF Bug 2134 </a> - [Raptor] Raptor does not pass overridden make variables into its makefiles                                           </li>
-<li>                                                                  Fix : do not allow data to be paged implicitly                                                                                          </li>
-<li>                                                                  Fix : sort build configurations by name for metadata preprocessing                                                                      </li>
+<li>Fix : do not allow data to be paged implicitly</li>
 <li><a href="http://developer.symbian.org/bugs/show_bug.cgi?id=2302"> SF Bug 2302 </a> - sbs_filter refers to python.exe in win32/python264/                                                                  </li>
-<li>                                                                  Fix : ensure that FLMDEBUG is empty by default                                                                                          </li>
-
+<li>Fix : Makefile Parse Performance in Resource stage is poor. Large size of included dependency files is a factor. In --no-depend-generate mode, create dependency files which only refer to other rsg/mbg files that are yet to be built - store no other dependencies.</li>
+<li>Fix : ensure that FLMDEBUG is empty by default</li>
 </ul>
 
 <!-- older notes are plain text -->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/bin/depcrunch.py	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,111 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+# Minimise the dependencies in a C preprocessor dependency file to
+# those that CPP could not find.  Then add in an assumption about 
+# where to find them.  Output is assumed to be relevant to only one target
+# even if multiple dep files are analysed.
+#
+
+import sys
+from  optparse import OptionParser
+import re
+
+class NoTargetException(Exception):
+	pass
+
+def depcrunch(file,extensions,assume):
+	target_pattern = r"^\s*(\S+):\s+"
+	target_re = re.compile(target_pattern)
+	# Not the use of (?i) in the following expression.  re.I seems to cause re.findall
+	# to not actually find all files matching the extension whereas (?i) provides
+	# case insensitivity at the right point and it works.  Really don't understand this.
+	extension_pattern = r"\s([^/ \t]+\.((?i)" + "|".join([t for t in extensions]) + r"))\b"
+	extension_re = re.compile(extension_pattern)
+
+	target = None
+
+	deps = []
+
+	# Read through the dependencies.
+	for l in file:
+		l = l.replace("\\","/").rstrip("\n\r")
+
+		# Look out for the target name if 
+		# we have not found it yet
+		if not target:
+			t = target_re.match(l)
+			if t:
+				target = t.groups()[0]
+
+		# Look for prerequisites matching the 
+		# extensions.  There may be one or more on 
+		# the same line as the target name.
+		# Don't use re.I - somehow prevents 
+		# all but one match in a line which may have several files
+		m = extension_re.findall(l)
+		if m:
+			deps.extend([d[0] for d in m])
+
+	if not target:
+		raise NoTargetException()
+
+	if len(deps) > 0:
+		print "%s: \\" % target
+		for d in deps[:-1]:
+			print " %s \\" % (assume + "/" + d)
+		print " %s " % (assume + "/" + deps[-1])
+
+
+
+
+## Command Line Interface ####################################################
+
+parser = OptionParser(prog = "depcrunch",
+	usage = "%prog [-h | options] [<depfile>]")
+
+parser.add_option("-e", "--extensions", 
+	 action="store", dest="extensions", type='string', help="comma separated list of file extensions of missing files to keep in the crunched dep file.") 
+
+parser.add_option("-a", "--assume", 
+	 action="store", dest="assume", type='string', help="when cpp reports missing dependencies, assume that they are in this directory") 
+
+(options, args) = parser.parse_args()
+
+
+if not options.extensions:
+	parser.error("you must specify a comma-separated list of file extensions with the -e option.")
+	sys.exit(1)
+
+if not options.assume:
+	parser.error("you must specify an 'assumed directory' for correcting missing dependencies with the -a option.")
+	sys.exit(1)
+
+depfilename="stdin"
+if len(args) > 0:
+	depfilename=args[0]
+	file = open(depfilename,"r")
+else:
+	file = sys.stdin
+try:
+	depcrunch(file,options.extensions.split(","), options.assume)
+except NoTargetException,e:
+	sys.stderr.write("Target name not found in dependency file\n");
+	sys.exit(2)
+	
+
+if file != sys.stdin:
+	file.close()
+
+sys.exit(0)
--- a/sbsv2/raptor/bin/recipestats.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/bin/recipestats.py	Thu May 13 14:14:32 2010 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -18,8 +18,21 @@
 # e.g. total times and so on.
 
 import time
+import __future__
+
+
+
 
 class RecipeStats(object):
+	def __init__(self, name, count, time):
+		self.name=name
+		self.count=count
+		self.time=time
+
+	def add(self, duration):
+		self.time += duration
+
+class BuildStats(object):
 	STAT_OK = 0
 
 
@@ -29,9 +42,10 @@
 		self.failtime = 0.0
 		self.failtypes = {}
 		self.retryfails = 0
+		self.hosts = {}
 		
-	def add(self, starttime, duration, name, status):
-		if status != RecipeStats.STAT_OK:
+	def add(self, starttime, duration, name, status, host, phase):
+		if status != BuildStats.STAT_OK:
 			self.failcount += 1
 			if name in self.failtypes:
 				self.failtypes[name] += 1
@@ -43,43 +57,84 @@
 			return
 			
 		if name in self.stats:
-			(count, time) = self.stats[name]
-			self.stats[name] = (count + 1, time + duration)
+			r = self.stats[name]
+			r.add(duration)
 		else:
-			self.stats[name] = (1,duration)
+			self.stats[name] = RecipeStats(name,1,duration)
+
+		hp=host
+		if hp in self.hosts:
+			self.hosts[hp] += 1
+		else:
+			self.hosts[hp] = 1
 
 	def recipe_csv(self):
-		s = "# name, time, count\n"
-		for (name,(count,time)) in self.stats.iteritems():
-			s += '"%s",%s,%d\n' % (name, str(time), count)
+		s = '"name", "time", "count"\n'
+		l = sorted(self.stats.values(), key= lambda r: r.time, reverse=True)
+		for r in l:
+			s += '"%s",%s,%d\n' % (r.name, str(r.time), r.count)
 		return s
 
+	def hosts_csv(self):
+		s='"host","recipecount"\n'
+		hs = self.hosts
+		for h in sorted(hs.keys()):
+			s += '"%s",%d\n' % (h,hs[h])
+		return s
 
 
 import sys
 import re
+import os
+from optparse import OptionParser # for parsing command line parameters
 
 def main():
-
-	f = sys.stdin
-	st = RecipeStats()
-
-	recipe_re = re.compile(".*<recipe name='([^']+)'.*")
+	recipe_re = re.compile(".*<recipe name='([^']+)'.*host='([^']+)'.*")
 	time_re = re.compile(".*<time start='([0-9]+\.[0-9]+)' *elapsed='([0-9]+\.[0-9]+)'.*")
 	status_re = re.compile(".*<status exit='(?P<exit>(ok|failed))'( *code='(?P<code>[0-9]+)')?.*")
+	phase_re = re.compile(".*<info>Making.*?([^\.]+\.[^\.]+)</info>")
+
+	parser = OptionParser(prog = "recipestats",
+                                          usage = """%prog --help [-b] [-f <logfilename>]""")
+
+	parser.add_option("-b","--buildhosts",action="store_true",dest="buildhosts_flag",
+                                help="Lists which build hosts were active in each invocation of the build engine and how many recipes ran on each.", default = False)
+	parser.add_option("-f","--logfile",action="store",dest="logfilename", help="Read from the file, not stdin", default = None)
+
+
+	(options, stuff) = parser.parse_args(sys.argv[1:])
+
+	if options.logfilename is None:
+		f = sys.stdin
+	else:
+		f = open(options.logfilename,"r")
+
+	st = BuildStats()
+
 
 	alternating = 0
 	start_time = 0.0
 
-	
-	for l in f.xreadlines():
+	phase=None
+	for l in f:
 		l2 = l.rstrip("\n\r")
+
 		rm = recipe_re.match(l2)
 
 		if rm is not None:
-			rname = rm.groups()[0]
+			(rname,host) = rm.groups()
 			continue
 
+		pm = phase_re.match(l2)
+
+		if pm is not None:
+			if phase is not None:
+				if options.buildhosts_flag:
+					print('"%s"\n' % phase)
+					print(st.hosts_csv())
+			st.hosts = {}	
+			phase = pm.groups()[0]
+			continue
 
 		tm = time_re.match(l2)
 		if tm is not None:
@@ -109,9 +164,13 @@
 		else:
 			status = int(sm.groupdict()['code'])
 
-		st.add(s, elapsed, rname, status)
+		st.add(s, elapsed, rname, status, host, phase)
 
-	print st.recipe_csv()
+	if options.buildhosts_flag:
+		print('"%s"\n' % phase)
+		print(st.hosts_csv())
+	else:
+		print(st.recipe_csv())
 
 
 if __name__ == '__main__': main()
--- a/sbsv2/raptor/lib/config/locations.xml	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/lib/config/locations.xml	Thu May 13 14:14:32 2010 +0100
@@ -109,6 +109,7 @@
 
 		<set name='BUILD_INCLUDE' value=''/>
 		<set name='CREATEVMAP' value='$(PYTHON) $(SBS_HOME)/bin/createvmap.py' type='script'/>
+		<set name='DEPCRUNCH' value='$(PYTHON) $(SBS_HOME)/bin/depcrunch.py' type='script'/>
 		<set name='CREATEVMAPCPP' value='$(SBS_BVCPP)' type='tool'/>
 		<set name='FEATURELISTFILES' value=''/>
 		<set name='FEATUREVARIANTNAME' value=''/>
--- a/sbsv2/raptor/lib/flm/base.xml	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/lib/flm/base.xml	Thu May 13 14:14:32 2010 +0100
@@ -18,6 +18,7 @@
 		<param name='DUMPBCINFO' default=''/>
 		<param name='FLMDEBUG'  default=''/>
 		<param name='PLATFORM' default=''/>
+		<param name='PYTHON' default=''/> <!-- allow python scripts to be used in general flms -->
 		<param name='GNUMAKE38'/>
 		<param name='GNUCP'/>
 		<param name='GNUCAT'/>
@@ -84,6 +85,7 @@
 	</interface>
 	<interface name="base.resource" extends="base.flm" flm="resource.flm">
 		<param name='BINCOPYDIRS' default=''/>
+		<param name='DEPCRUNCH'/>
 		<param name='MMPDEFS' default=''/>
 		<param name='GNUCPP'/>
 		<param name='GNUSED'/>
--- a/sbsv2/raptor/lib/flm/e32abiv2.flm	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/lib/flm/e32abiv2.flm	Thu May 13 14:14:32 2010 +0100
@@ -48,7 +48,7 @@
 
 ifeq ($(DOBUILD),1)
 
-$(if $(FLMDEBUG),$(info <flm name='e32abiv2' target='$(TARGET)' type='$(TARGETTYPE)' outputpath='$(OUTPUTPATH)' metasource='$(METASOURCE)' postlinkfiletype='$(POSTLINKFILETYPE)' />))
+$(if $(FLMDEBUG),$(info <debug><flm name='e32abiv2' target='$(TARGET)' type='$(TARGETTYPE)' outputpath='$(OUTPUTPATH)' metasource='$(METASOURCE)' postlinkfiletype='$(POSTLINKFILETYPE)' /></debug>))
 
 # Enable DELETE_ON_FAILED_COMPILE work around for failed RVCT 2.2 compiles
 ifneq ($(DELETE_ON_FAILED_COMPILE),)
@@ -58,6 +58,8 @@
 # Strip switch-type parameters
 #
 POSTLINKTARGETTYPE:=$(strip $(POSTLINKTARGETTYPE))
+TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
+
 UID1:=$(strip $(UID1))
 UID2:=$(strip $(UID2))
 UID3:=$(strip $(UID3))
@@ -133,9 +135,9 @@
 
 # Postlinkable targets need to be linked and elf2e32'd
 ifneq ($(DOPOSTLINK),)
-    E32TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
-    LINK_TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)).sym
-    MAPFILE:=$(RELEASABLEPATH)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)).map
+    E32TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT)
+    LINK_TARGET:=$(RELEASABLEPATH)/$(TARGET)$(if $(EXPLICITVERSION),{$(VERSIONHEX)},).$(TARGETEXT).sym
+    MAPFILE:=$(RELEASABLEPATH)/$(TARGET).$(TARGETEXT).map
 else
   E32TARGET:=
   LINK_TARGET:=
@@ -190,7 +192,7 @@
 # put the hex version number in the right place
 ifeq ($(LINKAS),)
   LINKASNAME=$(TARGET)
-  LINKASTYPE=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
+  LINKASTYPE=$(TARGETEXT)
 else
   SPLIT_LINKAS=$(subst ., ,$(LINKAS))
   LINKASNAME=$(word 1,$(SPLIT_LINKAS))
@@ -715,6 +717,7 @@
 # USE_TRACE_COMPILER defaults to blank in Raptor config.
 # Users can turn TC on by setting it to 1 in user config.
 ifneq ($(USE_TRACE_COMPILER),)
+  # TARGETEXT is already set
   include $(FLMHOME)/tracecompiler.mk
   WHATRELEASE:=$(WHATRELEASE) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER)
 endif
@@ -867,7 +870,7 @@
 define e32abiv2_listing
 # $1 is the sourcefile
 
-$(eval LISTINGTARGET:=$(strip $(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.$(subst _,.,$(call sanitise,$(FULLVARIANTPATH))).$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE)).lst,$1)))
+$(eval LISTINGTARGET:=$(strip $(call extractandmap,$(CPPFILEEXTENSIONS) $(CFILEEXTENSIONS),.$(subst _,.,$(call sanitise,$(FULLVARIANTPATH))).$(TARGET).$(TARGETEXT).lst,$1)))
 $(eval DEPENDFILENAME:=$(call map2listfile,$1).d)
 $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
 
@@ -923,7 +926,7 @@
 # separate arguments are interpreted as a single argument when passed to bash
 FIVESPACES=$(BLANK)     $(BLANK)
 
-FREEZEGUARD:=TARGET_$(TARGET)_$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))_$(IMPORTLIBPATH)_EFREEZE
+FREEZEGUARD:=TARGET_$(TARGET)_$(TARGETEXT)_$(IMPORTLIBPATH)_EFREEZE
 
 define e32freeze
 
@@ -1120,6 +1123,7 @@
         endif
 
 
+        DATATEXT:=
         ifeq ($(TESTCODE),TRUE)
         	# Add 'TEST' to the .iby filename
         	ROMTEST:=test
@@ -1130,8 +1134,6 @@
                     DATATEXT:="data=/epoc32/data/z/test/$(MODULE)/$(VARIANTPLATFORM).$(TEST_OPTION).bat test/$(MODULE).$(TEST_OPTION).bat"
                 endif
             endif
-        else
-        	DATATEXT:=
         endif
 
         # ROMTARGET
--- a/sbsv2/raptor/lib/flm/e32abiv2kdll.flm	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/lib/flm/e32abiv2kdll.flm	Thu May 13 14:14:32 2010 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -48,6 +48,7 @@
 IMPORTLIBRARYREQUIRED:=1
 endif
 POSTLINKDEFFILE:=$(DEFFILE)
+SUPPORT_FREEZE:=1
 
 # No exception support for kernel code?
 EXCEPTIONS:=$(NO_EXCEPTIONS)
--- a/sbsv2/raptor/lib/flm/resource.flm	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/lib/flm/resource.flm	Thu May 13 14:14:32 2010 +0100
@@ -48,115 +48,121 @@
 # Ensure that RELEASABLES and CLEANTARGETS cannot expand indefinitely in successive calls to this flm:
 CLEANTARGETS:=
 RELEASABLES:=
+CREATABLEPATHS:=
 
 # There is only one resource header (.rsg) file and we only
 # make that if we are asked.
 RSGDIR:=$(EPOCROOT)/epoc32/include
+# If there are multiple LANGUAGES then it is the last one in the list
+# which produces the header.
+HEADLANG:=$(lastword $(LANGUAGES:SC=sc))
 ifneq ($(or $(HEADER),$(HEADERONLY)),)
         RESOURCEHEADER:=$(RSGDIR)/$(HEADER)
 
-        # If there are multiple LANGUAGES then it is the last one in the list
-        # which produces the header.
-        HEADLANG:=$(lastword $(LANGUAGES:SC=sc))
 else
-	HEADLANG:=
-    RESOURCEHEADER:=
+        RESOURCEHEADER:=
 endif
 
 # we create intermediate .rpp and .d files
-INTERBASE:=$(OUTPUTPATH)/$(TARGET_lower)$(if $(TARGETPATH),_$(subst /,_,$(TARGETPATH)),)
-
-################################## localisation ###########################$(GNUMKDIR)#############
-# Only make copies for full resource builds
-
-# Initialise to prevent RELEASABLES spill-over between calls
-DESTRPP:=
-INFOFILE:=
-
-ifeq ($(HEADERONLY),)
-
-RSSBASENAME:=$(call lowercase,$(basename $(notdir $(SOURCE))))
-DESTRPP:=$(EPOCROOT)/epoc32/localisation/$(RSSBASENAME)/rsc/$(RSSBASENAME).rpp
-$(call makepath,$(EPOCROOT)/epoc32/localisation/$(RSSBASENAME)/rsc)
-
-INFOFILE:=$(EPOCROOT)/epoc32/localisation/group/$(RSSBASENAME).info
-# If there are MULTIPLE languages then copy the .rpp for the last one
-RPPLANG:=$(lastword $(LANGUAGES:SC=sc))
-
-# Copy .rpp files from epoc32/build/ to epoc32/localisation/x/rsc/x.rpp and create .info files in localisation
-define CreateRppAndInfo
+INTERBASE_TMP:=$(OUTPUTPATH)/$(TARGET_lower)_$(notdir $(basename $(SOURCE)))
+INTERBASE:=$(OUTPUTPATH)/$(TARGET_lower)
 
-ifeq ($(RESOURCE_$(call sanitise,$(SOURCE))),)
-RESOURCE_$(call sanitise,$(SOURCE)):=1
-
-RESOURCE:: $(DESTRPP) $(INFOFILE)
-
-$(DESTRPP): $(INTERBASE)_$(RPPLANG).rpp
-	$(call startrule,rppfilecopy,FORCESUCCESS) \
-	$(GNUCP) $$< $$@ \
-	$(call endrule,rppfilecopy)
-
-$(INFOFILE)::
-	@if [ ! -d $(EPOCROOT)/epoc32/localisation/group ]; then $(GNUMKDIR) -p $(EPOCROOT)/epoc32/localisation/group; fi
-	@if [ ! -f $$@ ]; then echo "DATADIR: /$(RSSBASENAME)" > $$@ ; fi
-	@echo -e "\n/z$(TARGETPATH)/$(TARGET_lower).rsc : $(RSSBASENAME).rpp" >> $$@
-
-endif
-endef
-
-$(eval $(call CreateRppAndInfo))
-endif
-################################# end of localisation ###################################
-
-# make the output directories while reading makefile - some build engines prefer this
-$(call makepath,$(INTERBASE))
 
 # common pre-processor options
+
+# We really should be using -iquote with a recent cpp.  This is a note for when we do update:
+#CPPOPT:=-nostdinc -undef -Wno-trigraphs -D_UNICODE -include $(PRODUCT_INCLUDE)\
+# -I$(dir $(SOURCE)) $(foreach I, $(USERINCLUDE),-iquote $(I) ) $(foreach J,$(SYSTEMINCLUDE),-I $(J) )
+
 CPPOPT:=-nostdinc -undef -Wno-trigraphs -D_UNICODE -include $(PRODUCT_INCLUDE)\
  -I$(dir $(SOURCE)) $(foreach I, $(USERINCLUDE),-I$(I) ) -I- $(foreach J,$(SYSTEMINCLUDE),-I$(J) )
 
-CREATABLEPATHS:=$(RSCDIR) $(RSGDIR) $(OUTPUTPATH)
+CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCDIR) $(RSGDIR) $(OUTPUTPATH) 
+
+# We intend to generate the resource in an intermediate location and copy to the targetpath to
+# ensure that when the "same" resource is built into separare target paths, it doesn't have to be 
+# completely recreated each time - just copied.
+RSCCOPYDIRS:=$(RSCDIR)
 
 # additional binary resource copies performed based on BINCOPYDIRS
-RSCCOPYDIRS:=
 ifneq ($(BINCOPYDIRS),)
-        RSCCOPYDIRS:=$(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS)))
-        CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCCOPYDIRS)
+        RSCCOPYDIRS:=$(RSCCOPYDIRS) $(subst //,/,$(patsubst %,%/$(if $(TARGETPATH),/z/$(TARGETPATH),),$(BINCOPYDIRS)))
 endif
+CREATABLEPATHS:=$(CREATABLEPATHS) $(RSCCOPYDIRS)
 
 ###############################################################################
+
+
 define preprocessresource
 # $(1) is the RPPFILE		(eg. /epoc32/build/xxx/b_sc.rpp)
 # $(2) is the related RESOURCEFILE if any (eg. /a/b.rsc)
 # $(3) is the LANGUAGE		(eg. sc or 01 or 02 ...)
+# $(4) is the "primary" language on which all the others depend
 
   ifeq ($(TARGET_$(call sanitise,$1)),)
     TARGET_$(call sanitise,$1):=1
-    $(if $(FLMDEBUG),$(info preprocessresource: $(1) for $(2) LANG:$(3)))
+    $(if $(FLMDEBUG),$$(info <debug>preprocessresource: $(1) for $(2) LANG:$(3) dep $(4)</debug>))
+
+
+    # Correct dependency information when a header file can't be found.
+    # If the c preprocessor can't find a dependency it appears as it did in the #include statement
+    # e.g. "filename.mbg" or "filename.rsg" in the dependency file.
+
+ifneq ($(NO_DEPEND_GENERATE),)
+    # This version minimises the size of dependency files, to contain only .mbg and .rsg deps.
+    # It allows resources to be built in the right order but doesn't impose the weight of
+    # of full dependency information which can overwhelm make in large builds.
+    # The strategy is filter lines which don't have .rsg or .mbg dependencies in them and
+    # to sift each line to leave out non-relevant things like other header files, .hrh 
+    # files etc.  In the end don't print anything at all if we did not find the target.
 
-    RESOURCE_DEPS:: $(1).d
-    $(1).d: $(SOURCE)
+define  DEPENDENCY_CORRECTOR
+{ $(DEPCRUNCH) --extensions rsg,mbg --assume '$$$$(EPOCROOT)/epoc32/include' ; } 
+endef
+
+else
+    # This can correct the dependencies by assuming that the file will be in epoc32\include as this is the default
+    DEPENDENCY_CORRECTOR:=$(GNUSED)  -r 's% ([^ \/]+\.((rsg)|(mbg)))% $(EPOCROOT)\/epoc32\/include\/\1%ig' 
+endif
+
+
+    ifeq "$1" "$4"
+        RESOURCE_DEPS:: $1.d
+
+        $1.d: $(SOURCE)
 	  $(call startrule,resourcedependencies,FORCESUCCESS) \
-	  $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\
-	  $(CPPOPT) $(SOURCE) -M -MG -MT"$(1)" | \
-	  $(GNUSED)  -r 's# ([^ \/]+\.((rsg)|(mbg)))# $(EPOCROOT)\/epoc32\/include\/\1#ig' > $(1).d \
+	  $(GNUCPP) -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$3) $(call makemacrodef,-D,$(MMPDEFS))\
+	  $(CPPOPT) $(SOURCE) -M -MG -MT"$1" | \
+	  $$(DEPENDENCY_CORRECTOR) >$$@ \
 	  $(call endrule,resourcedependencies)
 
-    $(1): $(1).d
+         $1 : $1.d
+
+    else
+         $1 : $4
+    endif
+
+    $1:
 	  $(call startrule,resourcepreprocess,FORCESUCCESS) \
-	  $(GNUCPP) -C -DLANGUAGE_$(3) -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\
+	  $(GNUCPP) -C -DLANGUAGE_$3 -DLANGUAGE_$(subst sc,SC,$(3)) $(call makemacrodef,-D,$(MMPDEFS))\
 	  $(CPPOPT) $(SOURCE) -o $$@ \
 	  $(call endrule,resourcepreprocess)
+    endif
 
-    CLEANTARGETS:= $$(CLEANTARGETS) $(1)
+    CLEANTARGETS:= $$(CLEANTARGETS) $1
 
-    $(eval DEPENDFILENAME:=$(1).d)
-    $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
-
-    CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
-    ifneq "$(DEPENDFILE)" ""
-      ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
-        -include $(DEPENDFILE)
+    ifeq "$(MAKEFILE_GROUP)" "RESOURCE"
+    ifeq "$1" "$4"
+      $(eval DEPENDFILENAME:=$1.d)
+      $(eval DEPENDFILE:=$(wildcard $(DEPENDFILENAME)))
+      
+      CLEANTARGETS:=$$(CLEANTARGETS) $(DEPENDFILENAME)
+      ifneq "$(DEPENDFILE)" ""
+        ifeq "$(filter %CLEAN,$(call uppercase,$(MAKECMDGOALS)))" ""
+          ifeq "$(MAKEFILE_GROUP)" "RESOURCE"
+           -include $(DEPENDFILE)
+          endif
+        endif
       endif
     endif
 
@@ -166,25 +172,12 @@
 ###############################################################################
 define copyresource
 # $(1) is the source
-# $(2) is the destination
-
-RELEASABLES:=$$(RELEASABLES) $(2)
-
-   ifeq ($(TARGET_$(call sanitise,$2)),)
-           TARGET_$(call sanitise,$2):=1
+# $(2) is the space separated list of destinations which must be filenames
 
-        RESOURCE:: $2
-        ## perform additional copies of binaries
-        #
-        # Only certain builds require further copies of the generated resource binaries
-        #
-        $(2): $(1)
-		$(call startrule,resourcecopy,FORCESUCCESS) \
-		$(GNUCP) $$< $$@ \
-		$(call endrule,resourcecopy)
+   RELEASABLES:=$$(RELEASABLES) $(2)
 
-   endif
-
+   $(info <finalcopy source='$1'>$2</finalcopy>)
+ 
 endef # copyresource #
 
 ###############################################################################
@@ -194,27 +187,32 @@
 # $(2) is the preprocessed resource to make it from
 # $(3) is the language e.g. sc or 01 or 02
 
-    RELEASABLES:=$$(RELEASABLES) $(1)
 
         ifeq ($(TARGET_$(call sanitise,$1)),)
                 TARGET_$(call sanitise,$1):=1
 
-            $(if $(FLMDEBUG),$(info generateresource: $(1) from $(2) LANG:$(3)),)
+            $(if $(FLMDEBUG),$(info <debug>generateresource: $(1) from $(2) LANG:$(3)</debug>),)	
+            $(if $(FLMDEBUG),$(info <debug>generateresource: copies: $(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS)))</debug>))
 
+            CLEANTARGETS:=$$(CLEANTARGETS) $(1)
 
             RESOURCE:: $(1)
 
             $(1): $(2) $(RCOMP)
 			$(call startrule,resourcecompile,FORCESUCCESS) \
-			$(RCOMP) -m045,046,047 -u -o$(1) -s$(2) \
+			$(RCOMP) -m045,046,047 -u -o$(1) -s$(2)  \
 			$(call endrule,resourcecompile)
 
         endif
+
 #	Whether or not we have generated this resource for some other variant, check if there
 #       are any new copies to be made for this variant. e.g. winscw requires that we make
-#       some extra copies.
+#       some extra copies.  We tried to copy after running rcomp itself but we still need these
+#       targets for the sake of dependencies or, for example, if someone merely adds a new copy 
+#       when the resource is up-to-date
 
-        $(foreach F,$(sort $(patsubst %,%/$(notdir $(1)),$(RSCCOPYDIRS))),$(call copyresource,$(1),$(F)))
+        $(call copyresource,$1,$(sort $(patsubst %,%/$(notdir $1),$(RSCCOPYDIRS))))
+
 
         # individual source file compilation
         SOURCETARGET_$(call sanitise,$(SOURCE)): $(1)
@@ -228,11 +226,11 @@
 # $(2) is the preprocessed resource to make it from
 # $(3) is the language to use	(eg. sc)
 
-		RELEASABLES:= $$(RELEASABLES) $(1)
+        RELEASABLES:= $$(RELEASABLES) $(1)
 
         ifeq ($(TARGET_$(call sanitise,$1)),)
                 TARGET_$(call sanitise,$1):=1
-                $(if $(FLMDEBUG),$(info resourceheader: $(1) from $(2) LANG:$(3)))
+                $(if $(FLMDEBUG),$(info <debug>resourceheader: $(1) from $(2) LANG:$(3)</debug>))
 
                 RESOURCE:: $(1)
 
@@ -255,19 +253,28 @@
 # We always create at least the header
 # even if we sometimes don't create the resources
 ifneq ($(RESOURCEHEADER),)
-        $(eval $(call generateresourceheader,$(RESOURCEHEADER),$(INTERBASE)_$(HEADLANG).rpp,$(HEADLANG)))
+        $(eval $(call generateresourceheader,$(RESOURCEHEADER),$(INTERBASE_TMP)_$(HEADLANG).rpp,$(HEADLANG)))
 endif
 
+# The one on which the others will depend i.e. they will 
+# "sit in it's dependency slipstream" or in other words
+# We only have to make one dependency file because all of
+# the other languages will benefit from the dependency file
+# belonging to this language.
+PRIMARYRPPFILE:=$(INTERBASE_TMP)_$(HEADLANG).rpp
 ifeq ($(HEADERONLY),)
         # generate a resource file for each language
         # For sc we generate $(RESBASE).rsc and define LANGUAGE_SC and LANGUAGE_sc.
-        $(foreach L,$(LANGUAGES:SC=sc),$(eval $(call preprocessresource,$(INTERBASE)_$(L).rpp,$(RESBASE).r$(L),$(L))))
-        $(foreach L,$(LANGUAGES:SC=sc),$(eval $(call generateresource,$(RESBASE).r$(L),$(INTERBASE)_$(L).rpp,$(L))))
+        $(foreach L,$(LANGUAGES:SC=sc),$(eval $(call preprocessresource,$(INTERBASE_TMP)_$(L).rpp,$(INTERBASE).r$(L),$(L),$(PRIMARYRPPFILE))))
+
+        ifeq "$(MAKEFILE_GROUP)" "RESOURCE"
+            $(foreach L,$(LANGUAGES:SC=sc),$(eval $(call generateresource,$(INTERBASE).r$(L),$(INTERBASE_TMP)_$(L).rpp,$(L))))
+        endif
 else
         # No resources are going to be made so unless we specifically ask for it, there will be no
         # preprocessed file from which to create the header:
 
-        $(eval $(call preprocessresource,$(INTERBASE)_$(HEADLANG).rpp,,$(HEADLANG)))
+        $(eval $(call preprocessresource,$(INTERBASE_TMP)_$(HEADLANG).rpp,,$(HEADLANG),$(PRIMARYRPPFILE)))
 
 endif
 
@@ -277,10 +284,10 @@
 ifneq ($(RFIFILE),)
   RESOURCE:: $(RFIFILE)
   RELEASABLES:=$(RELEASABLES) $(RFIFILE)
-  CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(RFIFILE))
+  CREATABLEPATHS:=$(CREATABLEPATHS) $(dir $(RFIFILE))/
 
-  RPPFILES:=$(foreach L,$(LANGUAGES:SC=sc),$(INTERBASE)_$(L).rpp)
-  $(eval $(call generaterfifile,$(RFIFILE),$(RPPFILES),$(addsuffix .d,$(RPPFILES))))
+  RPPFILES:=$(foreach L,$(LANGUAGES:SC=sc),$(INTERBASE_TMP)_$(L).rpp)
+  $(eval $(call generaterfifile,$(RFIFILE),$(RPPFILES),$(PRIMARYRPPFILE).d))
 endif
 
 
--- a/sbsv2/raptor/lib/flm/tracecompiler.mk	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/lib/flm/tracecompiler.mk	Thu May 13 14:14:32 2010 +0100
@@ -13,49 +13,64 @@
 # Description:
 # Run Trace Compiler on source files to generate trace headers and decode files
 
+# Expected inputs:
+# TARGETEXT
+
 # Set project name as <mmp_name>
 TRACE_PRJNAME:=$(basename $(notdir $(PROJECT_META)))
+OLDTC_TRACE_PRJNAME:=$(TRACE_PRJNAME)
+TRACE_RELEASABLE_ID:=$(TARGET)_$(TARGETEXT)
 
-TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(POSTLINKFILETYPE))
+define get_trace_path
+$(firstword $(filter %$1, $(USERINCLUDE) $(SYSTEMINCLUDE)))
+endef
+
+$(if $(FLMDEBUG),$(info <debug>INCLUDES=$(USERINCLUDE) $(SYSTEMINCLUDE)</debug>))
+$(if $(FLMDEBUG),$(info <debug>TARGET=$(TARGET) TARGETEXT=$(TARGETEXT)</debug>))
 
-# Find out TRACE_PATH
-# first look for .*/traces/traces_<target_name>_<target_extension>
-TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces/traces_$(TARGET)_$(TARGETEXT),$(DIR))))
-
+# Find out TRACE_PATH  by looking for the trace folder in SYSTEMINCLUDE and USERINCLUDES
+# traces/traces_<target_name>_<target_extension>
+TRACE_PATH:=$(call get_trace_path,/traces/traces_$(TRACE_RELEASABLE_ID))
 ifneq ($(TRACE_PATH),)
-# set project name as <target_name>_<target_extension> instead of <mmp_name>
-TRACE_PRJNAME:=$(TARGET)_$(TARGETEXT)
+  TRACE_PRJNAME:=$(TRACE_RELEASABLE_ID)
+else # obsolete forms for compatibility
+  # traces_<target_name>_<target_ext>
+  TRACE_PATH:=$(call get_trace_path,/traces_$(TARGET)_$(TARGETEXT))
+  ifneq ($(TRACE_PATH),)
+    # set project name as <target_name>_<target_ext> instead of <mmp_name>
+    # to trick old TCom into finding the path.
+    OLDTC_TRACE_PRJNAME:=$(TARGET)_$(TARGETEXT)
+  else
+    # traces_<target_name>_<target_type>
+    TRACE_PATH:=$(call get_trace_path,/traces_$(TARGET)_$(TARGETTYPE))
+    ifneq ($(TRACE_PATH),)
+      # set project name as <target_name>_<target_type> instead of <mmp_name>
+      # to trick old TCom into finding the path.
+      OLDTC_TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
+    else
+      # traces_<mmp_name>
+      TRACE_PATH:=$(call get_trace_path,/traces_$(TRACE_PRJNAME))
+   
+      # traces
+      ifeq ($(TRACE_PATH),)
+       TRACE_PATH:=$(call get_trace_path,/traces)
+      endif
+    endif
+  endif
 endif
 
-# if not found look for .*/traces_<mmp_name>
-ifeq ($(TRACE_PATH),)
-TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TRACE_PRJNAME),$(DIR))))
-endif
-
-# if not found look for .*/traces
-ifeq ($(TRACE_PATH),)
-TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces,$(DIR))))
-endif
-
-# if not found look for .*/traces_<target_name>_<target_type>
-ifeq ($(TRACE_PATH),)
-TRACE_PATH:=$(strip $(foreach DIR,$(USERINCLUDE),$(filter %/traces_$(TARGET)_$(TARGETTYPE),$(DIR))))
-# set project name as <target_name>_<target_type> instead of <mmp_name>
-TRACE_PRJNAME:=$(TARGET)_$(TARGETTYPE)
-endif
 
 # initialise (so what output will be correct if we don't actually run the TC)
 TRACE_DICTIONARY:=
 AUTOGEN_HEADER:=
-
-$(if $(FLMDEBUG),$(info <debug>TRACE_PATH = $(TRACE_PATH)</debug>))
+$(if $(FLMDEBUG),$(info <debug>TRACE_PATH='$(TRACE_PATH)'   TRACE_RELEASABLE_ID='$(TRACE_RELEASABLE_ID)'</debug>))
 
 # Run trace compiler only if TRACE_PATH exists
 ifneq ($(TRACE_PATH),)
-TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).done
+TRACE_MARKER:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_RELEASABLE_ID)_$(UID_TC).done
 TRACE_HEADERS:=
 
-TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_PRJNAME)_$(UID_TC).sourcelist
+TRACE_SOURCE_LIST:=$(TRACE_MARKER_PATH)/tracecompile_$(TRACE_RELEASABLE_ID)_$(UID_TC).sourcelist
 
 # 1. Append to or create the list of source files for trace compiler to process
 # 2. Check if the hash in trace marker remain unchanged. If not, remove marker so trace compiler will run again. 
@@ -72,25 +87,57 @@
 ifeq ($(GUARD_$(call sanitise,$(TRACE_MARKER))),)
 GUARD_$(call sanitise,$(TRACE_MARKER)):=1
 
+$(if $(FLMDEBUG),$(info <debug>PAST MARKER='$(TRACE_RELEASABLE_ID)'</debug>))
 # The trace compiler likes to change . into _ so we must do the same in the case of mmps with a name like
 # fred.prd.mmp we want fred_prd
 TRACE_PRJNAME_SANITISED:=$(subst .,_,$(TRACE_PRJNAME))
+OLDTC_TRACE_PRJNAME_SANITISED:=$(subst .,_,$(OLDTC_TRACE_PRJNAME))
 
-TRACE_DICTIONARY:=$(EPOCROOT)/epoc32/ost_dictionaries/$(TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_Dictionary.xml
-AUTOGEN_HEADER:=$(EPOCROOT)/epoc32/include/internal/SymbianTraces/autogen/$(TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_TraceDefinitions.h
 
 JAVA_COMMAND:=$(SBS_JAVATC)
 TRACE_COMPILER_PATH:=$(EPOCROOT)/epoc32/tools
-TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler
+
+# declare the trace_compile macro but only do it once in the build
+ifeq ($(trace_compile),)
+
+# Find out which macro to declare - the one supporting the new CLI 
+# or the old one.  First try to find TraceCompilerMain.class 
+# If it is there then it might be the new posix-like interface
+TRACE_VER:=
+TRACE_VSTR:=
 
+TCClass:=$(wildcard  $(TRACE_COMPILER_PATH)/tracecompiler/com/nokia/tracecompiler/TraceCompilerMain.class)
+ifneq ($(TCClass),) 
+# Get the version string from the TC (assume it's the new one)
+TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompilerMain
+TRACE_VSTR:=$(firstword $(subst TraceCompiler version ,,$(shell $(JAVA_COMMAND) $(TRACE_COMPILER_START) --version)))
+# check if it looks like a version that supports the new cli interface: supporting up to verion 9 in the future.
+TRACE_VER:=$(findstring new,$(foreach version,2 3 4 5 6 7 8 9,$(patsubst $(version).%,new,$(TRACE_VSTR))))
+endif
+$(if $(FLMDEBUG),$(info <debug>TRACE_VSTR=$(TRACE_VSTR) TRACE_VER=$(TRACE_VER)</debug>))
 
+ifeq ($(TRACE_VER),new)
+define trace_compile
+$(TRACE_MARKER) : $(PROJECT_META)
+	$(call startrule,tracecompile) \
+	( $(GNUCAT) $(TRACE_SOURCE_LIST); \
+	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
+	$(JAVA_COMMAND) $(TRACE_COMPILER_START) $(if $(FLMDEBUG),-d,) --uid=$(UID_TC) --project=$(TRACE_PRJNAME) --mmp=$(PROJECT_META) --traces=$(TRACE_PATH) &&  \
+	$(GNUMD5SUM) $(TRACE_SOURCE_LIST) > $(TRACE_MARKER) && \
+	{ $(GNUTOUCH) $(TRACE_DICTIONARY) $(AUTOGEN_HEADER); \
+	 $(GNUCAT) $(TRACE_SOURCE_LIST) ; true ; } \
+	$(call endrule,tracecompile)
+endef
+
+else # Old inteface
+TRACE_COMPILER_START:=-classpath $(TRACE_COMPILER_PATH)/tracecompiler com.nokia.tracecompiler.TraceCompiler
 # 1. Use pipe to send inputs to trace compiler to process
 # 2. Create a hash regarding to source names and put it in marker.
 # 3. Show source names that are processed by trace compiler
 define trace_compile
 $(TRACE_MARKER) : $(PROJECT_META)
 	$(call startrule,tracecompile) \
-	( echo -en "$(TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
+	( echo -en "$(OLDTC_TRACE_PRJNAME)\n$(PROJECT_META)\n"; \
 	  $(GNUCAT) $(TRACE_SOURCE_LIST); \
 	  echo -en "*ENDOFSOURCEFILES*\n" ) | \
 	$(JAVA_COMMAND) $(TRACE_COMPILER_START) $(UID_TC) &&  \
@@ -100,15 +147,31 @@
 	$(call endrule,tracecompile)
 endef
 
+# End - new/old trace compiler
+endif
+
+# End - tracecompile is defined
+endif
+
+ifeq ($(TRACE_VER),new)
+TRACE_DICTIONARY:=$(EPOCROOT)/epoc32/ost_dictionaries/$(TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_Dictionary.xml
+AUTOGEN_HEADER:=$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/$(TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_TraceDefinitions.h
+else
+TRACE_DICTIONARY:=$(EPOCROOT)/epoc32/ost_dictionaries/$(OLDTC_TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_Dictionary.xml
+AUTOGEN_HEADER:=$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/$(OLDTC_TRACE_PRJNAME_SANITISED)_0x$(UID_TC)_TraceDefinitions.h
+endif
+
 $(eval $(trace_compile))
 
 $(eval $(call GenerateStandardCleanTarget, $(TRACE_PATH)/tracebuilder.cache $(TRACE_MARKER) $(TRACE_SOURCE_LIST),,))
 
-# End sanity guard
+$(call makepath,$(TRACE_PATH) $(dir $(TRACE_DICTIONARY) $(AUTOGEN_HEADER)))
+# End  - guard that prevents repeated calls to TCom
 endif
 
 $(eval $(call GenerateStandardCleanTarget,$(TRACE_HEADERS),,))
 
+# End - Nothing to trace (not trace path in include)
 else
 # Indicate to following parts of the FLM that we actually won't run
 # trace compiler so they can set dependencies accordingly.
--- a/sbsv2/raptor/lib/flm/win32.flm	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/lib/flm/win32.flm	Thu May 13 14:14:32 2010 +0100
@@ -199,7 +199,8 @@
 endif
 
 
-BINTARGET:=$(BINDIR)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE))
+TARGETEXT:=$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE))
+BINTARGET:=$(BINDIR)/$(TARGET).$(TARGETEXT)
 
 
 # Run trace compiler #####################################
@@ -217,7 +218,8 @@
 
 # USE_TRACE_COMPILER defaults to blank in Raptor config.
 # Users can turn TC on by setting it to 1 in user config.
-ifneq ($(USE_TRACE_COMPILER),) 
+ifneq ($(USE_TRACE_COMPILER),)
+  # TARGETEXT must be set before here
   include $(FLMHOME)/tracecompiler.mk
   TC_RELEASABLES:=$(TRACE_DICTIONARY) $(AUTOGEN_HEADER)
 endif
@@ -227,7 +229,7 @@
 ## IMPORT LIBRARY ##
 ####################
 
-IMPORTLIBLINKAS:=$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE))
+IMPORTLIBLINKAS:=$(TARGET).$(TARGETEXT)
 # LINKAS, if supplied, only applies to IMPLIB TARGETTYPEs
 ifeq ($(BASE_TYPE),importlib)
   ifneq ($(LINKAS),)
@@ -295,7 +297,7 @@
   #############
 
   ifeq ($(COPY_FOR_STATIC_LINKAGE),1)
-    BINTARGETSTATICLINK:=$(BINDIRSTATICLINK)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE))
+    BINTARGETSTATICLINK:=$(BINDIRSTATICLINK)/$(TARGET).$(TARGETEXT)
   endif
 
   RELEASABLES:=$(RELEASABLES) $(BINTARGET) $(BINTARGETSTATICLINK)
@@ -535,7 +537,7 @@
     TMP_IMPLIB:=$(BLDDIR)/$(TARGET).lib
     TMP_INFFILE:=$(BLDDIR)/$(TARGET).inf
     TMP_SYMFILE:=$(if $(OPEN_ENVIRONMENT),$(BLDDIR)/$(TARGET).sym,)
-    TMP_TARGET:=$(BLDDIR)/$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE))
+    TMP_TARGET:=$(BLDDIR)/$(TARGET).$(TARGETEXT)
     TMP_DEFFILE:=$(BLDDIR)/$(TARGET).def
 
     CLEANTARGETS:=$(CLEANTARGETS) $(TMP_IMPLIB) $(TMP_INFFILE) $(TMP_TARGET) $(TMP_DEFFILE) $(TMP_SYMFILE)
@@ -576,7 +578,7 @@
 		$(call groupin10,$(notdir $(OBJECTFILES))) ;
 	    $(call startrule,win32stageonelink) \
 	    $(if $(SUPPORTS_STDCPP_NEWLIB),$(if $(STATICLIBFILES),$(CHECKLIB) $(CHECKLIB_TYPE) $(OPT.CHECKLIB.WIN32) $(STATICLIBFILES) &&,),) \
-	    MWSym2LibraryFiles="$(MWSym2LibraryFiles)" $(LD) $(LFLAGS) $(OPT.MENTRYPOINT)$(ENTRYSYMBOL) $(OPT.EXPORT)$(EXPORT_TYPE) $(OPT.NOCOMPACTIMPORTLIB) $(OPT.ADDCOMMAND) "out:$(TARGET).$(if $(REQUESTEDTARGETEXT),$(REQUESTEDTARGETEXT),$(TARGETTYPE))" $(OPT.WARNINGS) off $(OPT.IMPLIB)"$(TMP_IMPLIB)" $(OPT.OUT)"$(TMP_TARGET)" $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(WIN32_LIBRARIES) $(STATICLIBFILES) $(LINKLIBFILES) $(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \
+	    MWSym2LibraryFiles="$(MWSym2LibraryFiles)" $(LD) $(LFLAGS) $(OPT.MENTRYPOINT)$(ENTRYSYMBOL) $(OPT.EXPORT)$(EXPORT_TYPE) $(OPT.NOCOMPACTIMPORTLIB) $(OPT.ADDCOMMAND) "out:$(TARGET).$(TARGETEXT)" $(OPT.WARNINGS) off $(OPT.IMPLIB)"$(TMP_IMPLIB)" $(OPT.OUT)"$(TMP_TARGET)" $(LINKER_FIRSTSTATLIBFILE) $(NEWLIBFILE) $(WIN32_LIBRARIES) $(STATICLIBFILES) $(LINKLIBFILES) $(OPT.LIBPATH)$(BLDDIR) $(OPT.SEARCH) @$(OBJECTFILES_LRF) \
 	    $(call endrule,win32stageonelink)
     endef
     $(eval $(win32stageonelink))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/notes/localresourcecopying.txt	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,24 @@
+Resources were copied using make rules.  This is sensible in local
+machine builds but non-optimal in cluster builds.  It is entirely IO
+bound so that instead of benefitting from running on the cluster it
+simply creates more IO as files need to be transferred over the network,
+possibly multiple times.
+
+This change introduces the <finalcopy> tag to the log which the frontend
+reads in a new "default" filter called FilterCopyFile.  Thus the python
+frontend does the copying rather than the cluster build engine.
+
+This happens at the end of each invocation of the build engine or "stage".
+Since resources are built in their own stage, the copying is completed
+before build tasks in the other stages require them.  The copied files
+are not needed in the resource stage itself.
+
+The filter uses <progress:end ...> tags to determine when a stage
+is finished and this requires that the timing feature be switched on
+permanently.
+
+The format of the tag is:
+<finalcopy source="sourcefilename">dest_filename1 dest_filename2 ...</finalcopy>
+
+Spaces may not be used in filenames. The sequence "%20" may be used
+instead.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/notes/tcomsupport.txt	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,42 @@
+New Trace Compiler
+-------------------
+
+Raptor supports an updated version of the Trace Compiler which has
+an improved command-line interface that allows Raptor to specify the
+directory in which trace data should be written.  This allows MMPs to
+implement a new convention for where trace files are stored.
+
+The new convention prevents clashes where building the same
+source file for different MMPs would previously have resulted in two
+build tasks trying to create the same trace file (header/dictionary).
+This caused build slowdowns and also made the trace data inaccurate.
+
+The standard for this directory is that the last two elements of the
+path should be
+
+   traces/traces_<targetname>_<ext>
+
+e.g.
+
+   traces/traces_euser_dll
+
+The new trace compiler also creates "autogen" headers in a new location
+under epoc32/include/platform rather than epoc32/include/internal.
+
+Trace Headers Directory can now also be in SYSTEMINCLUDEs
+----------------------------------------------------------
+
+Some teams were having trouble getting qmake to generate MMPs with
+USERINCLUDEs set.  So they were specifying the trace header directory in
+their SYTEMINCLUDEs.  This change causes Raptor to look for the traces
+directory in bot SYSTEMINCLUDES and USERINCLUDES.
+
+
+Create Trace Directories During Makefile Parse
+-----------------------------------------------
+
+Some build engines consider it a "clash" when two jobs attempt to make the
+same directory.  This change causes some important trace output directories
+to be created during makefile parsing which removes the (small) possibility
+that they would clash during the build part.
+
--- a/sbsv2/raptor/python/filter_list.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/python/filter_list.py	Thu May 13 14:14:32 2010 +0100
@@ -98,20 +98,31 @@
 		# Find all the filter plugins
 		self.pbox = pbox
 		possiblefilters = self.pbox.classesof(filter_interface.Filter)
+		filterdict = {}
+		for p in possiblefilters:
+			name = p.__name__.lower()
+			if name in filterdict:
+				raise ValueError("filters found in SBS_HOME/python/plugins which have duplicate name: %s " % p.__name__)
+			else:
+				filterdict[name] = p
+		
 		# turn "filternames" into a list of (classname, parameters) pairs
 		filterCalls = SplitList(filternames)
+		
 		# look for each filter class in the box
 		unfound = []
 		self.filters = []
 		for (f, params) in filterCalls:
-			unfound.append(f) # unfound unless we find it
-			for pl in possiblefilters:
-				if pl.__name__.upper() == f.upper():
-					if params:
-						self.filters.append(pl(params))
-					else:
-						self.filters.append(pl())
-					unfound = unfound[:-1]
+			# if the filter exists and is a valid filter use it
+			if f.lower() in filterdict:
+				if params:
+					self.filters.append(filterdict[f.lower()](params))
+				else:
+					self.filters.append(filterdict[f.lower()]())
+			else:
+				# record missing filters
+				unfound.append(f)
+
 		if unfound != []:
 			raise ValueError("requested filters not found: %s \
 			\nAvailable filters are: %s" % (str(unfound), self.format_output_list(possiblefilters)))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/python/plugins/filter_copyfile.py	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,92 @@
+#
+# Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+# Filter class for copying files in serial in python. This
+# is important in cluster builds where file copying is 
+# very inefficient.  
+# The one-to-many <finalcopy> tag is searched for and copy
+# instructions are built up in a hash table.
+# <finalcopy source='sourcefilename'>destfilename1 destfilename2 . . . .destfilenameN</copy>
+# destinations must be full filenames not directories.
+#
+# This filter monitors build progress
+# via the <progress> tags and flushes copies as build 
+# stages end (e.g. after resource so resources are ready for the next stage)
+# 
+
+import os
+import sys
+import tempfile
+import filter_interface
+import shutil
+import generic_path
+import stat
+from raptor_utilities import copyfile
+
+class FilterCopyFile(filter_interface.Filter):
+	
+	def open(self, params):
+		"initialise"
+		
+		self.ok = True
+
+		self.files = {}
+		
+		return self.ok
+	
+	
+	def write(self, text):
+		"process some log text"
+		
+		for line in text.splitlines():
+			if line.startswith("<finalcopy"):
+				source_start = line.find("source='")
+				source = line[source_start+8:line.find("'", source_start+8)]
+				destinations = line[line.find(">",source_start)+1:line.find("</finalcopy>")].split(" ")
+
+				if source in self.files:
+					self.files[source].update(destinations)
+				else:
+					self.files[source] = set(destinations)
+			elif line.startswith("<progress:end object_type='makefile' task='build'"):
+				self.flushcopies() # perform copies at end of each invocation of the make engine
+						   # to ensure dependencies are in place for the next one.
+				
+		return self.ok
+	
+	
+	def summary(self):
+		"finish off"
+		self.flushcopies()
+		return self.ok
+
+	def flushcopies(self):
+		for source in self.files.keys():
+			for dest in self.files[source]:
+				try:
+					copyfile(source, dest)
+				except IOError, e:
+					print "<error>%s</error>" % str(e)
+		self.files = {}
+		
+
+
+	def close(self):
+		"nop"
+		
+
+		return self.ok
+
+# the end				
+
--- a/sbsv2/raptor/python/plugins/filter_what.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/python/plugins/filter_what.py	Thu May 13 14:14:32 2010 +0100
@@ -90,13 +90,7 @@
 		
 		# repetitions is for tracking repeated lines in the output log
 		# when --check and --what are called
-		self.repetitions = {}
-		
-		"Regex for old what output"
-		if "win" in self.buildparameters.platform:
-			self.regex = re.compile("^[a-zA-Z]:\S+$")
-		else:
-			self.regex = re.compile("^/\S+$")
+		self.repetitions = {}	
 		
 		"Regex for targets"
 		self.target_regex = re.compile("^<(build|stringtable|resource|bitmap)>.*")
@@ -136,10 +130,6 @@
 				self.repetitions[line] = 0
 				
 			if self.repetitions[line] == 0:
-				
-				if self.regex.match(line) and (self.what or self.check):
-					"Print the whole line"
-					self.print_file(line, (-1), len(line))
 					
 				if self.target_regex.match(line):
 					"Grab the filename between <build> and </build>" 
--- a/sbsv2/raptor/python/raptor.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/python/raptor.py	Thu May 13 14:14:32 2010 +0100
@@ -338,9 +338,6 @@
 		if build.quiet == True:
 			cli_options += " -q"
 
-		if build.timing == True:
-			cli_options += " --timing"
-
 		if build.noDependInclude == True:
 			cli_options += " --no-depend-include"
 
@@ -536,7 +533,7 @@
 		# what platform and filesystem are we running on?
 		self.filesystem = raptor_utilities.getOSFileSystem()
 
-		self.timing = False
+		self.timing = True # Needed by filters such as copy_file to monitor progress
 		self.toolset = None
 
 		self.starttime = time.time()
@@ -698,7 +695,7 @@
 		return True
 
 	def SetTiming(self, TrueOrFalse):
-		self.timing = TrueOrFalse
+		self.Info("--timing switch no longer has any effect - build timing is now permanently on")
 		return True
 
 	def SetParallelParsing(self, type):
@@ -836,6 +833,12 @@
 				self.filterList += ",filterclean"
 				if is_suspicious_clean:
 					self.Warn('CLEAN, CLEANEXPORT and a REALLYCLEAN should not be combined with other targets as the result is unpredictable.')
+			else:
+				""" Copyfile implements the <copy> tag which is primarily useful with cluster builds.
+				    It allows file copying to occur on the primary build host rather than on the cluster.
+				    This is more efficient.
+				"""
+				self.filterList += ",filtercopyfile"
 
 		if not more_to_do:
 			self.skipAll = True		# nothing else to do
--- a/sbsv2/raptor/python/raptor_make.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/python/raptor_make.py	Thu May 13 14:14:32 2010 +0100
@@ -68,7 +68,10 @@
 def AnnoFileParseOutput(annofile):
 	""" A generator that extracts log output from an emake annotation file, 
 	    perform an XML-unescape on it and "yields" it line by line.  """
-	af = open(annofile, "r")
+	if isinstance(annofile,str):
+		af = open(annofile, "r")
+	else:
+		af = annofile
 
 	inOutput = False
 
--- a/sbsv2/raptor/python/raptor_meta.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/python/raptor_meta.py	Thu May 13 14:14:32 2010 +0100
@@ -1071,9 +1071,12 @@
 			if (re.search(r'^\s*START ',extensionLine, re.I)):
 				start = extensionLine
 			elif re.search(r'^\s*END\s*$',extensionLine, re.I):
-				extensionObjects.append(Extension(self.filename, start, options, aBuildPlatform, self.__Raptor))
-				start = ""
-				options = []
+				if start == "":
+					self.log.Error("unmatched END statement in %s section", aType, bldinf=str(self.filename))
+				else:
+					extensionObjects.append(Extension(self.filename, start, options, aBuildPlatform, self.__Raptor))
+					start = ""
+					options = []
 			elif re.search(r'^\s*$',extensionLine, re.I):
 				continue
 			elif start:
@@ -3296,7 +3299,7 @@
 					self.__Raptor.Debug("Skipping %s", str(m.getMakefileName()))
 					continue
 				elif projectname in self.projectList:
-					projectList.remove(projectname)
+					self.projectList.remove(projectname)
 
 			self.__Raptor.Debug("%i makefile extension makefiles for %s",
 						len(makefileList), str(componentNode.component.bldinf.filename))
--- a/sbsv2/raptor/python/raptor_utilities.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/python/raptor_utilities.py	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -20,6 +20,8 @@
 import os.path
 import re
 import sys
+import stat
+import shutil
 
 dosSlashRegEx = re.compile(r'\\')
 unixSlashRegEx = re.compile(r'/')
@@ -189,3 +191,50 @@
 		return
 
 nulllog = NullLog()
+
+def copyfile(_source, _destination):
+	"""Copy the source file to the destination file (create a directory
+	   to copy into if it does not exist). Don't copy if the destination
+	   file exists and has an equal or newer modification time."""
+	source = generic_path.Path(str(_source).replace('%20',' '))
+	destination = generic_path.Path(str(_destination).replace('%20',' '))
+	dest_str = str(destination)
+	source_str = str(source)
+
+	try:
+
+
+		destDir = destination.Dir()
+		if not destDir.isDir():
+			os.makedirs(str(destDir))
+			shutil.copyfile(source_str, dest_str)
+			return 
+		# Destination file exists so we have to think about updating it
+		sourceMTime = 0
+		destMTime = 0
+		sourceStat = 0
+		try:
+			sourceStat = os.stat(source_str)
+			sourceMTime = sourceStat[stat.ST_MTIME]
+		except OSError, e:
+			message = "Source of copyfile does not exist:  " + str(source)
+			raise IOError(message)
+		try:
+			destMTime = os.stat(dest_str)[stat.ST_MTIME]
+		except OSError, e:
+			pass # destination doesn't have to exist
+
+		if destMTime == 0 or destMTime < sourceMTime:
+			if os.path.exists(dest_str):
+				os.chmod(dest_str,stat.S_IREAD | stat.S_IWRITE)
+			shutil.copyfile(source_str, dest_str)
+
+			# Ensure that the destination file remains executable if the source was also:
+			os.chmod(dest_str,sourceStat[stat.ST_MODE] | stat.S_IREAD | stat.S_IWRITE | stat.S_IWGRP ) 
+
+
+	except Exception,e:
+		message = "Could not update " + dest_str + " from " + source_str + " : " + str(e)
+		raise IOError(message)
+
+	return 
--- a/sbsv2/raptor/python/raptor_xml.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/python/raptor_xml.py	Thu May 13 14:14:32 2010 +0100
@@ -11,7 +11,7 @@
 #
 # Contributors:
 #
-# Description: 
+# Description:
 # raptor_xml module
 #
 
@@ -67,15 +67,15 @@
 	objects = []
 
 	fileVersion = build.getAttribute("xsi:schemaLocation")
-	
+
 	# ignore the file it matches the "invalid" schema
 	if fileVersion.endswith(xsdIgnore):
 		return objects
-		
+
 	# check that the file matches the expected schema
 	if not fileVersion.endswith(xsdVersion):
 		Raptor.Warn("file '%s' uses schema '%s' which does not end with the expected version '%s'", filename, fileVersion, xsdVersion)
-		
+
 	# create a Data Model object from each sub-element
 	for child in build.childNodes:
 		if child.namespaceURI == namespace \
@@ -147,21 +147,21 @@
 	def __init__(self, aBldInfFile, aLayerName, aContainerNames, aSystemDefinitionFile, aSystemDefinitionBase, aSystemDefinitionVersion):
 		generic_path.Path.__init__(self, aBldInfFile.Absolute().path)
 		self.__ContainerNames = aContainerNames
-		self.__LayerName = aLayerName
+		self.__LayerName = aLayerName
 		self.__SystemDefinitionFile = aSystemDefinitionFile
-		self.__SystemDefinitionBase = aSystemDefinitionBase
-		self.__SystemDefinitionVersion = aSystemDefinitionVersion
+		self.__SystemDefinitionBase = aSystemDefinitionBase
+		self.__SystemDefinitionVersion = aSystemDefinitionVersion
 
 	def GetSystemDefinitionFile(self):
 		return self.__SystemDefinitionFile
 
 	def GetSystemDefinitionBase(self):
 		return self.__SystemDefinitionBase
-
-	def GetSystemDefinitionVersion(self):
-		return self.__SystemDefinitionVersion
-
-	def GetLayerName(self):
+
+	def GetSystemDefinitionVersion(self):
+		return self.__SystemDefinitionVersion
+
+	def GetLayerName(self):
 		return self.__LayerName
 
 	def GetContainerName(self, aContainerType):
@@ -177,12 +177,13 @@
 		self.__Logger = aLogger
 		self.__SystemDefinitionFile = aSystemDefinitionFile.GetLocalString()
 		self.__SystemDefinitionBase = aSystemDefinitionBase.GetLocalString()
-		self.__Version = {'MAJOR':0,'MID':0,'MINOR':0}
-		self.__IdAttribute = "name"
+		self.__Version = {'MAJOR':0,'MID':0,'MINOR':0}
+		self.__IdAttribute = "name"
 		self.__ComponentRoot = ""
 		self.__TotalComponents = 0
 		self.__LayerList = []
 		self.__LayerDetails = {}
+		self.__MissingBldInfs = {}
 
 		self.__DOM = None
 		self.__SystemDefinitionElement = None
@@ -208,10 +209,16 @@
 		return self.__LayerDetails[aLayer]
 
 	def IsLayerBuildable(self, aLayer):
+		if aLayer in self.__MissingBldInfs:
+			for missingbldinf in self.__MissingBldInfs[aLayer]:
+				self.__Logger.Error("System Definition layer \"%s\" from system definition file \"%s\" " + \
+								    "refers to non existent bld.inf file %s", aLayer, self.__SystemDefinitionFile, missingbldinf)
+
 		if len(self.GetLayerComponents(aLayer)):
 			return True
 		return False
 
+
 	def GetAllComponents(self):
 		components = []
 
@@ -268,33 +275,33 @@
 
 		if self.__Version['MAJOR'] == 1 and self.__Version['MID'] > 2:
 			self.__ComponentRoot = self.__SystemDefinitionBase
-		elif self.__Version['MAJOR'] == 2 or self.__Version['MAJOR'] == 3:
-			# 2.0.x and 3.0.0 formats support SOURCEROOT or SRCROOT as an environment specified base - we respect this, unless
-			# explicitly overridden on the command line
-			if os.environ.has_key('SRCROOT'):
-				self.__ComponentRoot = generic_path.Path(os.environ['SRCROOT'])
-			elif os.environ.has_key('SOURCEROOT'):
+		elif self.__Version['MAJOR'] == 2 or self.__Version['MAJOR'] == 3:
+			# 2.0.x and 3.0.0 formats support SOURCEROOT or SRCROOT as an environment specified base - we respect this, unless
+			# explicitly overridden on the command line
+			if os.environ.has_key('SRCROOT'):
+				self.__ComponentRoot = generic_path.Path(os.environ['SRCROOT'])
+			elif os.environ.has_key('SOURCEROOT'):
 				self.__ComponentRoot = generic_path.Path(os.environ['SOURCEROOT'])
-				
-			if self.__SystemDefinitionBase and self.__SystemDefinitionBase != ".":
-				self.__ComponentRoot = self.__SystemDefinitionBase
-				if os.environ.has_key('SRCROOT'):
-					self.__Logger.Info("Command line specified System Definition file base \'%s\' overriding environment SRCROOT \'%s\'", self.__SystemDefinitionBase, os.environ['SRCROOT'])
-				elif os.environ.has_key('SOURCEROOT'):
-					self.__Logger.Info("Command line specified System Definition file base \'%s\' overriding environment SOURCEROOT \'%s\'", self.__SystemDefinitionBase, os.environ['SOURCEROOT'])
+
+			if self.__SystemDefinitionBase and self.__SystemDefinitionBase != ".":
+				self.__ComponentRoot = self.__SystemDefinitionBase
+				if os.environ.has_key('SRCROOT'):
+					self.__Logger.Info("Command line specified System Definition file base \'%s\' overriding environment SRCROOT \'%s\'", self.__SystemDefinitionBase, os.environ['SRCROOT'])
+				elif os.environ.has_key('SOURCEROOT'):
+					self.__Logger.Info("Command line specified System Definition file base \'%s\' overriding environment SOURCEROOT \'%s\'", self.__SystemDefinitionBase, os.environ['SOURCEROOT'])
 		else:
 			self.__Logger.Error("Cannot process schema version %s of file %s", version.string, self.__SystemDefinitionFile)
 			return False
-
-		if self.__Version['MAJOR'] >= 3:
-			# id is the unique identifier for 3.0 and later schema
-			self.__IdAttribute = "id"
+
+		if self.__Version['MAJOR'] >= 3:
+			# id is the unique identifier for 3.0 and later schema
+			self.__IdAttribute = "id"
 
 		return True
 
 	def __Parse(self):
 		# For 2.0 and earlier: find the <systemModel> element (there can be 0 or 1) and search any <layer> elements for <unit> elements with "bldFile" attributes
-		# the <layer> context of captured "bldFile" attributes is recorded as we go
+		# the <layer> context of captured "bldFile" attributes is recorded as we go
 		# For 3.0 and later, process any architectural topmost element, use the topmost element with an id as the "layer"
 		for child in self.__SystemDefinitionElement.childNodes:
 			if child.localName in ["systemModel", "layer", "package", "collection", "component"]:
@@ -303,20 +310,20 @@
 	def __CreateComponent(self, aBldInfFile, aUnitElement):
 		# take a resolved bld.inf file and associated <unit/> element and returns a populated Component object
 		containers = {}
-		self.__GetElementContainers(aUnitElement, containers)
+		self.__GetElementContainers(aUnitElement, containers)
 		layer = self.__GetEffectiveLayer(aUnitElement)
 		component = SystemModelComponent(aBldInfFile, layer, containers, self.__SystemDefinitionFile, self.__SystemDefinitionBase, self.__Version)
 
 		return component
-
-	def __GetEffectiveLayer(self, aElement):
-		#' return the ID of the topmost item which has an ID. For 1.x and 2.x, this will always be layer, for 3.x, it will be the topmost ID'd element in the file
-		# never call this on the root element
-		if aElement.parentNode.hasAttribute(self.__IdAttribute):
-			return self.__GetEffectiveLayer(aElement.parentNode)
-		elif aElement.hasAttribute(self.__IdAttribute):
-			return aElement.getAttribute(self.__IdAttribute)
-		return ""
+
+	def __GetEffectiveLayer(self, aElement):
+		#' return the ID of the topmost item which has an ID. For 1.x and 2.x, this will always be layer, for 3.x, it will be the topmost ID'd element in the file
+		# never call this on the root element
+		if aElement.parentNode.hasAttribute(self.__IdAttribute):
+			return self.__GetEffectiveLayer(aElement.parentNode)
+		elif aElement.hasAttribute(self.__IdAttribute):
+			return aElement.getAttribute(self.__IdAttribute)
+		return ""
 
 	def __GetElementContainers(self, aElement, aContainers):
 		# take a <unit/> element and creates a type->name dictionary of all of its parent containers
@@ -333,7 +340,7 @@
 	def __ProcessSystemModelElement(self, aElement):
 		"""Search for XML <unit/> elements with 'bldFile' attributes and resolve concrete bld.inf locations
 		with an appreciation of different schema versions."""
-
+
 		# The effective "layer" is the item whose parent does not have an id (or name in 2.x and earlier)
 		if not aElement.parentNode.hasAttribute(self.__IdAttribute) :
 			currentLayer = aElement.getAttribute(self.__IdAttribute)
@@ -368,19 +375,26 @@
 
 				group = generic_path.Path(bldFileValue)
 
-				if self.__Version['MAJOR'] < 3:
-					# absolute paths are not changed by root var in 1.x and 2.x
+				if self.__Version['MAJOR'] < 3:
+					# absolute paths are not changed by root var in 1.x and 2.x
 					if not group.isAbsolute() and bldInfRoot:
-						group = generic_path.Join(bldInfRoot, group)
-				else:
-					# only absolute paths are changed by root var in 3.x
-					if group.isAbsolute() and bldInfRoot:
-						group = generic_path.Join(bldInfRoot, group)
+						group = generic_path.Join(bldInfRoot, group)
+				else:
+					# only absolute paths are changed by root var in 3.x
+					if group.isAbsolute() and bldInfRoot:
+						group = generic_path.Join(bldInfRoot, group)
 
 				bldinf = generic_path.Join(group, "bld.inf").FindCaseless()
 
 				if bldinf == None:
-					self.__Logger.Error("No bld.inf found at %s in %s", group.GetLocalString(), self.__SystemDefinitionFile)
+					# recording layers containing non existent bld.infs
+					bldinfname = group.GetLocalString()
+					bldinfname = bldinfname + 'bld.inf'
+					layer = self.__GetEffectiveLayer(aElement)
+					if not layer in self.__MissingBldInfs:
+						self.__MissingBldInfs[layer]=[]
+					self.__MissingBldInfs[layer].append(bldinfname)
+
 				else:
 					component = self.__CreateComponent(bldinf, aElement)
 					layer = component.GetLayerName()
--- a/sbsv2/raptor/test/common/raptor_tests.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/common/raptor_tests.py	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -603,9 +603,14 @@
 		# paths in --what output are tailored to the host OS, hence slashes are converted appropriately
 		# .whatlog output is used verbatim from the build/TEM/EM output
 		self.hostossensitive = True
+		
+		# Indicate whether output is expected to appear only once. If so, set it to True
+		self.output_expected_only_once = False 
 	
 	def posttest(self):
 		outlines = self.output.splitlines()
+		if self.output_expected_only_once:
+			outlines_left = list(outlines) 
 		
 		ok = True
 		seen = []
@@ -620,6 +625,8 @@
 				
 			if line in outlines:
 				seen.append(line)
+				if self.output_expected_only_once:
+					outlines_left.remove(line) 
 			else:
 				print "OUTPUT NOT FOUND:", line
 				ok = False
@@ -631,6 +638,13 @@
 			if not line in seen:
 				print "UNEXPECTED OUTPUT:", line
 				ok = False
+		
+		# and check for lines that we expected to see only once
+		if self.output_expected_only_once:
+			for line in outlines_left:
+				print "OUTPUT MORE THAN ONCE:", line
+				ok = False
+
 			
 		# do the base class things too
 		return (SmokeTest.posttest(self) and ok)	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/metadata/project/bld.infs/bad_lone_end.inf	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* 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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+// test for failure in PRJ_EXTENSIONS by processing for ARMV5 and
+// test for failure in PRJ_TESTEXTENSIONS by processing for WINSCW
+
+#ifdef EABI
+
+PRJ_EXTENSIONS
+// an END without a START
+END
+
+#else
+
+PRJ_TESTEXTENSIONS
+// an END without a START
+END
+
+#endif
--- a/sbsv2/raptor/test/metadata/system/system_definition_multi_layers.xml	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/metadata/system/system_definition_multi_layers.xml	Thu May 13 14:14:32 2010 +0100
@@ -34,5 +34,14 @@
 		</layer>
 	    <layer name="Fifth Layer">
 		</layer>
+		<!--layer name="Sixth layer" deliberately omitted -->
+	    <layer name="Seventh Layer">
+			<component name="simple_stringtable">
+				<unit bldFile="test/smoke_suite/test_resources/simple_plugin" root="SBS_HOME" mrp="simple_plugin/test.mrp"/>
+			</component>
+			<component name="does_not_exist">
+				<unit bldFile="test/smoke_suite/test_resources/does_not_exist" root="SBS_HOME" mrp="does_not_exist/test.mrp"/>
+			</component>
+		</layer>
 	</systemModel>
 </SystemDefinition>
--- a/sbsv2/raptor/test/smoke_suite/annofile2log.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/annofile2log.py	Thu May 13 14:14:32 2010 +0100
@@ -26,7 +26,7 @@
 	t.errors = 0
 	t.returncode = 0
 	t.exceptions = 0
-	t.command = "cd smoke_suite/test_resources/annofile2log && ( diff -wB <(python testanno2log.py <(bzip2 -dc scrubbed_ncp_dfs_resource.anno.bz2)) <(bzip2 -dc scrubbed_ncp_dfs_resource.stdout.bz2))"
+	t.command = 'cd smoke_suite/test_resources/annofile2log && ( FROMANNO="`mktemp`" ; bzip2 -dc scrubbed_ncp_dfs_resource.anno.bz2 | python testanno2log.py  >"${FROMANNO}" && FROMSTDOUT="`mktemp`"; bzip2 -dc scrubbed_ncp_dfs_resource.stdout.bz2 > "${FROMSTDOUT}" && diff -wB "${FROMANNO}" "${FROMSTDOUT}"; RET=$? ; rm "${FROMANNO}" "${FROMSTDOUT}"; exit $RET )'
 	
 	t.mustmatch_multiline = [ 
 		"^ *.?"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/depcrunch_test.py	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# 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:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+from raptor_tests import SmokeTest
+
+def run():
+	t = SmokeTest()
+	t.usebash = True
+	
+	t.description = "Test that dependency crunching for resource dependency files produces expected output" 
+
+	t.id = "43562999"
+	t.name = "depcrunch"
+	t.command = "python $SBS_HOME/bin/depcrunch.py --extensions mbg,rsg --assume EPOCROOT < smoke_suite/test_resources/depcrunch/dep2.rpp.d"
+	t.mustmatch_multiline = [
+		r"EPOCROOT/epoc32/build/resource/c_98665870f0168225/dependentresource_/dependentresource_dependentresource_sc.rpp: \\\n"+
+		r" EPOCROOT/testresource1.mbg \\\n"+
+		r" EPOCROOT/testresource2.rsg \\\n"+
+		r" EPOCROOT/testresource3.rsg \\\n"+
+		r" EPOCROOT/testresource4.mbg \\\n"+
+		r" EPOCROOT/testresource5.rsg \\\n"+
+		r" EPOCROOT/testresource6.mbg \\\n"+
+		r" EPOCROOT/testresource7.rsg \\\n"+
+		r" EPOCROOT/testresource8.mbg \\\n"+
+		r" EPOCROOT/testresource9.rsg \n"
+		]
+	t.run()
+
+
+	t.print_result()
+	
+	return t
+
--- a/sbsv2/raptor/test/smoke_suite/exe_armv5_winscw_single_file.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/exe_armv5_winscw_single_file.py	Thu May 13 14:14:32 2010 +0100
@@ -27,8 +27,8 @@
 	t.command = "sbs -b smoke_suite/test_resources/simple_gui/Bld.inf -c armv5 -c winscw"
 	t.addbuildtargets('smoke_suite/test_resources/simple_gui/Bld.inf', [
 		"helloworld_exe/helloworld.mbm_bmconvcommands",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp.d",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp.d",
 		"helloworld_exe/armv5/udeb/HelloWorld_Application.o",
 		"helloworld_exe/armv5/udeb/HelloWorld_Application.o.d",
 		"helloworld_exe/armv5/udeb/HelloWorld_AppUi.o",
@@ -91,8 +91,8 @@
 		"helloworld_exe/winscw/urel/helloworld_UID_.o",
 		"helloworld_exe/winscw/urel/helloworld_UID_.o.d",
 		"helloworld_exe/winscw/urel/helloworld_urel_objects.lrf",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d"
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp",
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp.d"
 	])
 
 	t.run()
--- a/sbsv2/raptor/test/smoke_suite/featurevariants.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/featurevariants.py	Thu May 13 14:14:32 2010 +0100
@@ -167,9 +167,8 @@
 		"createstaticdll_invariant_dll/armv5/urel/createstaticdll_invariant_urel_objects.via",
 		"createstaticdll_invariant_dll/armv5/urel/createstaticdll_invariant{000a0000}.def",
 		"createstaticdll_invariant_dll/armv5/urel/createstaticdll_invariant{000a0000}.dso",
-		
-		"dummy_inv_dll/dummy_inv__resource_apps_sc.rpp",
-		"dummy_inv_dll/dummy_inv__resource_apps_sc.rpp.d"
+		"dummy_inv_dll/dummy_inv_dummy_sc.rpp",
+		"dummy_inv_dll/dummy_inv_dummy_sc.rpp.d"
 		]
 
 	variantBuildTargetsDefaultTree = [
@@ -293,12 +292,12 @@
 		]
 	
 	variantBuildTargetsGeneric = [
-		"dummy_var1_dll/dummy_var1__resource_apps_sc.rpp",
-		"dummy_var1_dll/dummy_var1__resource_apps_sc.rpp.d",
-		"dummy_var2_dll/dummy_var2__resource_apps_sc.rpp",
-		"dummy_var2_dll/dummy_var2__resource_apps_sc.rpp.d",
-		"dummy_var3_exe/dummy_var3__resource_apps_sc.rpp",
-		"dummy_var3_exe/dummy_var3__resource_apps_sc.rpp.d"
+		"dummy_var1_dll/dummy_var1_dummy_sc.rpp",
+		"dummy_var1_dll/dummy_var1_dummy_sc.rpp.d",
+		"dummy_var2_dll/dummy_var2_dummy_sc.rpp",
+		"dummy_var2_dll/dummy_var2_dummy_sc.rpp.d",
+		"dummy_var3_exe/dummy_var3_dummy_sc.rpp",
+		"dummy_var3_exe/dummy_var3_dummy_sc.rpp.d"
 		]
 	
 	sbscommand = "sbs -b smoke_suite/test_resources/bv/bld.inf -c armv5 " + \
--- a/sbsv2/raptor/test/smoke_suite/gccxml.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/gccxml.py	Thu May 13 14:14:32 2010 +0100
@@ -32,9 +32,9 @@
 		]
 	t.addbuildtargets('smoke_suite/test_resources/simple_gui/bld.inf', [
 		"helloworld_exe/gccxml/HelloWorld.mmp.xml",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp.d",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp.d",
 		"helloworld_exe/gccxml/HelloWorld.rss.rfi",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d",
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp.d",
 		"helloworld_exe/gccxml/HelloWorld_reg.rss.rfi",
 		"helloworld_exe/gccxml/urel/HelloWorld_Application.xml.d",
 		"helloworld_exe/gccxml/urel/HelloWorld_Application.xml",
@@ -66,9 +66,9 @@
 	t.antitargets = ["$(EPOCROOT)/epoc32/release/gccxml/urel/helloworldexe.gxp"]
 	t.addbuildantitargets('smoke_suite/test_resources/simple_gui/bld.inf', [
 		"helloworld_exe/gccxml/HelloWorld.mmp.xml",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp.d",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp.d",
 		"helloworld_exe/gccxml/HelloWorld.rss.rfi",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d",
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp.d",
 		"helloworld_exe/gccxml/HelloWorld_reg.rss.rfi",
 		"helloworld_exe/gccxml/urel/HelloWorld_Application.xml.d",
 		"helloworld_exe/gccxml/urel/HelloWorld_Application.xml",
--- a/sbsv2/raptor/test/smoke_suite/gnumakefile_what.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/gnumakefile_what.py	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -23,7 +23,8 @@
 	t.name = "gnumakefile_what"
 	t.command = "sbs -b smoke_suite/test_resources/gnumakefile/bld.inf --what"
 	componentpath = re.sub(r'\\','/',os.path.abspath("smoke_suite/test_resources/gnumakefile"))
-
+	
+	t.output_expected_only_once = True
 	t.stdout = [
 	# Generated txt files by the gnumakefile
 		componentpath+"/master_bld_ARMV5_UDEB.txt",
--- a/sbsv2/raptor/test/smoke_suite/gui_whatlog.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/gui_whatlog.py	Thu May 13 14:14:32 2010 +0100
@@ -30,13 +30,10 @@
 	t.usebash = True
 	t.targets = [
 		"$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.mbm",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld.info",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/helloworld.mbm",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.mbm",
 		"$(EPOCROOT)/epoc32/include/helloworld.rsg",
 		"$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.rsc",
-		"$(EPOCROOT)/epoc32/localisation/helloworld/rsc/helloworld.rpp",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld_reg.info",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/helloworld.rsc",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.rsc",
 		"$(EPOCROOT)/epoc32/release/armv5/udeb/helloworld.exe",
@@ -49,8 +46,8 @@
 		]
 	t.addbuildtargets('smoke_suite/test_resources/simple_gui/Bld.inf', [
 		"helloworld_exe/helloworld.mbm_bmconvcommands",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp.d",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp.d",
 		"helloworld_exe/armv5/udeb/HelloWorld_Application.o",
 		"helloworld_exe/armv5/udeb/HelloWorld_Application.o.d",
 		"helloworld_exe/armv5/udeb/HelloWorld_AppUi.o",
@@ -111,18 +108,14 @@
 		"helloworld_exe/winscw/urel/helloworld_UID_.dep",
 		"helloworld_exe/winscw/urel/helloworld_UID_.o",
 		"helloworld_exe/winscw/urel/helloworld_UID_.o.d",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d"
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp.d"
 	])
 	t.stdout = [
 		"<whatlog bldinf='"+componentpath+"/Bld.inf' mmp='"+componentpath+"/HelloWorld.mmp' config='armv5_udeb.whatlog'>",
 		"<bitmap>$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.mbm</bitmap>",
 		"<resource>$(EPOCROOT)/epoc32/include/helloworld.rsg</resource>",
 		"<resource>$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.rsc</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/helloworld/rsc/helloworld.rpp</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/group/helloworld.info</resource>",
 		"<resource>$(EPOCROOT)/epoc32/data/z/private/10003a3f/apps/helloworld_reg.rsc</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/helloworld_reg/rsc/helloworld_reg.rpp</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/group/helloworld_reg.info</resource>",
 		"<build>$(EPOCROOT)/epoc32/release/armv5/udeb/helloworld.exe</build>",
 		"<build>$(EPOCROOT)/epoc32/release/armv5/udeb/helloworld.exe.map</build>",
 		"<whatlog bldinf='"+componentpath+"/Bld.inf' mmp='"+componentpath+"/HelloWorld.mmp' config='winscw_urel.whatlog'>",
@@ -133,13 +126,9 @@
 		"<resource>$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.rsc</resource>",
 		"<resource>$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/helloworld.rsc</resource>",
 		"<resource>$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.rsc</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/helloworld/rsc/helloworld.rpp</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/group/helloworld.info</resource>",
 		"<resource>$(EPOCROOT)/epoc32/data/z/private/10003a3f/apps/helloworld_reg.rsc</resource>",
 		"<resource>$(EPOCROOT)/epoc32/release/winscw/udeb/z/private/10003a3f/apps/helloworld_reg.rsc</resource>",
 		"<resource>$(EPOCROOT)/epoc32/release/winscw/urel/z/private/10003a3f/apps/helloworld_reg.rsc</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/helloworld_reg/rsc/helloworld_reg.rpp</resource>",
-		"<resource>$(EPOCROOT)/epoc32/localisation/group/helloworld_reg.info</resource>",
 		"<build>$(EPOCROOT)/epoc32/release/winscw/urel/helloworld.exe</build>",
 		"<build>$(EPOCROOT)/epoc32/release/winscw/urel/helloworld.exe.map</build>",
 		"<whatlog bldinf='"+componentpath+"/Bld.inf' mmp='"+componentpath+"/HelloWorld.mmp' config='armv5_urel.whatlog'>",
--- a/sbsv2/raptor/test/smoke_suite/resource.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/resource.py	Thu May 13 14:14:32 2010 +0100
@@ -15,55 +15,78 @@
 #
 
 from raptor_tests import SmokeTest
+from raptor_tests import ReplaceEnvs
+from raptor_meta import BldInfFile
 
 def run():
 	t = SmokeTest()
 	t.id = "30"
 	t.name =  "resource"
-	t.command = "sbs -b smoke_suite/test_resources/resource/group/bld.inf -b smoke_suite/test_resources/simple_gui/Bld.inf RESOURCE"
+	t.command = "sbs  -b smoke_suite/test_resources/simple_gui/Bld.inf RESOURCE"
 	t.targets = [
-		"$(EPOCROOT)/epoc32/include/testresource.rsg",
-		"$(EPOCROOT)/epoc32/include/testresource.hrh",
-		"$(EPOCROOT)/epoc32/data/z/resource/testresource/testresource.r01",
-		"$(EPOCROOT)/epoc32/data/z/resource/testresource/testresource.rsc",
-		"$(EPOCROOT)/epoc32/localisation/group/testresource.info",
-		"$(EPOCROOT)/epoc32/localisation/testresource/rsc/testresource.rpp",
-		
 		"$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.mbm",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld.info",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/helloworld.mbm",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.mbm",
 		"$(EPOCROOT)/epoc32/include/helloworld.rsg",
 		"$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.rsc",
-		"$(EPOCROOT)/epoc32/localisation/helloworld/rsc/helloworld.rpp",
 		"$(EPOCROOT)/epoc32/data/z/private/10003a3f/apps/helloworld_reg.rsc",
-		"$(EPOCROOT)/epoc32/localisation/helloworld_reg/rsc/helloworld_reg.rpp",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld_reg.info",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/helloworld.rsc",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.rsc",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/private/10003a3f/apps/helloworld_reg.rsc",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/private/10003a3f/apps/helloworld_reg.rsc"	
 		]
 	
-	t.addbuildtargets('smoke_suite/test_resources/resource/group/bld.inf', [	
-		"testresource_/testresource_resource_testresource2_sc.rpp.d",
-		"testresource_/testresource_resource_testresource3_02.rpp",
-		"testresource_/testresource_resource_testresource3_02.rpp.d",
-		"testresource_/testresource_resource_testresource3_sc.rpp",
-		"testresource_/testresource_resource_testresource3_sc.rpp.d",
-		"testresource_/testresource_resource_testresource_01.rpp",
-		"testresource_/testresource_resource_testresource_01.rpp.d",
-		"testresource_/testresource_resource_testresource_sc.rpp",
-		"testresource_/testresource_resource_testresource_sc.rpp.d"])
 
 	t.addbuildtargets('smoke_suite/test_resources/simple_gui/Bld.inf', [
 		"helloworld_exe/helloworld.mbm_bmconvcommands",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp.d",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d"])
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp.d",
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp",
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp.d"])
 
 	t.mustnotmatch = ["HelloWorld.rss.* warning: trigraph"]
 	
 	t.run()
+
+	t.id="30a"
+	t.name =  "no_depend_gen_resource"
+	t.usebash = True
+	t.description =  """Check that dependent resources still build correctly even when we turn dependency generation off.  This
+			    test cannot really do this reliably, if you think about it, since it can't force make to try building resources
+			    in the 'wrong' order.  What it does attempt is to check that 
+			    the ultimately generated dependency file is ok.
+			    N.B.  It also attempts to ensure that the dependency file is 'minimal'  i.e. that it only references .mbg and .rsg files
+			    that might come from other parts of the same build.  This is important for performance in situations where --no-depend-generate
+			    is used because the weight of 'complete' dependency information would overwhelm make.
+			 """
+	buildLocation = ReplaceEnvs("$(EPOCROOT)/epoc32/build/") + BldInfFile.outputPathFragment('smoke_suite/test_resources/resource/group/bld.inf')
+	res_depfile= buildLocation+"/dependentresource_/dependentresource_dependentresource_sc.rpp.d"
+
+	t.targets = [
+		"$(EPOCROOT)/epoc32/include/testresource.rsg",
+		"$(EPOCROOT)/epoc32/include/testresource.hrh",
+		"$(EPOCROOT)/epoc32/data/z/resource/testresource/testresource.r01",
+		"$(EPOCROOT)/epoc32/data/z/resource/testresource/testresource.rsc",
+		"$(EPOCROOT)/epoc32/release/armv5/urel/testresource.exe",
+		res_depfile
+		]
+
+	t.addbuildtargets('smoke_suite/test_resources/resource/group/bld.inf', [	
+		"testresource_/testresource_testresource_02.rpp",
+		"testresource_/testresource_testresource_01.rpp",
+		"testresource_/testresource_testresource_01.rpp.d",
+		"testresource_/testresource_testresource_sc.rpp"])
+
+	t.command = "sbs -b smoke_suite/test_resources/resource/group/bld.inf  -c armv5_urel reallyclean ; sbs --no-depend-generate -j 16 -b smoke_suite/test_resources/resource/group/bld.inf -c armv5_urel -f ${SBSLOGFILE} -m ${SBSMAKEFILE} && grep 'epoc32.include.testresource.rsg' %s && wc -l %s " % (res_depfile, res_depfile)
+
+	t.mustnotmatch = []
+
+	t.mustmatch = [
+			"[23] .*.dependentresource_.dependentresource_dependentresource_sc.rpp.d"
+		      ]
+
+	t.run()
+
+	t.name = 'resource'
+	t.print_result()
 	return t
--- a/sbsv2/raptor/test/smoke_suite/sysdef_layers.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/sysdef_layers.py	Thu May 13 14:14:32 2010 +0100
@@ -46,13 +46,9 @@
 		"$(EPOCROOT)/epoc32/release/winscw/urel/helloworld.exe.map",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/private/10003a3f/apps/helloworld_reg.rsc",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.rsc",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld.info",
-		"$(EPOCROOT)/epoc32/localisation/helloworld/rsc/helloworld.rpp",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld_reg.info",
-		"$(EPOCROOT)/epoc32/localisation/helloworld_reg/rsc/helloworld_reg.rpp"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/sysdef/build_gen_source/bld.inf', [
-		"helloworld_/helloworld__resource_apps_sc.rpp"
+		"helloworld_/helloworld_HelloWorld_sc.rpp"
 		])
 	t.addbuildtargets('smoke_suite/test_resources/sysdef/dependent/bld.inf', [
 		"helloworld_exe/armv5/udeb/HelloWorld_Application.o",
@@ -79,11 +75,11 @@
 		"helloworld_exe/winscw/urel/HelloWorld_Main.o",
 		"helloworld_exe/winscw/urel/helloworld.UID.CPP",
 		"helloworld_exe/winscw/urel/helloworld_UID_.o",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp"
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp"
 		])
 	t.countmatch = [
-		["<recipe .*layer='Component with Layer Dependencies' component='dependent'.*>", 37],
-		["<recipe .*layer='Build Generated Source' component='build generated source'.*>", 7]		
+		["<recipe .*layer='Component with Layer Dependencies' component='dependent'.*>", 34],
+		["<recipe .*layer='Build Generated Source' component='build generated source'.*>", 4]		
 		]
 	t.run()
 	return t
--- a/sbsv2/raptor/test/smoke_suite/temtest.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/temtest.py	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -98,6 +98,7 @@
 	t.id = "0018f"
 	t.name = "temwhat"
 	t.command = "sbs -b smoke_suite/test_resources/simple_extension/bld.inf --what"
+	t.output_expected_only_once = True	
 	t.stdout = [
 		# exports
 		'$(EPOCROOT)/epoc32/tools/makefile_templates/sbsv2test/clean.mk',
--- a/sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/annofile2log/testanno2log.py	Thu May 13 14:14:32 2010 +0100
@@ -27,7 +27,10 @@
 retcode=0
 
 
-annofile = sys.argv[1]
+if len(sys.argv) > 1:
+	annofile = sys.argv[1]
+else:
+	annofile = sys.stdin
 
 sys.stdout.write("<build>\n")
 try:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/depcrunch/dep2.rpp.d	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,11 @@
+EPOCROOT/epoc32/build/resource/c_98665870f0168225/dependentresource_/dependentresource_dependentresource_sc.rpp: testresource1.mbg \
+ /home/tnmurphy/x/build/sbsv2/raptor/test/smoke_suite/test_resources/resource/dependentresource.rss \
+ /home/tnmurphy/x/test-epocroot/epoc32/include/variant/Symbian_OS.hrh \
+ /home/tnmurphy/x/test-epocroot/epoc32/include/testresource_badef.rh \
+ /home/tnmurphy/x/test-epocroot/epoc32/include/e32capability.h testresource2.rsg \
+ /home/tnmurphy/x/build/sbsv2/raptor/test/smoke_suite/test_resources/resource/inc/../inc/testresource.rh \
+ testresource3.rsg /home/tnmurphy/x/build/sbsv2/raptor/test/smoke_suite/test_resources/resource/inc/../inc/testresource.hrh \
+ /home/tnmurphy/x/build/sbsv2/raptor/test/smoke_suite/test_resources/resource/testresource.rls \
+ testresource4.mbg testresource5.rsg \
+  testresource6.mbg testresource7.rsg
+  testresource8.mbg testresource9.rsg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/resource/dependentresource.rss	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* 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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+* LOGWRAP.RSS
+*
+*/
+
+
+#include <testresource_badef.rh>
+#include <e32capability.h>
+
+#include "../inc/testresource.rh"
+#include "../inc/testresource.hrh"
+#include "testresource.rls"
+
+#include "testresource.mbg"
+#include <testresource.rsg>
+
+// MACRO statements in .mmp files should be reflected in resource preprocessing
+#ifndef SHOULD_BE_DEFINED
+#error "mmp MACRO SHOULD_BE_DEFINED is not defined!"
+#endif
+
+// Initial configuration
+RESOURCE CONFIG r_log_initial_config
+	{
+	size = 1000; // Maximum number of events
+	recent = 20; // Maximum size of recent lists
+	age = 2592000; // 30 days
+	}
+
+  RESOURCE ARRAY r_log_initial_events
+   	{
+   	items = 
+   		{
+  		ETYPE { uid = KLogCallEventType; description = LOG_CALL_EVENT_TYPE; },
+  		ETYPE { uid = KLogDataEventType; description = LOG_DATA_EVENT_TYPE; },
+  		ETYPE { uid = KLogFaxEventType; description = LOG_FAX_EVENT_TYPE; },
+  		ETYPE { uid = KLogShortMessageEventType; description = LOG_SHORT_MESSAGE_EVENT_TYPE; },
+  		ETYPE { uid = KLogTaskSchedulerEventType; description = LOG_TASK_SCHEDULER_EVENT_TYPE; },
+  		ETYPE { uid = KLogPacketDataEventType; description = LOG_PACKET_DATA_EVENT_TYPE; },
+
+
+  		ETYPE { uid = KLogLbsSelfLocateEventType; description = LOG_LBS_SELF_LOCATE_EVENT_TYPE; },
+  		ETYPE { uid = KLogLbsExternalLocateEventType; description = LOG_LBS_EXTERNAL_LOCATE_EVENT_TYPE; },
+ 		ETYPE { uid = KLogLbsTransmitLocationEventType; description = LOG_LBS_TRANSMIT_LOCATION_EVENT_TYPE; },
+ 		ETYPE { uid = KLogLbsNetworkLocateEventType; description = LOG_LBS_NETWORK_LOCATE_EVENT_TYPE; },
+ 		ETYPE { uid = KLogLbsAssistanceDataEventType; description = LOG_LBS_ASSISTANCE_DATA_EVENT_TYPE; }
+
+   		};
+   	}
+
+
+
+RESOURCE ARRAY r_log_security
+//
+// [See logwrap.rh for the definitions of SECURITY and CAPABILITY.]
+//
+// This structure defines settings for platform security in the Log engine.
+// All event types defined above in 'r_log_initial_events' need to be policed.
+// The server must always determine whether a client thread has the required
+// capability to read/write a log event(s) of a built-in type.  Each operation
+// may have from one to seven capabilities defined for it.  All operations on 
+// built in types _MUST_ have an associated security policy defined here.  If no
+// security is required, then use 'cap=ECapability_None'.  The CAPABILITY values
+// defined here will provide constructor arguments for TSecurityPolicy objects.
+// The maximum number of CAPABILITY(s) for each read or write operation is 7.
+// ( a read_caps or a write_caps { contains <= 7 CAPABILITY{}   statements }  )
+// Note that SID-based security isn't supported in the Log Engine.
+//
+	{
+	items = 
+		{
+		SECURITY 
+			{ 
+			uid = KLogCallEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogDataEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogFaxEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogShortMessageEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogTaskSchedulerEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapability_None; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogPacketDataEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadUserData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteUserData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsSelfLocateEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsExternalLocateEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsTransmitLocationEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsNetworkLocateEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			},
+		SECURITY 
+			{ 
+			uid=KLogLbsAssistanceDataEventType;	
+			read_caps=
+				{
+				CAPABILITY { cap=ECapabilityReadDeviceData; }
+				};
+			write_caps=
+				{
+				CAPABILITY { cap=ECapabilityWriteDeviceData; }
+				};
+			}
+		};
+	}
+
+
+// Index entries
+RESOURCE ARRAY r_log_indexes
+	{
+	items =
+		{
+		INDEX
+			{
+			name = "Index1"; // do not translate
+			table = "Event"; // do not translate
+			keys = 
+				{
+				KEY { col = "Id"; } // do not translate
+				};
+			},
+		INDEX
+			{
+			name = "Index2"; // do not translate
+			table = "Event"; // do not translate
+			keys =
+				{
+				KEY { col = "ETime"; } // do not translate
+				};
+			},
+		INDEX
+			{
+			name = "Index3"; // do not translate
+			table = "String"; // do not translate
+			keys = 
+				{
+				KEY { col = "Id"; } // do not translate
+				};
+			}
+		};
+	}
+
+// Recent list setup
+RESOURCE ARRAY r_log_recent
+	{
+	items =
+		{
+		RECENT
+			{
+			id = KLogRecentIncomingCalls;
+			duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
+			conditions = 
+				{
+				MATCH { field = ELogEventTypeField; value = KLogCallEventType; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_IN; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_IN_ALT; }
+				};
+			},
+		RECENT
+			{
+			id = KLogRecentOutgoingCalls;
+			duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
+			conditions = 
+				{
+				MATCH { field = ELogEventTypeField; value = KLogCallEventType; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_OUT; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_OUT_ALT; }
+				};
+			},
+		RECENT
+			{
+			id = KLogRecentMissedCalls;
+			duplicate = ELogRemotePartyField|ELogContactField|ELogNumberField;
+			conditions = 
+				{
+				MATCH { field = ELogEventTypeField; value = KLogCallEventType; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_MISSED; },
+				MATCH { field = ELogDirectionField; string = LOG_DIR_MISSED_ALT; }
+				};
+			}
+		};
+	}
+
+
+// Direction
+RESOURCE LBUF r_log_dir_in { txt = LOG_DIR_IN; }
+RESOURCE LBUF r_log_dir_out { txt = LOG_DIR_OUT; }
+RESOURCE LBUF r_log_dir_in_alt { txt = LOG_DIR_IN_ALT; }
+RESOURCE LBUF r_log_dir_out_alt { txt = LOG_DIR_OUT_ALT; }
+RESOURCE LBUF r_log_dir_fetched { txt = LOG_DIR_FETCHED; }
+RESOURCE LBUF r_log_dir_missed { txt = LOG_DIR_MISSED; }
+RESOURCE LBUF r_log_dir_missed_alt { txt = LOG_DIR_MISSED_ALT; }
+
+
+// Delivery
+RESOURCE LBUF r_log_del_pending { txt = LOG_DEL_PENDING; }
+RESOURCE LBUF r_log_del_sent { txt = LOG_DEL_SENT; }
+RESOURCE LBUF r_log_del_failed { txt = LOG_DEL_FAILED; }
+/* R_LOG_DEL_NONE comes from the rsg that we're trying to depend on */
+RESOURCE LBUF r_log_del_none { txt = R_LOG_DEL_NONE; } 
+RESOURCE LBUF r_log_del_done { txt = LOG_DEL_DONE; }
+RESOURCE LBUF r_log_del_not_sent { txt = LOG_DEL_NOT_SENT; }
+RESOURCE LBUF r_log_del_scheduled { txt = LOG_DEL_SCHEDULED; }
+
+// Other
+RESOURCE LBUF r_log_remote_unknown { txt = LOG_REMOTE_UNKNOWN; }
+RESOURCE LBUF r_log_remote_multiple { txt = LOG_REMOTE_MULTIPLE; }
+RESOURCE LBUF r_log_subject_none { txt = LOG_SUBJECT_NONE; }
+RESOURCE LBUF r_log_subject_data_message { txt = LOG_SUBJECT_DATA_MESSAGE; }
+
+// Connection
+RESOURCE LBUF r_log_con_connected { txt = LOG_CON_CONNECTED; }
+RESOURCE LBUF r_log_con_connecting { txt = LOG_CON_CONNECTING; }
+RESOURCE LBUF r_log_con_disconnecting { txt = LOG_CON_DISCONNECTING; }
+RESOURCE LBUF r_log_con_disconnected{ txt = LOG_CON_DISCONNECTED; }
+RESOURCE LBUF r_log_con_suspended{ txt = LOG_CON_SUSPENDED; }
+
+// Delivery
+RESOURCE LBUF r_log_del_notified { txt = LOG_DEL_NOTIFIED; } 
+RESOURCE LBUF r_log_del_expired { txt = LOG_DEL_EXPIRED; }  
--- a/sbsv2/raptor/test/smoke_suite/test_resources/resource/group/testresource.mmp	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/resource/group/testresource.mmp	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -52,6 +52,12 @@
 LANG 02 sc
 END
 
+
+START RESOURCE          dependentresource.rss
+TARGETPATH              resource/dependentresource
+LANG sc
+END
+
 START BITMAP	testresource.mbm
 HEADER
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/resource/test.cpp	Thu May 13 14:14:32 2010 +0100
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* 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:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#include "e32def.h" // intentional  include
+
+char test[]="Resource test";
+
+
+TInt E32Main()
+{
+	return 0;
+}
--- a/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/child1.mmp	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/child1.mmp	Thu May 13 14:14:32 2010 +0100
@@ -11,5 +11,5 @@
 SOURCE			child1.cpp
 SOURCE			common.cpp
 
-USERINCLUDE		../traces_child1_exe
+USERINCLUDE		../traces/traces_child1_exe
 
--- a/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/child2.mmp	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/child2.mmp	Thu May 13 14:14:32 2010 +0100
@@ -11,5 +11,5 @@
 SOURCE			child2.cpp
 SOURCE			common.cpp
 
-USERINCLUDE		../traces_child2_exe
+USERINCLUDE		../traces/traces_child2_exe
 
--- a/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/child3.mmp	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/child3.mmp	Thu May 13 14:14:32 2010 +0100
@@ -10,5 +10,5 @@
 SOURCE			child3.cpp
 SOURCE			common.cpp
 
-USERINCLUDE		../traces_child3_exe
+USERINCLUDE		../traces/traces_child3_exe
 
--- a/sbsv2/raptor/test/smoke_suite/timing.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/timing.py	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -22,21 +22,10 @@
 	
 	t.description = "Test that a timing log is created and contains total parse and build durations"
 
-	t.id = "0103a"
-	t.name = "timing_off"
-	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf -f-"
-	t.mustnotmatch = [
-			".*progress:discovery.*",
-			".*progress:start.*",
-			".*progress:end.*"
-			]
-	t.run()
-
-
 	t.id = "0103b"
 	t.name = "timing_on"
-	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf --timing " + \
-			"--filters=FilterLogfile,FilterTiming -f ${SBSLOGFILE} && " + \
+	t.command = "sbs -b smoke_suite/test_resources/simple/bld.inf" + \
+			" --filters=FilterLogfile,FilterTiming -f ${SBSLOGFILE} && " + \
 			"grep progress:duration ${SBSLOGFILE}.timings"
 	t.mustmatch = [
 			"^<progress:duration object_type='layer' task='parse' key='.*' duration='\d+.\d+' />$",
--- a/sbsv2/raptor/test/smoke_suite/tracecompiler_general.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/tracecompiler_general.py	Thu May 13 14:14:32 2010 +0100
@@ -40,7 +40,7 @@
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitpermparserTraces.h",	
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/fixed_id.definitions",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/testTC_0x1000008d_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/testTC_0x1000008d_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/testTC_0x1000008d_TraceDefinitions.h"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/testTC/group/bld.inf', [
 		"testtc_dll/armv5/udeb/wlanhwinit.o",
@@ -59,7 +59,7 @@
 		"testtc_dll/armv5/urel/wlanhwinitpermparser.o.d",	
 		"testtc_dll/armv5/urel/testTC_urel_objects.via",
 		"testtc_dll/armv5/urel/testTC{000a0000}.def",
-		"testtc_dll/tracecompile_testTC_1000008d.done"
+		"testtc_dll/tracecompile_testTC_dll_1000008d.done"
 	])
 	t.run()
 	
@@ -74,7 +74,7 @@
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitpermparserTraces.h"
 		]
 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
-		"testtc_dll/tracecompile_testTC_1000008d.done"
+		"testtc_dll/tracecompile_testTC_dll_1000008d.done"
 	])
 	t.run()
 			
@@ -90,7 +90,7 @@
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/TC_featurevariant/traces/HelloWorldTraces.h",
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/TC_featurevariant/traces/fixed_id.definitions",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/HelloWorld_0xe78a5aa3_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/HelloWorld_0xe78a5aa3_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/HelloWorld_0xe78a5aa3_TraceDefinitions.h"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_featurevariant/group/bld.inf', [
 		"helloworld_exe/armv5/udeb/HelloWorld.o",
@@ -99,7 +99,7 @@
 		"helloworld_exe/armv5/urel/HelloWorld.o",
 		"helloworld_exe/armv5/urel/HelloWorld.o.d",
 		"helloworld_exe/armv5/urel/HelloWorld_urel_objects.via",
-		"helloworld_exe/tracecompile_HelloWorld_e78a5aa3.done"
+		"helloworld_exe/tracecompile_HelloWorld_exe_e78a5aa3.done"
 	])
 	t.run()
 
@@ -120,7 +120,7 @@
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
 		"test_/armv5/udeb/test.o",
 		"test_/armv5/urel/test.o",
-		"test_/tracecompile_autorun1_00000001.done"
+		"test_/tracecompile_test_exe_00000001.done"
 	])
 	t.run()
 	
@@ -141,7 +141,7 @@
 		"test_/armv5/urel/test.o",
 	])
 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
-		"test_/tracecompile_autorun2_00000001.done"
+		"test_/tracecompile_test_exe_00000001.done"
 	])
 	t.run()
 
@@ -162,7 +162,7 @@
 		"test_/armv5/urel/test.o",
 	])
 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
-		"test_/tracecompile_autorun3_00000001.done"
+		"test_/tracecompile_test_exe_00000001.done"
 	])
 	t.run()
 
@@ -183,7 +183,7 @@
 		"test_/armv5/urel/test.o"
 	])
 	t.addbuildantitargets('smoke_suite/test_resources/tracecompiler/TC_autorun/bld.inf', [
-		"test_/tracecompile_autorun1_00000001.done"
+		"test_/tracecompile_test_exe_00000001.done"
 	])
 	t.run()
 
--- a/sbsv2/raptor/test/smoke_suite/tracecompiler_variants.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/tracecompiler_variants.py	Thu May 13 14:14:32 2010 +0100
@@ -42,8 +42,8 @@
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/variant_source/traces/fixed_id.definitions",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/invariant_source_0x10000002_Dictionary.xml",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/variant_source_0x10000003_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/invariant_source_0x10000002_TraceDefinitions.h",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/variant_source_0x10000003_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/invariant_source_0x10000002_TraceDefinitions.h",
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/variant_source_0x10000003_TraceDefinitions.h"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/variant_source/group/bld.inf', [
 		"invariant_source_/armv5/udeb/inv_source.o",
@@ -54,7 +54,7 @@
 		"invariant_source_/winscw/udeb/inv_source.o.d",
 		"invariant_source_/winscw/urel/inv_source.o",
 		"invariant_source_/winscw/urel/inv_source.o.d",
-		"invariant_source_/tracecompile_invariant_source_10000002.done",
+		"invariant_source_/tracecompile_invariant_source_exe_10000002.done",
 		"variant_source_/armv5/udeb/var_source1.o",
 		"variant_source_/armv5/udeb/var_source1.o.d",
 		"variant_source_/armv5/udeb/var_source2.o",
@@ -71,7 +71,7 @@
 		"variant_source_/winscw/urel/var_source1.o.d",
 		"variant_source_/winscw/urel/var_source2.o",
 		"variant_source_/winscw/urel/var_source2.o.d",
-		"variant_source_/tracecompile_variant_source_10000003.done"
+		"variant_source_/tracecompile_variant_source_exe_10000003.done"
 	])
 	t.antitargets = [
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/variant_source/traces/var_source3Traces.h"
@@ -105,8 +105,8 @@
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/variant_source/traces/var_source3Traces.h",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/invariant_source_0x10000002_Dictionary.xml",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/variant_source_0x10000003_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/invariant_source_0x10000002_TraceDefinitions.h",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/variant_source_0x10000003_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/invariant_source_0x10000002_TraceDefinitions.h",
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/variant_source_0x10000003_TraceDefinitions.h"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/variant_source/group/bld.inf', [
 		"invariant_source_/armv5/udeb/inv_source.o",
@@ -117,7 +117,7 @@
 		"invariant_source_/winscw/udeb/inv_source.o.d",
 		"invariant_source_/winscw/urel/inv_source.o",
 		"invariant_source_/winscw/urel/inv_source.o.d",
-		"invariant_source_/tracecompile_invariant_source_10000002.done",
+		"invariant_source_/tracecompile_invariant_source_exe_10000002.done",
 		"variant_source_/armv5/udeb/var_source1.o",
 		"variant_source_/armv5/udeb/var_source1.o.d",
 		"variant_source_/armv5/udeb/var_source3.o",
@@ -134,7 +134,7 @@
 		"variant_source_/winscw/urel/var_source1.o.d",
 		"variant_source_/winscw/urel/var_source3.o",
 		"variant_source_/winscw/urel/var_source3.o.d",
-		"variant_source_/tracecompile_variant_source_10000003.done"
+		"variant_source_/tracecompile_variant_source_exe_10000003.done"
 	])
 	t.run()
 
@@ -159,7 +159,7 @@
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/multiple_variants/traces/tc_bTraces.h",
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/multiple_variants/traces/tc_cTraces.h",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/tc_variants_0x10000004_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/tc_variants_0x10000004_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/tc_variants_0x10000004_TraceDefinitions.h"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/multiple_variants/group/bld.inf', [
 		"tc_variants_/armv5.phone1/udeb/tc_main.o",
@@ -174,7 +174,7 @@
 		"tc_variants_/armv5.phone3/udeb/tc_c.o",
 		"tc_variants_/armv5.phone3/urel/tc_main.o",
 		"tc_variants_/armv5.phone3/urel/tc_c.o",
-		"tc_variants_/tracecompile_tc_variants_10000004.done"
+		"tc_variants_/tracecompile_tc_variants_exe_10000004.done"
 	])	
 	t.run()
 
@@ -195,18 +195,18 @@
 		"$(EPOCROOT)/epoc32/release/armv5/urel/child2.exe",
 		"$(EPOCROOT)/epoc32/release/armv5/udeb/child3.exe",
 		"$(EPOCROOT)/epoc32/release/armv5/urel/child3.exe",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child1_exe/child1Traces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child1_exe/commonTraces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child2_exe/child2Traces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child2_exe/commonTraces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child3_exe/child3Traces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child3_exe/commonTraces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child1_exe/child1Traces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child1_exe/commonTraces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child2_exe/child2Traces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child2_exe/commonTraces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child3_exe/child3Traces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child3_exe/commonTraces.h",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/child1_exe_0x11100001_Dictionary.xml",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/child2_exe_0x11100002_Dictionary.xml",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/child3_exe_0x11100002_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/child1_exe_0x11100001_TraceDefinitions.h",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/child2_exe_0x11100002_TraceDefinitions.h",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/child3_exe_0x11100002_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/child1_exe_0x11100001_TraceDefinitions.h",
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/child2_exe_0x11100002_TraceDefinitions.h",
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/child3_exe_0x11100002_TraceDefinitions.h"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/bld.inf', [
 		"child1_/armv5/udeb/child1.o",
@@ -231,7 +231,7 @@
 	# Clean mmp A then build mmp B and C. As common.cpp is shared by A B and C, commonTraces.h would be 
 	# cleaned when cleaning mmp A. But as B and C aren't cleaned, Raptor wouldn't run trace compiler on
 	# B and C, thus commonTraces.h wouldn't be generated again, so be missing for mmp B and C.
-	# The solution is to use new trace path "traces_<TARGET>_<TARGETTYPE>" instead of "traces" so shared 
+	# The solution is to use new trace path "traces/traces_<TARGET>_<TARGETTYPE>" instead of "traces" so shared 
 	# source has different copy of trace headers for different projects.
 	t = SmokeTest()
 	t.id = "102e"
@@ -247,14 +247,14 @@
 		"$(EPOCROOT)/epoc32/release/armv5/urel/child2.exe",
 		"$(EPOCROOT)/epoc32/release/armv5/udeb/child3.exe",
 		"$(EPOCROOT)/epoc32/release/armv5/urel/child3.exe",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child2_exe/child2Traces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child2_exe/commonTraces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child3_exe/child3Traces.h",
-		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces_child3_exe/commonTraces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child2_exe/child2Traces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child2_exe/commonTraces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child3_exe/child3Traces.h",
+		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/mum_children_mmps/traces/traces_child3_exe/commonTraces.h",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/child2_exe_0x11100002_Dictionary.xml",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/child3_exe_0x11100002_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/child2_exe_0x11100002_TraceDefinitions.h",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/child3_exe_0x11100002_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/child2_exe_0x11100002_TraceDefinitions.h",
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/child3_exe_0x11100002_TraceDefinitions.h"
 		]
 	t.addbuildtargets('smoke_suite/test_resources/tracecompiler/mum_children_mmps/group/bld.inf', [
 		"child2_/armv5/udeb/child2.o",
--- a/sbsv2/raptor/test/smoke_suite/tracecompiler_whatlog.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/tracecompiler_whatlog.py	Thu May 13 14:14:32 2010 +0100
@@ -46,7 +46,7 @@
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/wlanhwinitpermparserTraces.h",	
 		"$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/traces/fixed_id.definitions",
 		"$(EPOCROOT)/epoc32/ost_dictionaries/test_TC_0x1000008d_Dictionary.xml",
-		"$(EPOCROOT)/epoc32/include/internal/symbiantraces/autogen/test_TC_0x1000008d_TraceDefinitions.h"
+		"$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/test_TC_0x1000008d_TraceDefinitions.h"
 		]
 	t.stdout = [
 		"<whatlog bldinf='$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/group/bld2.inf' mmp='$(SBS_HOME)/test/smoke_suite/test_resources/tracecompiler/testTC/group/test.TC.mmp' config='armv5_urel.tracecompiler'>",
@@ -58,9 +58,19 @@
 		"<build>$(EPOCROOT)/epoc32/release/armv5/urel/testTC.dll</build>",
 		"<build>$(EPOCROOT)/epoc32/release/armv5/urel/testTC.dll.map</build>",
 		"<build>$(EPOCROOT)/epoc32/ost_dictionaries/test_TC_0x1000008d_Dictionary.xml</build>",
-		"<build>$(EPOCROOT)/epoc32/include/internal/SymbianTraces/autogen/test_TC_0x1000008d_TraceDefinitions.h</build>"
+		"<build>$(EPOCROOT)/epoc32/include/platform/symbiantraces/autogen/test_TC_0x1000008d_TraceDefinitions.h</build>"
 		]		
-	t.run()
+	t.run("linux")
+	if t.result == CheckWhatSmokeTest.SKIP:
+		t.targets.extend([
+			'$(EPOCROOT)/epoc32/release/armv5/lib/testTC.lib',
+			'$(EPOCROOT)/epoc32/release/armv5/lib/testTC{000a0000}.lib'
+		])
+		t.stdout.extend([
+			'<build>$(EPOCROOT)/epoc32/release/armv5/lib/testTC.lib</build>',
+			'<build>$(EPOCROOT)/epoc32/release/armv5/lib/testTC{000a0000}.lib</build>'
+		])
+		t.run("windows")
 
 	t.id = "112"
 
--- a/sbsv2/raptor/test/smoke_suite/whatlog_cache.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/whatlog_cache.py	Thu May 13 14:14:32 2010 +0100
@@ -42,14 +42,11 @@
 		
 	t.targets = [
 		"$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.mbm",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld.info",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/helloworld.mbm",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.mbm",
 		"$(EPOCROOT)/epoc32/include/helloworld.rsg",
 		"$(EPOCROOT)/epoc32/data/z/resource/apps/helloworld.rsc",
 		"$(EPOCROOT)/epoc32/data/z/private/10003a3f/apps/helloworld_reg.rsc",
-		"$(EPOCROOT)/epoc32/localisation/helloworld/rsc/helloworld.rpp",
-		"$(EPOCROOT)/epoc32/localisation/group/helloworld_reg.info",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/apps/helloworld.rsc",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/apps/helloworld.rsc",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/private/10003a3f/apps/helloworld_reg.rsc",
@@ -64,8 +61,8 @@
 		]
 	t.addbuildtargets('smoke_suite/test_resources/simple_gui/Bld.inf', [
 		"helloworld_exe/helloworld.mbm_bmconvcommands",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp",
-		"helloworld_exe/helloworld__resource_apps_sc.rpp.d",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp",
+		"helloworld_exe/helloworld_HelloWorld_sc.rpp.d",
 		"helloworld_exe/armv5/udeb/HelloWorld_Application.o",
 		"helloworld_exe/armv5/udeb/HelloWorld_Application.o.d",
 		"helloworld_exe/armv5/udeb/HelloWorld_AppUi.o",
@@ -126,7 +123,7 @@
 		"helloworld_exe/winscw/urel/helloworld_UID_.dep",
 		"helloworld_exe/winscw/urel/helloworld_UID_.o",
 		"helloworld_exe/winscw/urel/helloworld_UID_.o.d",
-		"helloworld_reg_exe/helloworld_reg__private_10003a3f_apps_sc.rpp.d"
+		"helloworld_reg_exe/helloworld_reg_HelloWorld_reg_sc.rpp.d"
 	])
 	t.countmatch = [
 		["\$self->{abldcache}->{.*\\\\test\\\\smoke_suite\\\\test_resources\\\\simple_gui target (armv5|winscw) (udeb|urel) -what\'} =", 4],
@@ -134,10 +131,6 @@
 		[".*\'.*\\\\\\\\epoc32\\\\\\\\data\\\\\\\\z\\\\\\\\resource\\\\\\\\apps\\\\\\\\helloworld.mbm\'", 4],
 		[".*\'.*\\\\\\\\epoc32\\\\\\\\data\\\\\\\\z\\\\\\\\resource\\\\\\\\apps\\\\\\\\helloworld.rsc\'", 4],
 		[".*\'.*\\\\\\\\epoc32\\\\\\\\include\\\\\\\\helloworld.rsg\'", 4],
-		[".*\'.*\\\\\\\\epoc32\\\\\\\\localisation\\\\\\\\group\\\\\\\\helloworld.info\'", 4],
-		[".*\'.*\\\\\\\\epoc32\\\\\\\\localisation\\\\\\\\group\\\\\\\\helloworld_reg.info\'", 4],
-		[".*\'.*\\\\\\\\epoc32\\\\\\\\localisation\\\\\\\\helloworld\\\\\\\\rsc\\\\\\\\helloworld.rpp\'", 4],
-		[".*\'.*\\\\\\\\epoc32\\\\\\\\localisation\\\\\\\\helloworld_reg\\\\\\\\rsc\\\\\\\\helloworld_reg.rpp\'", 4],
 		[".*\'.*\\\\\\\\epoc32\\\\\\\\release\\\\\\\\(armv5|winscw)\\\\\\\\(udeb|urel)\\\\\\\\helloworld.exe\'",4],
 		[".*\'.*\\\\\\\\epoc32\\\\\\\\release\\\\\\\\(armv5|winscw)\\\\\\\\(udeb|urel)\\\\\\\\helloworld.exe.map\'", 3],
 		[".*\'.*\\\\\\\\epoc32\\\\\\\\release\\\\\\\\winscw\\\\\\\\(udeb|urel)\\\\\\\\z\\\\\\\\private\\\\\\\\10003a3f\\\\\\\\apps\\\\\\\\helloworld_reg.rsc\'", 2],
--- a/sbsv2/raptor/test/smoke_suite/winscw_resource.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/smoke_suite/winscw_resource.py	Thu May 13 14:14:32 2010 +0100
@@ -30,9 +30,7 @@
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/testresource/testresource.r01",
 		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/testresource/testresource.r01",
 		"$(EPOCROOT)/epoc32/release/winscw/udeb/z/resource/testresource/testresource.rsc",
-		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/testresource/testresource.rsc",
-		"$(EPOCROOT)/epoc32/localisation/group/testresource.info",
-		"$(EPOCROOT)/epoc32/localisation/testresource/rsc/testresource.rpp"
+		"$(EPOCROOT)/epoc32/release/winscw/urel/z/resource/testresource/testresource.rsc"
 		]
 	t.run()
 	return t
--- a/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/unit_suite/raptor_meta_unit.py	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -569,7 +569,49 @@
 							'STDVAR_TO_BLDINF':bldInfMakefilePathTestRoot,
 							'STDVAR_EXTENSION_ROOT':bldInfMakefilePathTestRoot}		
 							)
+	
+	def testBadBldInfs(self):
+		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs')
+		depfiles=[]
 		
+		class BadBldInfLogger(object):
+			"mock logger to capture Error messages from the parser."
+			
+			def __init__(self):
+				self.errors = []
+				self.debugOutput = False
+				
+			def Error(self, format, *extras, **attributes):
+				self.errors.append( ((format % extras), attributes) )
+		
+			def Debug(self, format, *extras, **attributes):
+				pass
+				
+		logger = BadBldInfLogger()
+		
+		# this bld.inf has END lines with no matching START
+		bldInfObject = raptor_meta.BldInfFile(bldInfTestRoot.Append('bad_lone_end.inf'),
+											  self.__gnucpp, depfiles=depfiles, 
+											  log=logger)
+		
+		# the PRJ_EXTENSIONS section is bad for ARMV5
+		extensions = bldInfObject.getExtensions(self.ARMV5)
+		#
+		self.assertEquals(len(logger.errors), 1)
+		err = logger.errors[0]
+		self.assertEquals(err[0], "unmatched END statement in PRJ_EXTENSIONS section")
+		self.assertTrue("bldinf" in err[1])
+		self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
+		
+		# the PRJ_TESTEXTENSIONS section is bad for WINSCW
+		testextensions = bldInfObject.getTestExtensions(self.WINSCW)
+		#
+		self.assertEquals(len(logger.errors), 2)
+		err = logger.errors[1]
+		self.assertEquals(err[0], "unmatched END statement in PRJ_TESTEXTENSIONS section")
+		self.assertTrue("bldinf" in err[1])
+		self.assertTrue(err[1]["bldinf"].endswith("bad_lone_end.inf"))
+			
 	def testBldInfIncludes(self):
 		bldInfTestRoot = self.__testRoot.Append('metadata/project/bld.infs/includes')
 		depfiles=[]
--- a/sbsv2/raptor/test/unit_suite/raptor_xml_unit.py	Tue May 04 14:01:37 2010 +0100
+++ b/sbsv2/raptor/test/unit_suite/raptor_xml_unit.py	Thu May 13 14:14:32 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of the License "Eclipse Public License v1.0"
@@ -17,15 +17,34 @@
 #
 
 import os
+import generic_path
 import raptor
-import generic_path
 import raptor_xml
 import unittest
 
 class TestRaptorXML(unittest.TestCase):
+		
+	class Logger(object):
+		# Basic custom logger class to store errors (and only errors) for test checks
+
+		def __init__(self):	
+			self.errors = []
+					
+		def Error(self, format, *extras, **attributes):
+			self.errors.append(format % extras)
+
+		def Info(self, format, *extras, **attributes):
+			return
+			
+		def InfoDiscovery(self, object_type, count):
+			return
+		
+		def Clear(self):
+			del self.errors[:]
+			
 	
 	def setUp(self):
-		self.__logger = raptor.Raptor()
+		self.__logger = TestRaptorXML.Logger()
 		self.__nullSysDefRoot = generic_path.Path("smoke_suite/test_resources")
 		self.__sysDefRoot = generic_path.Join(os.environ[raptor.env],"test/smoke_suite/test_resources")
 		self.__sysDefFileRoot = generic_path.Join(os.environ[raptor.env], "test/metadata/system")
@@ -64,8 +83,11 @@
 		systemModel = raptor_xml.SystemModel(self.__logger, generic_path.Join(self.__sysDefFileRoot, "system_definition_3.0.0.xml"), self.__sysDefRoot)
 		self.__compareFileLists([], systemModel.GetAllComponents())
 				
-		
+		self.__logger.Clear()
 		systemModel = raptor_xml.SystemModel(self.__logger, generic_path.Join(self.__sysDefFileRoot, "system_definition_multi_layers.xml"), self.__sysDefRoot)
+		self.assertTrue(len(self.__logger.errors) == 0)
+
+		# Confirm components returned from layers are correct
 
 		expectedBldInfs = [ generic_path.Join(self.__sysDefRoot, "simple/bld.inf"),\
 							generic_path.Join(self.__sysDefRoot, "simple_dll/bld.inf"),\
@@ -74,7 +96,8 @@
 						    generic_path.Join(self.__sysDefRoot, "simple_implib/bld.inf"),\
 						    generic_path.Join(self.__sysDefRoot, "simple_lib/bld.inf"),\
 						    generic_path.Join(self.__sysDefRoot, "simple_stringtable/bld.inf"),\
-						    generic_path.Join(self.__sysDefRoot, "simple_test/bld.inf")]
+						    generic_path.Join(self.__sysDefRoot, "simple_test/bld.inf"),\
+						    generic_path.Join(self.__sysDefRoot, "simple_plugin/bld.inf")]
 		self.__compareFileLists(expectedBldInfs, systemModel.GetAllComponents())
 	
 		expectedBldInfs = [ generic_path.Join(self.__sysDefRoot, "simple_export/bld.inf"),\
@@ -85,6 +108,23 @@
 				
 		self.__compareFileLists([], systemModel.GetLayerComponents("Sixth Layer"))
 		
+		# Check that the overall "buildability" of layers is returned correctly
+		# Note that a layer is still buildable if some bld.infs in it are missing as long as at least 1 exists
+		# However, errors should always be generated for missing bld.infs when a layer is checked
+		
+		self.assertTrue(systemModel.IsLayerBuildable("First Layer"))		
+		self.assertFalse(systemModel.IsLayerBuildable("Sixth Layer"))
+		
+		self.__logger.Clear()
+		self.assertTrue(systemModel.IsLayerBuildable("Seventh Layer"))
+		self.assertTrue(len(self.__logger.errors) == 1)
+		sbsHome = os.environ["SBS_HOME"]
+		sysDefPath = sbsHome + "/test/metadata/system/system_definition_multi_layers.xml"
+		sysDefPath = sysDefPath.replace("\\","/")
+		bldInfPath = sbsHome + "/test/smoke_suite/test_resources/does_not_existbld.inf"
+		bldInfPath = bldInfPath.replace("\\","/")
+		self.assertEquals(self.__logger.errors[0],
+		  ("System Definition layer \"Seventh Layer\" from system definition file \"%s\" refers to non existent bld.inf file %s" % (sysDefPath, bldInfPath)))
 				
 		# Probably redundant, but return local environment (at least its dictionary) to pre-test state
 		os.environ["SOURCEROOT"] = sourceroot