Author: nickboldt
Date: 2011-05-29 01:43:25 -0400 (Sun, 29 May 2011)
New Revision: 31606
Modified:
branches/jbosstools-3.2.x/build/results/.gitignore
branches/jbosstools-3.2.x/build/results/build.xml
branches/jbosstools-3.2.x/build/results/buildResults.xsl
Log:
enable new results page builder (
https://issues.jboss.org/browse/JBIDE-7444)
Modified: branches/jbosstools-3.2.x/build/results/.gitignore
===================================================================
--- branches/jbosstools-3.2.x/build/results/.gitignore 2011-05-29 05:43:12 UTC (rev
31605)
+++ branches/jbosstools-3.2.x/build/results/.gitignore 2011-05-29 05:43:25 UTC (rev
31606)
@@ -1 +1,2 @@
*.out.*
+zips
Modified: branches/jbosstools-3.2.x/build/results/build.xml
===================================================================
--- branches/jbosstools-3.2.x/build/results/build.xml 2011-05-29 05:43:12 UTC (rev 31605)
+++ branches/jbosstools-3.2.x/build/results/build.xml 2011-05-29 05:43:25 UTC (rev 31606)
@@ -1,4 +1,4 @@
-<project default="build.results">
+<project default="buildResults.aggregate">
<!-- should be set by script or in Hudson -->
<property name="ZIPSUFFIX" value="SNAPSHOT" />
@@ -7,7 +7,6 @@
<!-- <property name="JOB_NAME"
value="jbosstools-3.2.0.M2.continuous" /> -->
<!-- if a different template file (eg., a partially expanded one) should be used,
feed it in here -->
- <property name="template.file" value="download-template.xml"
/>
<!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here.
-->
<condition property="output.dir" value="${WORKSPACE}/results"
else="${basedir}">
@@ -46,9 +45,27 @@
</condition>
<!-- if can't calculate where build/build.xml is located, must pass in path from
parent when calling this script -->
+ <target name="get.saxon" unless="saxon.jar.exists">
+ <!-- or use
http://downloads.sourceforge.net/saxon/saxonhe9-3-0-4j.zip ? -->
+ <property name="SAXON_MIRROR"
value="http://downloads.sourceforge.net/project/saxon/Saxon-HE/9.3/s...
/>
+ <get usetimestamp="true"
dest="${COMMON_TOOLS}/saxonhe9-3-0-4j.zip" src="${SAXON_MIRROR}"
/>
+ <mkdir dir="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_" />
+ <unzip src="${COMMON_TOOLS}/saxonhe9-3-0-4j.zip"
dest="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_" overwrite="true" />
+ <copy file="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_/saxon9he.jar"
tofile="${COMMON_TOOLS}/saxon.jar" failonerror="true" />
+ <delete dir="${java.io.tmpdir}/saxonhe9-3-0-4j.zip_"
includeemptydirs="true" quiet="true" />
+ </target>
+
<target name="init">
<ant antfile="${build.xml}" target="init" />
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
+ </classpath>
+ </taskdef>
+ <available file="${COMMON_TOOLS}/saxon.jar" type="file"
property="saxon.jar.exists" />
+ <antcall target="get.saxon" />
+
<macrodef name="get.size">
<attribute name="file" />
<attribute name="property" />
@@ -82,144 +99,46 @@
</if>
</sequential>
</macrodef>
- <taskdef resource="net/sf/antcontrib/antlib.xml">
- <classpath>
- <pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
- </classpath>
- </taskdef>
</target>
- <target name="build.results" depends="init">
- <!--
- 1. resolve variables in download-template.xml to produce download.xml
- 2. XSL transform download.xml to produce download-snippet.html
- 3. manually copy the contents of this file into a page under
-
http://www.jboss.org/tools/downloads/
- -->
- <echo level="info">ZIPSUFFIX = ${ZIPSUFFIX}
-WORKINGDIR = ${WORKINGDIR}
-COMMON_TOOLS = ${COMMON_TOOLS}
-input.dir = ${input.dir}
-output.dir = ${output.dir}</echo>
- <for param="UPDATEZIP">
- <path>
- <fileset dir="${input.dir}">
- <include name="**/*-Update-${ZIPSUFFIX}.zip" />
- <include name="**/*-Sources-${ZIPSUFFIX}.zip" />
- </fileset>
- </path>
- <sequential>
- <var name="filename" unset="true" />
- <propertyregex property="filename" input="@{UPDATEZIP}"
defaultvalue="@{UPDATEZIP}" regexp=".+/([^/]+\.zip)"
replace="\1" casesensitive="false" override="true" />
- <propertyregex property="COMPONENT" input="${filename}"
defaultvalue="${filename}"
regexp="(.+)-(Update|Sources)-${ZIPSUFFIX}\.zip" replace="\1"
casesensitive="false" override="true" />
- <if>
- <and>
- <isset property="JOB_NAME" />
- <equals arg1="${COMPONENT}" arg2="${JOB_NAME}" />
- </and>
- <then>
- <if>
- <!-- only set the update variable if it's NOT coming from the aggregate
build -->
- <and>
- <equals arg1="${filename}"
arg2="${JOB_NAME}-Sources-${ZIPSUFFIX}.zip" />
- <not>
- <contains string="${JOB_NAME}" substring="aggregate"
/>
- </not>
- </and>
- <then>
- <var name="COMPONENT" unset="true" />
- <var name="COMPONENT" value="sources" />
- </then>
- <elseif>
- <!-- only set the update variable if it's coming from the aggregate build;
others should be ignored -->
- <and>
- <equals arg1="${filename}"
arg2="${JOB_NAME}-Update-${ZIPSUFFIX}.zip" />
- <contains string="${JOB_NAME}" substring="aggregate"
/>
- </and>
- <then>
- <var name="COMPONENT" unset="true" />
- <var name="COMPONENT" value="update" />
- </then>
- </elseif>
- </if>
- </then>
- </if>
+ <!-- NEW STUFF HERE -->
- <echo level="verbose">UPDATEZIP = @{UPDATEZIP}
-COMPONENT = ${COMPONENT}</echo>
- <property name="${COMPONENT}-filename" value="${filename}"
/>
+ <target name="buildResults.aggregate" depends="init"
description="generate buildResults.html from build properties">
+ <ant target="collect.zips"
antfile="../aggregate/site/build.xml">
+ <property name="inputRepos" value="1" />
+ <property name="inputRepo1"
value="http://download.jboss.org/jbosstools/builds/staging/_composit...
/>
+ </ant>
+ <ant target="collect.metadata"
antfile="../aggregate/site/build.xml">
+ </ant>
+ <antcall target="buildResults" />
+ </target>
+ <target name="test.buildResults.aggregate" depends="init"
description="generate buildResults.html from build properties">
+ <property name="isTest" value="true" />
+ <ant target="collect.zips"
antfile="../aggregate/site/build.xml">
+ <property name="inputRepos" value="1" />
+ <property name="inputRepo1"
value="http://download.jboss.org/jbosstools/builds/staging/_composit...
/>
+ </ant>
+ <ant target="collect.metadata"
antfile="../aggregate/site/build.xml">
+ </ant>
+ <antcall target="buildResults" />
+ </target>
- <get.size file="@{UPDATEZIP}" property="${COMPONENT}-filesize"
/>
- <var name="filesize" unset="true" />
- <propertycopy from="${COMPONENT}-filesize" property="filesize"
override="true" silent="true" />
- <echo level="info">filesize = ${filesize}</echo>
- <echo level="info">filename = ${filename}</echo>
- <var name="filesize" unset="true" />
- <var name="filename" unset="true" />
- </sequential>
- </for>
-
- <if>
- <!-- default operation from template file -->
- <equals arg1="${template.file}" arg2="download-template.xml"
/>
- <then>
- <copy todir="${output.dir}" overwrite="true">
- <fileset dir="${output.dir}" file="${template.file}" />
- <mapper type="merge" to="download.xml" />
- <filterchain>
- <expandproperties />
- </filterchain>
- </copy>
- <xslt in="${output.dir}/download.xml"
out="${output.dir}/download-snippet.html" style="download.xsl" />
- <xslt in="${output.dir}/download.xml"
out="${output.dir}/buildResults.html" style="buildResults.xsl" />
- <copy todir="${output.dir}" file="buildResults.css"/>
- <delete file="${output.dir}/download.xml" />
- </then>
- <elseif>
- <!-- use previously XLST'd file from an upstream build -->
- <or>
- <contains string="${template.file}" substring="http:" />
- <contains string="${template.file}" substring="https:" />
- <contains string="${template.file}" substring="ftp:" />
- </or>
- <then>
- <propertyregex property="template.file.cleaned"
input="${template.file}" defaultvalue="${template.file}"
regexp=".+/([^/]+)" replace="\1" override="true" />
- <get src="${template.file}"
dest="${output.dir}/${template.file.cleaned}.in" ignoreerrors="true"
/>
- <if>
- <available file="${output.dir}/${template.file.cleaned}.in"
type="file" />
- <then>
- <!-- use pre-existing snippet file -->
- <copy todir="${output.dir}" overwrite="true">
- <fileset dir="${output.dir}"
file="${template.file.cleaned}.in" />
- <mapper type="merge" to="download-snippet.html" />
- <filterchain>
- <expandproperties />
- </filterchain>
- </copy>
- <delete file="${output.dir}/${template.file.cleaned}.in"
quiet="true" />
- </then>
- <else>
- <!-- fall back to default template file -->
- <var name="template.file" value="download-template.xml"
/>
- <copy todir="${output.dir}" overwrite="true">
- <fileset dir="${output.dir}" file="${template.file}"
/>
- <mapper type="merge" to="download.xml" />
- <filterchain>
- <expandproperties />
- </filterchain>
- </copy>
- <xslt in="${output.dir}/download.xml"
out="${output.dir}/download-snippet.html" style="download.xsl" />
- <delete file="${output.dir}/download.xml" />
- </else>
- </if>
- </then>
- </elseif>
- </if>
+ <target name="test.buildResults.single" depends="init"
description="generate buildResults.html from build properties">
+ <property name="isTest" value="true" />
+ <ant target="collect.zips"
antfile="../aggregate/site/build.xml">
+ <property name="inputRepos" value="1" />
+ <property name="inputRepo1"
value="http://download.jboss.org/jbosstools/builds/staging/jbosstool...
/>
+ </ant>
+ <ant target="collect.metadata"
antfile="../aggregate/site/build.xml">
+ </ant>
+ <antcall target="buildResults" />
</target>
- <target name="test.xslt">
- <xslt in="download-template.xml" out="download-snippet.out.html"
style="download.xsl" />
- <xslt in="download-template.xml" out="buildResults.out.html"
style="buildResults.xsl" />
+ <target name="buildResults" description="generate buildResults.html
from build properties" depends="init">
+ <delete quiet="true" file="buildResults.out.html" />
+ <xslt in="zips/build.properties.all.xml"
out="buildResults.out.html" style="buildResults.xsl"
force="true">
+ <classpath location="${COMMON_TOOLS}/saxon.jar" />
+ </xslt>
</target>
</project>
Modified: branches/jbosstools-3.2.x/build/results/buildResults.xsl
===================================================================
--- branches/jbosstools-3.2.x/build/results/buildResults.xsl 2011-05-29 05:43:12 UTC (rev
31605)
+++ branches/jbosstools-3.2.x/build/results/buildResults.xsl 2011-05-29 05:43:25 UTC (rev
31606)
@@ -1,12 +1,8 @@
-<xsl:transform version="1.0"
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan">
- <xsl:output method="html" indent="yes"
xalan:indent-amount="4" />
- <xsl:template match="/projects">
-
- <xsl:variable name="baseurl">
- <xsl:value-of select="@baseurl" />
- </xsl:variable>
-
+<xsl:stylesheet version="2.0"
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
+
xmlns="http://www.w3.org/1999/xhtml"
extension-element-prefixes="saxon">
+ <xsl:output method="html" indent="yes" />
+ <xsl:template match="/properties">
<html>
<head>
<title>JBossTools Build Results</title>
@@ -15,37 +11,6 @@
<body>
<div id="header-blue">
<table width="100%" height="100%">
- <tr>
- <td>
- <span id="title-blue">JBossTools Build Results</span>
- <br />
- <span id="buildName-blue">
- ${build-type} build
- ${jbds-build-name}
- <span id="buildName-blue" style="font-size:
x-small;">
- [Hudson Build
- <a id="buildName-blue" style="font-size: x-small;"
-
href="http://hudson.qa.jboss.com/hudson/view/DevStudio/job/${hudson-...,
- ${hudson-build-id}</a>
- ]
- </span>
- <span id="buildName-blue" style="font-size: x-small;
font-style: italic;">
- <a id="buildName-blue"
- style="font-size: x-small; font-style: italic; color: black;"
-
href="http://hudson.jboss.org/hudson/view/JBossTools/job/${hudson-jo...
- Hudson Mirror</a>
- </span>
- </span>
- </td>
- <td align="right">
- <span id="buildDate-blue">${date}</span>
- <br />
- <span id="buildExecTime-blue">${build-time}</span>
- <br />
- <a id="buildLog-blue"
-
href="http://download.jboss.org/jbosstools/builds/staging/${hudson-j...
Logs</a>
- </td>
- </tr>
</table>
</div>
@@ -106,43 +71,141 @@
</td>
</tr>
- <xsl:for-each select="project">
- <xsl:variable name="rowColor">
- <xsl:if test="position() mod 2 = 1">
- #CCCCEE
- </xsl:if>
- <xsl:if test="position() mod 2 = 0">
- #FFFFFF
- </xsl:if>
- <xsl:if test="contains(@name,'All')">
- #CCEECC
- </xsl:if>
- <xsl:if test="contains(@name,'Source')">
- #EECCCC
- </xsl:if>
+ <!-- three use cases: a regular component build (as, ws, etc.), a
+ different-SVN component build (teiid, pi4soa, savara), and a special component
+ build (xulrunner) -->
+ <xsl:for-each
+ select="//property[contains((a)name,'build.properties.JOB_NAME')]">
+ <xsl:variable name="JOB_NAME">
+ <xsl:value-of select="@value" />
</xsl:variable>
+ <xsl:variable name="COMPONENT">
+ <xsl:choose>
+ <!-- property name="jbosstools-3.2_stable_branch.component-
-ws-SNAPSHOT.build.properties.JOB_NAME"
+ value="jbosstools-3.2_stable_branch.component- -ws" -->
+ <xsl:when test="contains(@value,'component--')">
+ <xsl:value-of
select="substring-after(@value,'component--')" />
+ </xsl:when>
+ <!-- property
name="jbosstools-drools-5.2_stable_branch-SNAPSHOT.build.properties.JOB_NAME"
+ value="jbosstools-drools-5.2_stable_branch" -->
+ <xsl:when test="contains(@value, '_stable_branch')">
+ <xsl:value-of
+ select="substring-before(substring-after(@value,'jbosstools-'),'_stable_branch')"
/>
+ </xsl:when>
+ <xsl:when test="contains(@value, '_trunk')">
+ <xsl:value-of
+ select="substring-before(substring-after(@value,'jbosstools-'),'_trunk')"
/>
+ </xsl:when>
+
+ <!-- property
name="xulrunner-1.9.1.2-2011-01-20_20-39-25-H36.build.properties.JOB_NAME"
+ value="xulrunner-1.9.1.2" -->
+ <xsl:otherwise>
+ <xsl:value-of select="@value" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <tr>
+ <td colspan="2">
+ <a
href="http://hudson.qa.jboss.com/hudson/job/{$JOB_NAME}/">
+ <xsl:value-of select="$COMPONENT" />
+ </a>
+ </td>
+ </tr>
+
+ <xsl:for-each
+ select="//property[contains((a)name,'build.properties.filename') and
contains(@name,$COMPONENT)]">
+ <xsl:variable name="rowColor">
+ <xsl:if test="position() mod 2 = 1">
+ #CCCCEE
+ </xsl:if>
+ <xsl:if test="position() mod 2 = 0">
+ #FFFFFF
+ </xsl:if>
+ <xsl:if test="contains(@name,'All')">
+ #CCEECC
+ </xsl:if>
+ <xsl:if test="contains(@name,'Source')">
+ #EECCCC
+ </xsl:if>
+ </xsl:variable>
+
<tr bgcolor="{$rowColor}">
- <td>
- <img src="images/OK-small.png" />
- </td>
- <td class="downloadInfo">
- <xsl:for-each select=".">
- <b>
- <acronym title="{@name} :: {description}">
- <a class="allLink-blue"
href="{$baseurl}/{download/@url}">
- <xsl:value-of select="concat(@name,' ',@version)"
/>
+ <!-- <td> <img src="images/OK-small.png" />
</td> -->
+ <td class="downloadInfo">
+ <xsl:for-each select=".">
+ <b>
+ <xsl:variable name="filelabel">
+ <xsl:choose>
+ <!-- property name="jbosstools-3.2_stable_branch.component-
-ws-SNAPSHOT.build.properties.JOB_NAME"
+ value="jbosstools-3.2_stable_branch.component- -ws" -->
+ <xsl:when test="contains(@value,'component--')">
+ <xsl:value-of
select="substring-after(@value,'component--')" />
+ </xsl:when>
+
+ <!-- property
name="jbosstools-drools-5.2_stable_branch-SNAPSHOT.build.properties.JOB_NAME"
+ value="jbosstools-drools-5.2_stable_branch" -->
+ <xsl:when test="contains(@value,
'_stable_branch')">
+ <xsl:value-of
+ select="replace(substring-after(@value,'jbosstools-'),'_stable_branch','')"
/>
+ </xsl:when>
+ <xsl:when test="contains(@value, '_trunk')">
+ <xsl:value-of
+ select="replace(substring-after(@value,'jbosstools-'),'_trunk','')"
/>
+ </xsl:when>
+
+ <!-- property
name="xulrunner-1.9.1.2-2011-01-20_20-39-25-H36.build.properties.JOB_NAME"
+ value="xulrunner-1.9.1.2" -->
+ <xsl:otherwise>
+ <xsl:value-of select="@value" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Update, Sources, etc. -->
+ <xsl:variable name="fileType">
+ <xsl:choose>
+ <xsl:when test="contains($filelabel, 'Update')">
+ <xsl:value-of
+ select="'Update'" />
+ </xsl:when>
+ <xsl:when test="contains($filelabel, 'Sources')">
+ <xsl:value-of
+ select="'Sources'" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'Other'" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <a class="allLink-blue" href="{@value}">
+ <xsl:value-of select="$filelabel" />
</a>
- </acronym>
- <br />
- <a class="md5"
href="{$baseurl}/{download/(a)url}.MD5">MD5</a>
- | filesize:
- <xsl:value-of select="download/@size" />
- </b>
- <br />
- </xsl:for-each>
- </td>
- </tr>
+ <ul>
+ <li>
+ md5:
+ <xsl:for-each
+ select="//property[contains((a)name,'build.properties.filemd5')
and contains(@name,$COMPONENT) and contains(@name,$fileType)]">
+ <xsl:value-of select="@value" />
+ </xsl:for-each>
+ </li><li>size:
+ <xsl:for-each
+ select="//property[contains((a)name,'build.properties.filesize')
and contains(@name,$COMPONENT) and contains(@name,$fileType)]">
+ <xsl:value-of select="@value" /> bytes
+ </xsl:for-each>
+ </li>
+
+ <xsl:for-each
+ select="tokenize(//property[contains((a)name,'build.properties.SVN_REVISION')
and contains(@name,$COMPONENT)]/@value,',')">
+ <li>SVN: <xsl:value-of select="." /></li>
+ </xsl:for-each>
+ </ul>
+ </b>
+ </xsl:for-each>
+ </td>
+ </tr>
+ </xsl:for-each>
</xsl:for-each>
</table>
@@ -161,9 +224,9 @@
<table>
<tr>
<td rowspan="3">
- Eclipse Helios 3.6.1 +
+ Eclipse Helios 3.6.2 +
<br />
- Web Tools 3.2.2 +
+ Web Tools 3.2.3 +
<br />
TPTP + BIRT + DTP ...
</td>
@@ -175,13 +238,13 @@
<tr>
<td>
<a class="blue"
-
href="http://download.jboss.org/jbosstools/updates/target-platform/e...
Platform Update Zip</a>
+
href="http://download.jboss.org/jbosstools/updates/target-platform/e...
Platform Update Zip</a>
</td>
</tr>
<tr>
<td>
<a class="blue"
-
href="http://anonsvn.jboss.org/repos/jbosstools/trunk/build/target-p...
Platform Definition File</a>
+
href="http://anonsvn.jboss.org/repos/jbosstools/branches/jbosstools-...
Platform Definition File</a>
</td>
</tr>
</table>
@@ -259,6 +322,5 @@
</html>
-
</xsl:template>
-</xsl:transform>
\ No newline at end of file
+</xsl:stylesheet>
\ No newline at end of file