-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
executable file
·133 lines (94 loc) · 4.26 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="xml-dir-listing" basedir="." default="jar">
<property name="src.dir" value="src"/>
<property name="classes.dir" value="classes"/>
<property name="bin.dir" value="bin"/>
<property name="lib.dir" value="lib"/>
<property name="docs.dir" value="docs"/>
<property name="javadoc.dir" value="docs/api"/>
<property name="test.dir" location="test" />
<property name="version.number" value="0.2.1"/>
<path id="classpath">
<pathelement path="${lib.dir}/jakarta-regexp-1.5.jar"/>
<pathelement path="${lib.dir}/commons-cli-1.1.jar"/>
<pathelement path="${lib.dir}/log4j-1.2.14.jar"/>
<pathelement location="${lib.dir}/${ant.project.name}.${version.number}.jar" />
</path>
<path id="classpath.test">
<pathelement location="${lib.dir}/junit.jar" />
<pathelement location="${test.dir}" />
<pathelement location="${lib.dir}/${ant.project.name}.${version.number}.jar" />
<path refid="classpath" />
</path>
<target name="clean" description="Delete all generated files">
<delete dir="${classes.dir}" failonerror="true"/>
<delete file="${lib.dir}/${ant.project.name}.${version.number}.jar" failonerror="true"/>
</target>
<target name="clean-test" description="Cleans test clases">
<delete>
<fileset dir="${test.dir}" includes="**/*.class" />
</delete>
</target>
<target name="compile" description="Compiles the application" depends="">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}">
<classpath refid="classpath"/>
</javac>
</target>
<target name="compile-test" description="Compiles the junit tests" depends="jar, clean-test">
<javac srcdir="${test.dir}">
<classpath refid="classpath.test"/>
</javac>
</target>
<target name="generate-javadoc" description="Generates javadocs">
<mkdir dir="${javadoc.dir}" />
<javadoc packagenames="net.matthaynes.xml.dirlist"
destdir="${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="XML Directory Listing API ${version.number}">
<doctitle><![CDATA[<h1>XML Directory Listing API ${version.number}</h1>]]></doctitle>
<classpath refid="classpath"/>
<fileset dir="${src.dir}" defaultexcludes="yes" />
</javadoc>
</target>
<target name="jar" description="JARs the application" depends="compile">
<jar destfile="${lib.dir}/${ant.project.name}.${version.number}.jar">
<fileset dir="${classes.dir}" />
<fileset dir="." includes="NOTICE LICENSE" defaultexcludes="yes" />
</jar>
</target>
<target name="release" depends="jar, test-junit, test-task, generate-javadoc, zip" description="Releases code to googlecode">
</target>
<target name="test-cli-unix" description="Use the tool from command line on Unix" depends="jar">
<exec executable="${bin.dir}/xml-dir-listing" failonerror="yes">
<arg line="-sort directory -r -f yyyy-MM-d -o fileList.xml -c ISO-8859-1 ."/>
</exec>
</target>
<target name="test-cli-win" description="Use the tool from command line on Windows" depends="jar">
<exec executable="${bin.dir}/xml-dir-listing.bat" failonerror="yes">
<arg line="-sort directory -r -f yyyy-MM-d -o fileList.xml ."/>
</exec>
</target>
<target name="test-junit" depends="compile-test" description="Runs a series of junit tests">
<junit haltonfailure="yes">
<classpath refid="classpath.test" />
<formatter type="brief" usefile="false" />
<test name="TestXmlDirectoryListing" />
</junit>
</target>
<target name="test-task" description="Use the Task" depends="jar">
<taskdef name="xml-dir-list" classname="net.matthaynes.xml.dirlist.AntFileListing">
<classpath refid="classpath" />
</taskdef>
<xml-dir-list reverse="true" verbose="true" srcDir="." destFile="fileList.xml" encoding="ISO-8859-1" />
</target>
<target name="zip" description="Packages all files into a zip archive">
<zip destfile="${ant.project.name}.${version.number}.zip"
basedir="."
includes="${bin.dir}/** ${docs.dir}/** ${lib.dir}/** LICENSE NOTICE"
excludes="${lib.dir}/junit.jar"
/>
</target>
</project>