Skip to content

Commit

Permalink
Merge pull request #62 from pleacu/JBTIS-89
Browse files Browse the repository at this point in the history
JBTIS-89 - correct TP repo mirror to remove <references>
  • Loading branch information
Paul Leacu committed Jul 24, 2013
2 parents 13809e4 + 52465b8 commit 927a242
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
36 changes: 36 additions & 0 deletions scripts/remove.references.xml
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="remove.references">
<!-- this script is used to remove the <references> node from a content.xml file (within a content.jar file) -->
<!-- run: ant -f /path/to/folder/with/remove.references.xml -DworkDir=/path/to/folder/with/content.jar -->
<!-- eg., to work in current dir:
wget https://raw.github.com/jbosstools/jbosstools-download.jboss.org/master/jbosstools/updates/requirements/remove.references.xml; ant -f remove.references.xml -DworkDir=`pwd`
-->
<target name="remove.references">
<antcall target="unpack.content.jar"/>

<echo file="remove-references.xsl">&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
&lt;xsl:template match="/">&lt;xsl:apply-templates select="*"/>&lt;/xsl:template>
&lt;xsl:template match="*">&lt;xsl:copy>&lt;xsl:for-each select="@*">&lt;xsl:copy />&lt;/xsl:for-each>&lt;xsl:apply-templates />&lt;/xsl:copy>&lt;/xsl:template>
&lt;xsl:template match="references" />
&lt;/xsl:stylesheet></echo>

<move file="${workDir}/content.xml" tofile="${workDir}/content.old.xml" overwrite="true" />
<xslt style="remove-references.xsl" in="${workDir}/content.old.xml" out="${workDir}/content.xml" />

<delete file="remove-references.xsl" quiet="true"/>

<antcall target="pack.content.jar"/>
</target>

<target name="unpack.content.jar">
<unzip src="${workDir}/content.jar" dest="${workDir}" />
<delete file="${workDir}/content.jar" />
</target>

<target name="pack.content.jar">
<zip destfile="${workDir}/content.jar" basedir="${workDir}" includes="content.xml" />
<delete file="${workDir}/content.xml" />
<delete file="${workDir}/content.old.xml" />
</target>
</project>
65 changes: 65 additions & 0 deletions target-platform/pom.xml
Expand Up @@ -300,6 +300,7 @@

<build>
<plugins>

<plugin>
<groupId>org.jboss.tools.tycho-plugins</groupId>
<artifactId>target-platform-utils</artifactId>
Expand All @@ -316,9 +317,73 @@
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>

<executions>
<execution>
<phase>package</phase>

<configuration>
<quiet>true</quiet>
<target>
<!-- ANT script to remove the <references> section from the mirror repo content.xml. -->
<ant antfile="../scripts/remove.references.xml" dir=".">
<property name="workDir" value="./target/target-platform.target.repo" />
</ant>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>

<dependencies>
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-trax</artifactId>
<version>1.8.0</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-commons-net</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-apache-regexp</artifactId>
<version>1.8.2</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
</dependency>
</dependencies>

</plugin>
</plugins>

</build>
</profile>
</profiles>
Expand Down

0 comments on commit 927a242

Please sign in to comment.