forked from nhnb/zipdiff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
149 lines (130 loc) · 5.54 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!-- $Header: /cvsroot/zipdiff/zipdiff/build.xml,v 1.14 2004/06/29 00:23:49 sullis Exp $ -->
<!-- ###################################################### -->
<!-- This is an Ant build file -->
<!-- -->
<!-- For details, see http://ant.apache.org/ -->
<!-- ###################################################### -->
<project name="zipdiffProject" default="help" basedir=".">
<property file="${user.home}/build.properties" />
<property name="src.dir" value="${basedir}/src"/>
<property name="java.src.dir" value="${src.dir}/main"/>
<property name="test.src.dir" value="${src.dir}/test"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="metadata.dir" value="${src.dir}/metadata" />
<property name="build.dir" value="${basedir}/build"/>
<property name="javadoc.build.dir" value="${build.dir}/doc/api"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="distrib.name" value="zipdiff-0.4"/>
<property name="distrib.jar.filename" value="zipdiff.jar"/>
<property name="junit.jar" value="${basedir}/lib/junit.jar"/>
<property name="junit.reports.dir" value="${basedir}/junit-reports"/>
<path id="project.class.path">
<pathelement location="lib/commons-cli-1.0.jar" />
</path>
<!-- ###################################################### -->
<!-- target definitions -->
<!-- ###################################################### -->
<target name="help">
<echo message="ant -projecthelp will display all targets" />
</target>
<target name="all" depends="init, build, docs, distrib"/>
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${javadoc.build.dir}" />
<mkdir dir="${classes.dir}" />
<mkdir dir="${junit.reports.dir}" />
</target>
<target name="clean">
<delete dir="${classes.dir}" />
<delete dir="${build.dir}" />
</target>
<target name="javadocs" depends="init" >
<javadoc packagenames="zipdiff.*"
sourcepath="${java.src.dir}"
defaultexcludes="yes"
destdir="${javadoc.build.dir}"
author="true"
version="true"
use="true"
windowtitle="zipdiff" />
</target>
<target name="docs" depends="init, javadocs"/>
<target name="project.jarfile" depends="init, build">
<jar destfile="${build.dir}/${distrib.jar.filename}"
manifest="${metadata.dir}/JAR-manifest.txt"
compress="true">
<fileset dir="${classes.dir}"
includes="zipdiff/**/*.class" />
</jar>
</target>
<target name="build" depends="init">
<javac deprecation="on"
destdir="${classes.dir}"
includeAntRuntime="yes"
classpathref="project.class.path"
debug="on">
<src path="${java.src.dir}" />
</javac>
</target>
<target name="buildTest" depends="init, build">
<javac deprecation="on"
destdir="${classes.dir}"
includeAntRuntime="yes"
classpathref="project.class.path"
debug="on">
<src path="${test.src.dir}" />
</javac>
</target>
<target name="distrib-archive" depends="init, project.jarfile, copylibraries, docs">
<delete file="${build.dir}/${distrib.name}.zip" />
<zip destfile="${build.dir}/${distrib.name}.zip">
<zipfileset dir="${build.dir}" prefix="${distrib.name}/build">
<include name="*.jar" />
<exclude name="ant*.jar" />
<exclude name="junit*.jar" />
</zipfileset>
<zipfileset dir="${src.dir}" prefix="${distrib.name}/src">
<include name="**/*.java" />
<include name="**/*.html" />
<include name="**/*.txt" />
<include name="**/*.xml" />
<include name="**/*.properties" />
</zipfileset>
<zipfileset dir="${basedir}" prefix="${distrib.name}">
<include name="build.xml" />
</zipfileset>
<zipfileset dir="${basedir}" prefix="${distrib.name}">
<include name="readme.txt" />
<include name="*LICENSE*" />
<include name="NOTICE.txt" />
</zipfileset>
<zipfileset dir="${lib.dir}" prefix="${distrib.name}">
<include name="*LICENSE*" />
</zipfileset>
</zip>
</target>
<target name="copylibraries" depends="init">
<copy todir="${build.dir}">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</copy>
</target>
<target name="tests" depends="init, buildTest">
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<pathelement location="${classes.dir}" />
<pathelement path="${java.class.path}" />
</classpath>
<formatter type="plain" />
<batchtest fork="yes" todir="${junit.reports.dir}">
<fileset dir="${test.src.dir}">
<include name="**/*Test*.java" />
<exclude name="**/AllTests.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="distrib" depends="init, distrib-archive">
</target>
</project>