-
Notifications
You must be signed in to change notification settings - Fork 118
/
build.xml
111 lines (81 loc) · 3.32 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<project name="ant-demo" default="dist" basedir="." >
<!-- define Maven coordinates -->
<property name="groupId" value="org.jdom" />
<property name="artifactId" value="jdom" />
<property name="version" value="1.x-snapshot" />
<property name="gpg" value="gpg"
description="Path to the GNU gpg program for maven target"/>
<property name="dist" value="dist" />
<target name="build.core">
<ant dir="core" target="master" >
<property name="version" value="${version}"/>
</ant>
</target>
<target name="build.test">
<echo message="Java Version - ${java.version} : Ant Version = ${ant.version}" />
<ant dir="test" target="master" >
<property name="version" value="${version}"/>
</ant>
</target>
<target name="build.contrib">
<ant dir="contrib" target="master" >
<property name="version" value="${version}"/>
</ant>
</target>
<target name="build" depends="build.core,build.test,build.contrib" />
<target name="clean" description="clean up">
<delete dir="${dist}" />
</target>
<target name="dist" depends="clean, build" description="generate the distribution">
<mkdir dir="${dist}" />
<delete dir="${dist}" includes="*.jar"/>
<copy todir="${dist}">
<fileset dir="core/build" includes="*${version}*.jar"/>
<fileset dir="test/build" includes="*${version}*.jar"/>
<fileset dir="contrib/build" includes="*${version}*.jar"/>
</copy>
<copy todir="${dist}/jdom">
<fileset dir="core" excludes="**/classes/** , **/build/src/**" />
</copy>
<copy todir="${dist}/jdom-contrib">
<fileset dir="contrib" excludes="**/classes/** , **/build/src/**" />
</copy>
<copy todir="${dist}/jdom-test">
<fileset dir="test" excludes="**/classes/** , **/build/src/**" />
</copy>
<zip destfile="${dist}/jdom-${version}.zip" >
<fileset dir="${dist}" includes="jdom/**" />
</zip>
<zip destfile="${dist}/jdom-contrib-${version}.zip">
<fileset dir="${dist}" includes="jdom-contrib/**" />
</zip>
<zip destfile="${dist}/jdom-test-${version}.zip">
<fileset dir="${dist}" includes="jdom-test/**" />
</zip>
<tar destfile="${dist}/jdom-${version}.tar.gz"
compression="gzip" basedir="${dist}" includes="jdom/**" />
<tar destfile="${dist}/jdom-contrib-${version}.tar.gz"
compression="gzip" basedir="${dist}" includes="jdom-contrib/**" />
<tar destfile="${dist}/jdom-test-${version}.tar.gz"
compression="gzip" basedir="${dist}" includes="jdom-test/**" />
</target>
<target name="maven" depends="dist" description="Build a maven bundle">
<property name="mavendir" value="${dist}" />
<property name="jarbase" value="jdom-${version}" />
<!-- copy/rename the pom template -->
<copy filtering="true" file="maven.pom" tofile="${dist}/${jarbase}.pom">
<filterset>
<filter token="artifactID" value="jdom"/>
<filter token="version" value="${version}" />
<filter token="jdk" value="1.2" />
</filterset>
</copy>
<exec dir="${mavendir}" command="${gpg} -abv ${jarbase}.pom"/>
<exec dir="${mavendir}" command="${gpg} -abv ${jarbase}.jar"/>
<exec dir="${mavendir}" command="${gpg} -abv ${jarbase}-sources.jar"/>
<exec dir="${mavendir}" command="${gpg} -abv ${jarbase}-javadoc.jar"/>
<jar destfile="${mavendir}/${jarbase}-maven-bundle.jar"
basedir="${mavendir}"
includes="${jarbase}*" excludes="*maven-bundle*" />
</target>
</project>