Menu

[r9]: / trunk / build.xml  Maximize  Restore  History

Download this file

193 lines (157 with data), 5.5 kB

  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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<project name="net.sf.vitforjava" default="all" basedir=".">
<!-- get the default properties -->
<property file="conf/default.properties" />
<!-- do everything: build, test, dist -->
<target name="all">
<antcall target="compile"></antcall>
<antcall target="test"></antcall>
<antcall target="dist"></antcall>
</target>
<target name="init">
<mkdir dir="${dist}" />
<mkdir dir="${doc}" />
<mkdir dir="${build}/src/classes" />
<mkdir dir="${build}/test/classes" />
</target>
<!-- clean the project -->
<target name="clean" description="clean up">
<delete dir="${build}" />
<delete dir="${dist}" />
<delete dir="${doc}" />
<delete>
<fileset dir=".">
<include name="TEST*" />
</fileset>
</delete>
</target>
<!-- compile the project -->
<target name="compile" depends="init">
<!-- set it up so we can create the manifest Classpath property -->
<property name="jar-all" location="lib" />
<fileset id="jars" dir="${jar-all}">
<include name="*.jar" />
</fileset>
<path id="cp">
<fileset refid="jars" />
</path>
<pathconvert property="classpath" refid="cp" pathsep=" " dirsep="/">
<map from="${jar-all}" to="lib" />
</pathconvert>
<!-- create the manifest file -->
<manifest file="${conf}/MANIFEST.MF">
<attribute name="Built-By" value="${proj.author}" />
<section name="${proj.name.slash}">
<attribute name="Specification-Title" value="${proj.title}" />
<attribute name="Specification-Version" value="${proj.version}" />
<attribute name="Specification-Vendor" value="${proj.vendor}" />
<attribute name="Implementation-Title" value="${proj.name}" />
<attribute name="Implementation-Version" value="${proj.version}" />
<attribute name="Implementation-Vendor" value="${proj.vendor}" />
<attribute name="Class-Path" value="${classpath}" />
<attribute name="Sealed" value="true" />
</section>
</manifest>
<!-- compile the source files -->
<javac srcdir="${src}" sourcepath="" destdir="${build}/src/classes">
<classpath>
<fileset dir="${lib}/"/>
</classpath>
<include name="**/*.java"/>
<exclude name="**/exampleapp/" />
</javac>
<!-- jar up the source files -->
<jar
jarfile="${build}/src/${proj.name.unix}-${proj.version}.jar"
basedir="${build}/src/classes"
manifest="${conf}/MANIFEST.MF" />
<!-- compile the unit tests -->
<javac srcdir="${test}" destdir="${build}/test/classes">
<classpath>
<fileset dir="${lib}/"/>
<fileset dir="${build}/src"/>
</classpath>
</javac>
<!-- jar up the unit tests -->
<jar
jarfile="${build}/test/${proj.name.unix}-${proj.version}.test.jar"
basedir="${build}/test/classes"
manifest="${conf}/MANIFEST.MF" />
</target>
<!-- run unit tests on the project -->
<target name="test" depends="compile">
<junit printsummary="yes" haltonfailure="yes" fork="off">
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
<pathelement location="${build}/src/${proj.name.unix}-${proj.version}.jar" />
<pathelement location="${build}/test/${proj.name.unix}-${proj.version}.test.jar" />
</classpath>
<formatter type="plain"/>
<batchtest>
<fileset dir="${build}/test/classes">
<include name="**/*.class" />
</fileset>
</batchtest>
</junit>
<delete>
<fileset dir=".">
<include name="TEST*" />
</fileset>
</delete>
</target>
<!-- prepare the project for distribution -->
<target name="dist" depends="compile">
<!-- ***************************** src ***************************** -->
<!-- Create the javadocs -->
<javadoc
sourcepath="${src}"
destdir="${doc}"
excludepackagenames="${proj.name}.exampleapp">
<classpath>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
</javadoc>
<!-- Sync the project (minus some dirs) to the dist src tree -->
<sync todir="${dist}/${proj.name.unix}-src-${proj.version}">
<fileset
dir="${basedir}"
excludes="bin/ build/ dist/ conf/local.properties TEST*" />
</sync>
<!-- Tar the dist src tree -->
<tar
destfile="${dist}/${proj.name.unix}-src-${proj.version}.tar.gz"
basedir="${dist}"
compression="gzip"
includes="${proj.name.unix}-src-${proj.version}/**" />
<!-- ***************************** src ***************************** -->
<!-- ***************************** bin ***************************** -->
<!-- Sync the lib directory to the dist bin tree -->
<sync todir="${dist}/${proj.name.unix}-bin-${proj.version}/lib">
<fileset dir="lib/" />
</sync>
<!-- Sync the javadocs to the dist bin tree -->
<sync todir="${dist}/${proj.name.unix}-bin-${proj.version}/doc">
<fileset dir="${doc}" />
</sync>
<!-- copy the readme and license file into the dist dir -->
<copy
file="README.txt"
todir="${dist}/${proj.name.unix}-bin-${proj.version}" />
<copy
file="LICENSE.txt"
todir="${dist}/${proj.name.unix}-bin-${proj.version}" />
<copy
file="${build}/src/${proj.name.unix}-${proj.version}.jar"
todir="${dist}/${proj.name.unix}-bin-${proj.version}" />
<!-- Tar the dist bin tree -->
<tar
destfile="${dist}/${proj.name.unix}-bin-${proj.version}.tar.gz"
basedir="${dist}"
compression="gzip"
includes="${proj.name.unix}-bin-${proj.version}/**" />
<!-- ***************************** bin ***************************** -->
</target>
</project>