source: other-projects/trunk/gs3-release-maker/apache-ant-1.6.5/src/etc/ant-update.xsl@ 14627

Last change on this file since 14627 was 14627, checked in by oranfry, 17 years ago

initial import of the gs3-release-maker

File size: 3.6 KB
Line 
1<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
2<xsl:output method="xml" indent="yes"/>
3<!--
4 Copyright 2004 The Apache Software Foundation
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18-->
19
20<!--
21
22 The purpose have this XSL is to provide a fast way to update a buildfile
23 from deprecated tasks.
24
25 It should particulary be useful when there is a lot of build files to migrate.
26 If you do not want to migrate to a particular task and want to keep it for
27 various reason, just comment the appropriate template.
28
29 !!!! Use at your own risk. !!!!
30
31 @author <a href="[email protected]">Stephane Bailliez</a>
32
33-->
34
35
36 <!-- (zip|jar|war|ear)file attributes are replaced by destfile in their respective task -->
37 <xsl:template match="zip">
38 <zip destfile="{@zipfile}">
39 <xsl:apply-templates select="@*[not(name()='zipfile')]|node()"/>
40 </zip>
41 </xsl:template>
42 <xsl:template match="jar">
43 <jar destfile="{@jarfile}">
44 <xsl:apply-templates select="@*[not(name()='jarfile')]|node()"/>
45 </jar>
46 </xsl:template>
47 <xsl:template match="war">
48 <war destfile="{@warfile}">
49 <xsl:apply-templates select="@*[not(name()='warfile')]|node()"/>
50 </war>
51 </xsl:template>
52 <xsl:template match="ear">
53 <ear destfile="{@earfile}">
54 <xsl:apply-templates select="@*[not(name()='earfile')]|node()"/>
55 </ear>
56 </xsl:template>
57
58
59 <!-- copydir is replaced by copy -->
60 <xsl:template match="copydir">
61 <copy todir="{@dest}">
62 <xsl:apply-templates select="@flatten|@filtering"/>
63 <xsl:if test="@forceoverwrite">
64 <xsl:attribute name="overwrite"><xsl:value-of select="@forceoverwrite"/></xsl:attribute>
65 </xsl:if>
66 <fileset dir="{@src}">
67 <xsl:apply-templates select="@includes|@includesfile|@excludes|@excludesfile|node()"/>
68 </fileset>
69 </copy>
70 </xsl:template>
71
72 <!-- copyfile is replaced by copy -->
73 <xsl:template match="copyfile">
74 <copy file="{@src}" tofile="{@dest}">
75 <xsl:apply-templates select="@filtering"/>
76 <xsl:if test="@forceoverwrite">
77 <xsl:attribute name="overwrite"><xsl:value-of select="@forceoverwrite"/></xsl:attribute>
78 </xsl:if>
79 </copy>
80 </xsl:template>
81
82 <!-- deltree is replaced by delete -->
83 <xsl:template match="deltree">
84 <delete dir="{@dir}"/>
85 </xsl:template>
86
87 <!-- execon is replaced by apply -->
88 <xsl:template match="execon">
89 <apply>
90 <xsl:apply-templates select="@*|node()"/>
91 </apply>
92 </xsl:template>
93
94 <!-- rename is replaced by move -->
95 <xsl:template match="rename">
96 <move file="{@src}" tofile="{@dest}">
97 <xsl:if test="@replace">
98 <xsl:attribute name="overwrite"><xsl:value-of select="@replace"/></xsl:attribute>
99 </xsl:if>
100 </move>
101 </xsl:template>
102
103 <!-- javadoc2 is replaced by javadoc -->
104 <xsl:template match="javadoc2">
105 <javadoc>
106 <xsl:apply-templates select="@*|node()"/>
107 </javadoc>
108 </xsl:template>
109
110
111 <!-- Copy every node and attributes recursively -->
112 <xsl:template match="node()|@*">
113 <xsl:copy>
114 <xsl:apply-templates select="@*|node()"/>
115 </xsl:copy>
116 </xsl:template>
117
118</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.