Author: nickboldt
Date: 2012-01-16 14:51:41 -0500 (Mon, 16 Jan 2012)
New Revision: 37875
Added:
trunk/build/aggregate/site.properties.xsl
Modified:
trunk/build/aggregate/build.xml
Log:
add method to generate site.properties file from site.xml via new xslt (JBIDE-10640)
Modified: trunk/build/aggregate/build.xml
===================================================================
--- trunk/build/aggregate/build.xml 2012-01-16 19:39:35 UTC (rev 37874)
+++ trunk/build/aggregate/build.xml 2012-01-16 19:51:41 UTC (rev 37875)
@@ -2,6 +2,9 @@
<!--
To test output, run maven in this folder:
$ mvn install -DJOB_NAME=jbosstools-3.3_trunk.aggregate -DBUILD_ID=2011-09-19_19-10-45
-DBUILD_NUMBER=6969 -DJBT_VERSION=3.3.99 -DBUILD_ALIAS=M7
-Dupdate.site.description="Stable Milestone"
+
+ Or, to run just the ant script:
+ $ cd ~/tru/build/aggregate/webtools-site; ant basic.build -f ../build.xml
-Doutput.dir=`pwd`
-->
<!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here.
-->
@@ -42,7 +45,7 @@
</condition>
<property file="${associate.properties}" />
<echo level="verbose">Loaded associate sites from
${associate.properties}</echo>
- <property name="web.content.files" value="index.html, web/*.css,
README*, *directory.xml" />
+ <property name="web.content.files" value="index.html, web/*.css,
README*, *directory.xml, site.*" />
<target name="init">
<ant antfile="${build.xml}" target="init" />
@@ -555,6 +558,13 @@
<loadfile property="site.contents"
srcfile="${update.site.source.dir}/site.html" failonerror="false"
/>
<property name="site.contents" value="" />
<delete file="${update.site.source.dir}/site.html" quiet="true"
/>
+
+ <!-- turn site.xml into site.properties -->
+ <delete quiet="true"
file="${update.site.source.dir}/site.properties" />
+ <xslt style="site.properties.xsl"
in="${update.site.source.dir}/site.xml"
out="${update.site.source.dir}/site.properties" force="true">
+ <classpath location="${COMMON_TOOLS}/saxon.jar" />
+ </xslt>
+
</target>
<!-- look for
http://download.jboss.org/jbosstools/builds/staging/jbosstools-3.*/logs/z...;
Added: trunk/build/aggregate/site.properties.xsl
===================================================================
--- trunk/build/aggregate/site.properties.xsl (rev 0)
+++ trunk/build/aggregate/site.properties.xsl 2012-01-16 19:51:41 UTC (rev 37875)
@@ -0,0 +1,20 @@
+<xsl:stylesheet version="2.0"
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
+
xmlns:saxon="http://saxon.sf.net/"
xmlns="http://www.w3.org/1999/xhtml"
+ extension-element-prefixes="saxon">
+ <xsl:output method="text" indent="yes" />
+ <xsl:template match="/site">
+ <xsl:for-each select="category-def">
+ <xsl:sort select="@name" />
+ <xsl:variable name="catg"><xsl:value-of
select="@name"/></xsl:variable>
+#
+<xsl:value-of select="$catg" /> = \
+<xsl:for-each select="//feature">
+ <xsl:sort select="@id" />
+ <xsl:if
test="count(./category[contains(@name,$catg)])>0"><xsl:value-of
select="@id" />,
+</xsl:if>
+ </xsl:for-each>
+ </xsl:for-each>
+#
+ </xsl:template>
+</xsl:stylesheet>