Add verbatim functionality to filtering so it can perform chassis builds. Add ProductsDefinition file for defining exports.
authorBob Rosenberg <bob.rosenberg@nokia.com>
Tue, 03 Aug 2010 12:14:54 +0100
changeset 634 f7179968fc36
parent 624 f70b728ea30c
child 635 945d232265c4
Add verbatim functionality to filtering so it can perform chassis builds. Add ProductsDefinition file for defining exports.
metatools/sysdeftools/filtering.xsl
metatools/sysdeftools/group/contents.xml
metatools/sysdeftools/group/perl.bat
metatools/sysdeftools/group/unixxslcmd.bat
metatools/sysdeftools/group/unixxsltccmd.bat
--- a/metatools/sysdeftools/filtering.xsl	Wed Jul 28 13:20:46 2010 +0100
+++ b/metatools/sysdeftools/filtering.xsl	Tue Aug 03 12:14:54 2010 +0100
@@ -16,28 +16,65 @@
 	The filtering concepts here may not be carried forward in future system definition processing tools
 -->
 <!--Description:This filters a sysdef in either the 2.0 or 3.0 syntax
+If using the 3.0 syntax, specific IDs optionally be included verbatim
 -->
 
-<!--Input:<sysdef> - (required) The system definition XML file to process. Can be in the 2.0 or 3.0 format, and can be a fragment or stand-alone.-->
-<!--Output:<sysdef> - (optional) The system definition XML file to save the output as. If not present it will write to stdout.-->
-
-
+<!--Input:<sysdef> - (required) The system definition XML file to process.
+		Can be in the 2.0 or 3.0 format, and can be a fragment or
+		stand-alone.-->
+<!--Output:<sysdef> - (optional) The system definition XML file to save the
+		output as. If not present it will write to stdout.-->
 
 <xsl:output method="xml" indent="yes"/>
 
 <xsl:param name="filter-type">only</xsl:param>
 <!-- <type> - The method of filtering. Legal values are:
-		"only" = every component/unit can only have zero or more of these specified filters. ie, it can only have filters from this list, no other filters are allowed. This covers the common use case of "I want anything with gt and or techview, but no other filters" that was the first step in all old symbian.com builds. 
+		"only" = every component/unit can only have zero or more of
+			these specified filters. ie, it can only have filters
+			from this list, no other filters are allowed. This
+			covers the common use case of "I want anything with gt
+			and or techview, but no other filters" that was the
+			first step in all old symbian.com builds. 
 
-		"has" =  every component/unit must have all of these filters. ie it can have any other filters, but all specified filters must all be present. This covers the case where filter="test" identifies tests and there is no special filter to identify things that are not tests. So a filter for "!test" will strip out anything with filter="test" (plus any other filters) for a production build, and a filter of "test" will strip out everything that does not have filter="test" (plus any other filters) for a test build. Opposite filters will generate sets that are exactly opposite to each other.
+		"has" =  every component/unit must have all of these filters.
+			ie it can have any other filters, but all specified
+			filters must all be present. This covers the case where
+			filter="test" identifies tests and there is no special
+			filter to identify things that are not tests. So a
+			filter for "!test" will strip out anything with
+			filter="test" (plus any other filters) for a production
+			build, and a filter of "test" will strip out everything
+			that does not have filter="test" (plus any other
+			filters) for a test build. Opposite filters will
+			generate sets that are exactly opposite to each other.
 
-		"with" =  components/units that have the opposite filter are removed. This covers the old symbian.com case of java, !java and "don't care" components. In other words we have a global feature that every item can be built only when the feature is set, only when the feature is not set, or it does not care and will always be built. So for a !java build only items containing filter="java" are stripped out. For a java build, only items with filter="!java" are stripped out. Anything which does not explicitly mention java are always unaffected. Opposite filters will generate sets which overlap.
+		"with" =  components/units that have the opposite filter are
+			removed. This covers the old symbian.com case of
+			java, !java and "don't care" components. In other words
+			we have a global feature that every item can be built
+			only when the feature is set, only when the feature is
+			not set, or it does not care and will always be built.
+			So for a !java build only items containing filter="java"
+			are stripped out. For a java build, only items with
+			filter="!java" are stripped out. Anything which does not
+			explicitly mention java are always unaffected. Opposite
+			filters will generate sets which overlap.
 -->
 
 
-<xsl:param name="filter"/> <!-- <list> - (required) A comma-separated list of filters used to process the sysdef.-->
+<xsl:param name="filter"/> <!-- <list> - (required) A comma-separated list of filters
+		used to process the sysdef.-->
+
+<xsl:param name="addbuild" select="0"/> <!--1 - (optional) If present, it will add a system build
+		section that accepts everything. This is needed for genxml
+		processing -->
 
-<xsl:param name="addbuild" select="0"/> <!--1 - (optional) If present, it will add a system build section that accepts everything. This is needed for genxml processing -->
+<xsl:param name="verbatim"/> <!-- <list> - (optional) A comma-separated list of system
+		model IDs to include unfiltered. IDs must take the form as in
+		the document they appear (ie using the same namespace prefix).
+		This does not work on 2.0 syntax sysdefs. -->
+
+<xsl:variable name="ID-list" select="concat(',',translate(normalize-space($verbatim),' ',''),',')"/> <!-- remove all spaces from $idlist and add surrounding commas for easier processing-->
 
 <xsl:template match="node()|@*"><xsl:copy-of select="."/></xsl:template>
 <xsl:template match="*"><xsl:param name="data"/>
@@ -55,8 +92,8 @@
 			<xsl:with-param name="item" select="current()"/>
 		</xsl:apply-templates>
 	 </xsl:variable>
-	 
-	 <xsl:if test="$display != 'hide' "> <!-- if hide, remove completely from the output-->
+	 <xsl:if test="$display != 'hide' or ($verbatim != '' and ancestor-or-self::*[contains($ID-list,concat(',',@id,','))])"> 
+		<!-- if 'hide', remove completely from the output, but always include any ID listed as a $ID-list item-->
 		<xsl:copy>
 			<xsl:copy-of select="@*"/>
 			<xsl:apply-templates select="node()">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/metatools/sysdeftools/group/contents.xml	Tue Aug 03 12:14:54 2010 +0100
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ProductsDefinition schema="3.0.0">
+	<product name="BuildEnvironment" long-name="Build Environment">
+		<tool name="sysdeftools" long-name="System Definition Tools" default-src="sftools/build/metatools/sysdeftools" default-dst="/" version="1.0.0.0">
+
+			<!-- core functionality -->
+			<file filename="*.pl"/> 
+			<file filename="*.xsl"/> 
+
+				<!-- reusable modules and internal utilities -->
+		  <file filename="*.xsl" src="sftools/build/metatools/sysdeftools/lib/" dst="lib/"/> 
+
+				<!-- Xalan jar files -->
+		  <file filename="*" src="sftools/build/metatools/sysdeftools/xalanj/" dst="xalanj/"/> 
+
+			<windows>
+			  <file filename="perl.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/checklinks.bat"/> 
+			  <file filename="perl.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/joinsysdef.bat"/> 
+			  <file filename="perl.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/rootsysdef.bat"/> 
+
+				<!-- Xalan-calling .bat files -->
+			  <file filename="unixxslcmd.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/joinandparesysdef.bat"/> 
+			  <file filename="unixxslcmd.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/filtering.bat"/> 
+			  <file filename="unixxslcmd.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/validate-sysdef.bat"/> 
+
+				<!-- Xalan-calling .bat files that use XSLTC -->
+			  <file filename="unixxsltccmd.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/mergesysdef.bat"/> 
+			  <file filename="unixxsltccmd.bat" src="sftools/build/metatools/sysdeftools/group/" dstFile="/sysdefdowngrade.bat"/> 
+			</windows>
+		
+			<linux>
+				<!-- Xalan-calling unix files -->
+			  <file filename="unixxslcmd" src="sftools/build/metatools/sysdeftools/group/" dstFile="/joinandparesysdef"/> 
+			  <file filename="unixxslcmd" src="sftools/build/metatools/sysdeftools/group/" dstFile="/filtering"/> 
+			  <file filename="unixxslcmd" src="sftools/build/metatools/sysdeftools/group/" dstFile="/validate-sysdef"/> 
+
+				<!-- Xalan-calling unix files that use XSLTC -->
+			  <file filename="unixxsltccmd" src="sftools/build/metatools/sysdeftools/group/" dstFile="/mergesysdef"/> 
+			  <file filename="unixxsltccmd" src="sftools/build/metatools/sysdeftools/group/" dstFile="/sysdefdowngrade"/> 
+			</linux>
+		</tool>
+	</product>
+</ProductsDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/metatools/sysdeftools/group/perl.bat	Tue Aug 03 12:14:54 2010 +0100
@@ -0,0 +1,17 @@
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@setlocal
+@perl %~dpn0.pl %*
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/metatools/sysdeftools/group/unixxslcmd.bat	Tue Aug 03 12:14:54 2010 +0100
@@ -0,0 +1,21 @@
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@setlocal
+@if .%1==. goto use
+@ java -jar %~dp0xalanj\xalan.jar -xsl %~dpn0.xsl %* 
+@goto end
+:use
+@ java -jar %~dp0xalanj\xalan.jar -in %~dpn0.xsl -xsl %~dp0lib\usage.xsl -param usage "%~n0"
+:end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/metatools/sysdeftools/group/unixxsltccmd.bat	Tue Aug 03 12:14:54 2010 +0100
@@ -0,0 +1,21 @@
+@rem Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+@rem All rights reserved.
+@rem This component and the accompanying materials are made available
+@rem under the terms of the License "Eclipse Public License v1.0"
+@rem which accompanies this distribution, and is available
+@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+@rem
+@rem Initial Contributors:
+@rem Nokia Corporation - initial contribution.
+@rem
+@rem Contributors:
+@rem
+@rem Description: 
+@rem
+@setlocal
+@if .%1==. goto use
+@ java -jar %~dp0xalanj\xalan.jar -xsl %~dpn0.xsl %*  -XSLTC
+@goto end
+:use
+@ java -jar %~dp0xalanj\xalan.jar -in %~dpn0.xsl -xsl %~dp0lib\usage.xsl -param usage "%~n0"
+:end