[jbosstools-commits] JBoss Tools SVN: r43648 - trunk/build/target-platforms/local.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Thu Sep 13 10:06:27 EDT 2012
Author: mickael_istria
Date: 2012-09-13 10:06:26 -0400 (Thu, 13 Sep 2012)
New Revision: 43648
Removed:
trunk/build/target-platforms/local/contentXml2artifactVersions.xsl
trunk/build/target-platforms/local/target2targetTemplate.xsl
trunk/build/target-platforms/local/targetUpdateFromRepo.xml
Modified:
trunk/build/target-platforms/local/pom.xml
Log:
JBIDE-12565: Removed useless files, put default repo into target/REPO so it gets cleaned
Deleted: trunk/build/target-platforms/local/contentXml2artifactVersions.xsl
===================================================================
--- trunk/build/target-platforms/local/contentXml2artifactVersions.xsl 2012-09-13 13:08:51 UTC (rev 43647)
+++ trunk/build/target-platforms/local/contentXml2artifactVersions.xsl 2012-09-13 14:06:26 UTC (rev 43648)
@@ -1,19 +0,0 @@
-<?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="/"><xsl:for-each select="//unit">
-<xsl:sort select="@id" order="ascending" case-order="lower-first"/><xsl:sort select="@version" order="descending" case-order="lower-first" data-type="qname"/><xsl:value-of select="@id" />.version=<xsl:value-of select="@version" />
-<xsl:variable name="thisID" select="@id"/>
-<xsl:if test="count(//unit[@id = $thisID]) > 1">
-# Warning: <xsl:value-of select="count(//unit[@id = $thisID])"/> versions found for <xsl:value-of select="@id" />:<xsl:for-each select="//unit[@id = $thisID]"><xsl:sort select="@id" order="ascending" case-order="lower-first"/><xsl:sort select="@version" order="descending" case-order="lower-first" data-type="qname"/>
-# <xsl:value-of select="@id" />.version=<xsl:value-of select="@version" /></xsl:for-each></xsl:if>
-#
-</xsl:for-each></xsl:template>
-</xsl:stylesheet>
Modified: trunk/build/target-platforms/local/pom.xml
===================================================================
--- trunk/build/target-platforms/local/pom.xml 2012-09-13 13:08:51 UTC (rev 43647)
+++ trunk/build/target-platforms/local/pom.xml 2012-09-13 14:06:26 UTC (rev 43648)
@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.tools</groupId>
- <artifactId>target-platforms</artifactId>
+ <artifactId>target-platforms</artifactId>
<version>4.0.0.Alpha2-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.target-platforms</groupId>
@@ -13,7 +13,7 @@
<packaging>pom</packaging>
<properties>
- <repoDir>${basedir}/REPO</repoDir>
+ <repoDir>${project.build.directory}/REPO</repoDir>
<eclipse.type>platform</eclipse.type>
<!--
@@ -22,7 +22,7 @@
-->
<eclipse.version>M20120829-1000</eclipse.version>
<eclipse.URL>http://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops/M20120829-1000/</eclipse.URL>
-
+
<!-- Temporary before release of Tycho 0.16 -->
<!-- JBIDE-12003 -->
<tychoVersion>0.16.0-SNAPSHOT</tychoVersion>
@@ -99,7 +99,7 @@
<execution>
<phase>verify</phase>
<goals>
- <goal>validate-target-platform</goal>
+ <goal>validate-target-platform</goal>
</goals>
<configuration>
<targetFiles>
@@ -139,6 +139,9 @@
<profiles>
<profile>
<id>get.local.target</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
<build>
<plugins>
<plugin>
Deleted: trunk/build/target-platforms/local/target2targetTemplate.xsl
===================================================================
--- trunk/build/target-platforms/local/target2targetTemplate.xsl 2012-09-13 13:08:51 UTC (rev 43647)
+++ trunk/build/target-platforms/local/target2targetTemplate.xsl 2012-09-13 14:06:26 UTC (rev 43648)
@@ -1,62 +0,0 @@
-<?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:param name="replacement.URL"/>
-<xsl:param name="replace.versions"/>
-
-<!-- Copy unit nodes and optionally (if we ran contentXml2artifactVersions.xsl transform and have artifactVersions.properties file) templatize their version attributes -->
-<xsl:template match="unit">
-<xsl:choose>
-<xsl:when test="$replace.versions">
-
-<xsl:variable name="prevID"><xsl:value-of select="preceding-sibling::* [1]/@id" /></xsl:variable> <!-- <prevID><xsl:value-of select="$prevID"/></prevID> -->
-<xsl:variable name="thisID"><xsl:value-of select="@id" /></xsl:variable> <!-- <thisID><xsl:value-of select="$thisID"/></thisID> -->
-<xsl:variable name="nextID"><xsl:value-of select="following-sibling::* [1]/@id" /></xsl:variable> <!-- <nextID><xsl:value-of select="$nextID"/></nextID> -->
-
-<!-- if there is more than one node matching <unit id="some.id"/> then DO NOT REPLACE the version -->
-<xsl:choose>
- <xsl:when test="contains ($thisID, $nextID) or contains ($thisID, $prevID)">
- <!-- <xsl:comment> Note multiple versions of this IU; cannot update automatically. </xsl:comment> -->
- <unit id="{@id}" version="{@version}"><xsl:apply-templates/></unit>
- </xsl:when>
- <xsl:otherwise>
- <unit id="{@id}" version="${{{@id}.version}}"><xsl:apply-templates/></unit>
- </xsl:otherwise>
-</xsl:choose>
-<xsl:apply-templates/>
-</xsl:when>
-<xsl:otherwise>
-<unit id="{@id}" version="{@version}"><xsl:apply-templates/></unit>
-</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<!-- Copy repository nodes and optionally replace their location attributes (if replacement.URL is set) -->
-<xsl:template match="repository">
-<xsl:choose>
-<xsl:when test="$replacement.URL">
-<repository location="{$replacement.URL}">
-<xsl:apply-templates/>
-</repository>
-</xsl:when>
-<xsl:otherwise>
-<repository location="{@location}">
-<xsl:apply-templates/>
-</repository>
-</xsl:otherwise>
-</xsl:choose>
-</xsl:template>
-
-<!-- Copy everything else unchanged -->
-<xsl:template match="@*|node()">
-<xsl:copy>
-<xsl:apply-templates select="@*|node()"/>
-</xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
-
Deleted: trunk/build/target-platforms/local/targetUpdateFromRepo.xml
===================================================================
--- trunk/build/target-platforms/local/targetUpdateFromRepo.xml 2012-09-13 13:08:51 UTC (rev 43647)
+++ trunk/build/target-platforms/local/targetUpdateFromRepo.xml 2012-09-13 14:06:26 UTC (rev 43648)
@@ -1,165 +0,0 @@
-<project default="custom.build" name="jbosstools target platform updater">
-
- <property name="outputDir" value="${basedir}" />
- <!-- Instead of overwriting, can also create a new .target file in a different outputDir
- <property name="outputDir" value="${tmpDir}" />
- -->
-
- <!-- must set these commandline if not using defaults -->
- <property name="targetFile" value="multiple.target" />
- <property name="repoDir" value="${outputDir}/REPO/" />
-
- <!-- create a second .target file which replaces all URLs with a single unified (published) one
- (eg., for jbosstools target platform site), set these properties too -->
- <property name="unified.targetFile" value="unified.target" />
- <property name="unified.URL" value="http://download.jboss.org/jbosstools/updates/target-platform_4.0.juno.SR0a/latest/" />
- <property name="local.targetFile" value="local.target" />
- <property name="local.URL" value="file://${repoDir}" />
-
- <property name="tmpDir" value="${java.io.tmpdir}/targetUpdateFromRepo" />
-
- <target name="help">
- <echo>Must set these properties (or use defaults shown):
-
- ant -f targetUpdateFromRepo.xml -DrepoDir=${repoDir} \
- -DtargetFile=${targetFile} \
- -Dunified.targetFile=${unified.targetFile} \
- -Dunified.URL=${unified.URL} \
- -Dlocal.targetFile=${local.targetFile} \
- -Dlocal.URL=${local.URL}
-
-To simply generate a local.target file from the multiple.target file, use:
-
- ant -f targetUpdateFromRepo.xml local.target</echo>
- </target>
-
- <target name="custom.build" depends="check.content.xml, get.content.xml, copy.content.xml, contentXml2artifactVersions.xsl, multiple.target, unified.target, local.target, 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" description="run target2targetTemplate.xsl to templatize .target file">
- <property name="outputFile" value="${tmpDir}/${targetFile}.template" />
- <property name="replacement.URL" value="" />
- <echo level="verbose">Generate ${outputFile}</echo>
- <xslt style="target2targetTemplate.xsl" in="${targetFile}" out="${outputFile}" processor="trax">
- <param name="replacement.URL" expression="${replacement.URL}" />
- <!-- if replace.versions is set, will update from versions in repo; if not set, will only update URLs, not IU versions -->
- <param name="replace.versions" expression="1" />
- </xslt>
- </target>
-
- <target name="multiple.target" description="update the multiple.target file based on new content in the local repo">
- <antcall target="target2targetTemplate" />
- <antcall target="updateTargetFile" />
- </target>
-
- <target name="unified.target" description="update the unified.target file based on new content in the local repo and replace URLs w/ single unified one">
- <antcall target="target2targetTemplate">
- <param name="outputFile" value="${tmpDir}/${unified.targetFile}.template" />
- <param name="replacement.URL" value="${unified.URL}" />
- </antcall>
- <antcall target="updateTargetFile">
- <param name="targetFile" value="${unified.targetFile}" />
- </antcall>
- </target>
-
- <target name="local.target" description="create a local.target file (based on new content in the local repo if available) and replace URLs w/ single local one">
- <antcall target="target2targetTemplate">
- <param name="outputFile" value="${tmpDir}/${local.targetFile}.template" />
- <param name="replacement.URL" value="${local.URL}" />
- </antcall>
- <antcall target="updateTargetFile">
- <param name="targetFile" value="${local.targetFile}" />
- </antcall>
- </target>
-
- <target name="updateTargetFile" description="load generated properties and resolve them in the template to create a new .target file">
- <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" description="purge temporary dir">
- <delete dir="${tmpDir}" includeemptydirs="true" quiet="true" />
- </target>
-
- <!-- test examples:
- cd ~/32x/build/target-platform
- ant -f targetUpdateFromRepo.xml test.updateTargetFile -Dtest.pattern=swtbot
- ant -f targetUpdateFromRepo.xml test.updateTargetFile -Dtest.pattern=js -DtargetFile=jbds.target -DrepoDir=`pwd`/JBDS_REPO/
- -->
- <target name="test.updateTargetFile" depends="check.content.xml, get.content.xml, copy.content.xml, contentXml2artifactVersions.xsl">
- <!-- properties to set commandline: -->
- <property name="test.pattern" value="swtbot"/>
- <property name="test.targetFile" value="${targetFile}"/>
-
- <property name="tmpfile" value="${tmpDir}/test.updateTargetFile.tmp"/>
- <property name="tmpfile2" value="${tmpDir}/test.updateTargetFile.tmpsed"/>
- <echo level="info">Load /${test.pattern}/ properties from ${tmpDir}/artifactVersions.properties</echo>
- <loadfile srcfile="${tmpDir}/artifactVersions.properties" property="artifactVersionsPropertiesContents">
- <filterchain>
- <linecontains>
- <contains value="${test.pattern}" />
- <!-- <contains value="feature.group" /> -->
- </linecontains>
- <striplinecomments><comment value="#"/></striplinecomments>
- </filterchain>
- </loadfile>
- <echo file="${tmpfile}">${artifactVersionsPropertiesContents}</echo>
-
- <antcall target="target2targetTemplate">
- <param name="outputFile" value="${tmpDir}/${test.targetFile}.template" />
- <param name="replacement.URL" value="${unified.URL}" />
- </antcall>
- <!-- <echo level="info">Generated ${tmpDir}/${unified.targetFile}.template: </echo>
- <exec executable="egrep">
- <arg line=""${test.pattern}" ${tmpDir}/${test.targetFile}.template" />
- </exec> -->
-
- <antcall target="updateTargetFile">
- <param name="targetFile" value="${test.targetFile}" />
- </antcall>
- <echo level="info">--
-If loaded version values (in artifactVersions.properties) do not match
-output below (values from repo), an error has occurred or replace.versions is undefined.
-It is also possible that the complete list of features in the repo is greater than those
-in the target. If so, clean the repo and regenerate to remove extraneous content.
---</echo>
- <!-- $ sed -n -e '/swtbot.*feature.group/ p' unified.target | sed -e 's/\t\t\t<unit id="\|"\/>//g' -->
- <exec executable="sed" output="${tmpfile2}">
- <arg line=" -n -e '/${test.pattern}.*feature.group/ p' ${test.targetFile}" />
- </exec>
- <exec executable="sed" output="${tmpfile}.2">
- <arg line=" -e 's/\t\t\t<unit id="\|"\/>//g' ${tmpfile2} -e 's/" version="/.version=/g'" />
- </exec>
- <exec executable="sort" output="${tmpfile}.sorted"><arg line="${tmpfile}"/></exec>
- <exec executable="sort" output="${tmpfile}.2.sorted"><arg line="${tmpfile}.2"/></exec>
- <exec executable="diff" outputproperty="diffout">
- <arg line="${tmpfile}.sorted ${tmpfile}.2.sorted"/>
- </exec>
- <echo>${diffout}</echo>
- <antcall target="cleanup"/>
- </target>
-</project>
More information about the jbosstools-commits
mailing list