Author: nickboldt
Date: 2010-09-30 17:28:49 -0400 (Thu, 30 Sep 2010)
New Revision: 25359
Added:
trunk/build/target-platform/contentXml2artifactVersions.xsl
trunk/build/target-platform/target2targetTemplate.xsl
trunk/build/target-platform/targetUpdateFromRepo.xml
Log:
https://jira.jboss.org/browse/JBIDE-6756 tooling to update a .target file to include newer
IUs based on a local repo
Added: trunk/build/target-platform/contentXml2artifactVersions.xsl
===================================================================
--- trunk/build/target-platform/contentXml2artifactVersions.xsl
(rev 0)
+++ trunk/build/target-platform/contentXml2artifactVersions.xsl 2010-09-30 21:28:49 UTC
(rev 25359)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
+<!--
+ This XSLT is used by targetUpdateFromRepo.xml to update the versions on IUs in a .target
file
+ CAUTION: do not auto-format this file or line breaks will appear where they should not
be!
+-->
+<xsl:output method="text" indent="no" encoding="UTF-8"
version="1.0" />
+<xsl:template match="repository">
+<xsl:apply-templates select="//unit" />
+</xsl:template>
+<xsl:template match="//unit"><xsl:value-of select="@id"
/>.version=<xsl:value-of select="@version" />
+#
+</xsl:template>
+</xsl:stylesheet>
Property changes on: trunk/build/target-platform/contentXml2artifactVersions.xsl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/target-platform/target2targetTemplate.xsl
===================================================================
--- trunk/build/target-platform/target2targetTemplate.xsl (rev 0)
+++ trunk/build/target-platform/target2targetTemplate.xsl 2010-09-30 21:28:49 UTC (rev
25359)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
+<!--
+ This XSLT is used by targetUpdateFromRepo.xml to update the versions on IUs in a .target
file
+ CAUTION: do not auto-format this file or line breaks will appear where they should not
be!
+-->
+
+<!-- Copy unit nodes and templatize their version attributes -->
+<xsl:template match="unit">
+<unit id="{@id}" version="${{{(a)id}.version}}">
+<xsl:apply-templates/>
+</unit>
+</xsl:template>
+
+<!-- Copy everything else unchanged -->
+<xsl:template match="@*|node()">
+<xsl:copy>
+<xsl:apply-templates select="@*|node()"/>
+</xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Property changes on: trunk/build/target-platform/target2targetTemplate.xsl
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/build/target-platform/targetUpdateFromRepo.xml
===================================================================
--- trunk/build/target-platform/targetUpdateFromRepo.xml (rev 0)
+++ trunk/build/target-platform/targetUpdateFromRepo.xml 2010-09-30 21:28:49 UTC (rev
25359)
@@ -0,0 +1,49 @@
+<project default="custom.build" name="jbosstools target platform
pom.xml + site.xml generator">
+ <property name="tmpDir"
value="${java.io.tmpdir}/targetUpdateFromRepo" />
+ <property name="targetFile" value="e361-wtp322.target" />
+ <property name="repoDir" value="./REPO_SR1" />
+ <property name="outputDir" value="${basedir}" />
+ <!-- <property name="outputDir" value="${tmpDir}" />
-->
+
+ <target name="custom.build" depends="check.content.xml,
get.content.xml, copy.content.xml, contentXml2artifactVersions.xsl,
target2targetTemplate.xsl, updateTargetFile, cleanup" />
+
+ <target name="check.content.xml" description="if content.jar, unpack
to get content.xml">
+ <condition property="content.xml.exists" value="true">
+ <available file="${repoDir}/content.xml" />
+ </condition>
+ </target>
+ <target name="get.content.xml" unless="content.xml.exists">
+ <echo level="verbose">Unzip ${tmpDir}/content.xml</echo>
+ <unzip src="${repoDir}/content.jar" dest="${tmpDir}" />
+ </target>
+ <target name="copy.content.xml" if="content.xml.exists">
+ <echo level="verbose">Copy ${tmpDir}/content.xml</echo>
+ <copy file="${repoDir}/content.xml" todir="${tmpDir}" />
+ </target>
+
+ <target name="contentXml2artifactVersions.xsl">
+ <echo level="verbose">Generate
${tmpDir}/artifactVersions.properties</echo>
+ <xslt style="contentXml2artifactVersions.xsl"
in="${tmpDir}/content.xml" out="${tmpDir}/artifactVersions.properties"
processor="trax" />
+ </target>
+
+ <target name="target2targetTemplate.xsl" description="run
target2targetTemplate.xsl to templatize .target file">
+ <echo level="verbose">Generate
${tmpDir}/${targetFile}.template</echo>
+ <xslt style="target2targetTemplate.xsl" in="${targetFile}"
out="${tmpDir}/${targetFile}.template" processor="trax" />
+ </target>
+
+ <target name="updateTargetFile">
+ <property file="${tmpDir}/artifactVersions.properties" />
+ <copy todir="${outputDir}" overwrite="true">
+ <fileset file="${tmpDir}/${targetFile}.template" />
+ <mapper type="merge" to="${targetFile}" />
+ <filterchain>
+ <expandproperties />
+ </filterchain>
+ </copy>
+ </target>
+
+ <target name="cleanup">
+ <delete dir="${tmpDir}" includeemptydirs="true"
quiet="true" />
+ </target>
+
+</project>
Property changes on: trunk/build/target-platform/targetUpdateFromRepo.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain