-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JBTIS-89 - correct TP repo mirror to remove <references>
- Loading branch information
Paul Leacu
committed
Jul 24, 2013
1 parent
13809e4
commit 52465b8
Showing
2 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"><?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> | ||
<xsl:template match="/"><xsl:apply-templates select="*"/></xsl:template> | ||
<xsl:template match="*"><xsl:copy><xsl:for-each select="@*"><xsl:copy /></xsl:for-each><xsl:apply-templates /></xsl:copy></xsl:template> | ||
<xsl:template match="references" /> | ||
</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters