/[volute]/trunk/projects/theory/snapdm/build_java.xml
ViewVC logotype

Contents of /trunk/projects/theory/snapdm/build_java.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 363 - (show annotations)
Tue May 6 06:11:04 2008 UTC (12 years, 6 months ago) by bourges.laurent
File MIME type: text/xml
File size: 10622 byte(s)
java test code moved to folder test/java
added ivoa-test.jar library (depends on ivoa-base & ivoa-snap)
1 <!--
2 build_java.xml file : specific targets for java code
3 -->
4 <property name="jalopyConvention" location="${libs}/ant/jalopy-java-laurent.xml" />
5
6 <!-- class paths for base classes -->
7 <path id="project.class.path">
8 <pathelement location="${libs}/commons-logging-1.1.jar" />
9 <pathelement location="${libs}/log4j-1.2.15.jar" />
10 <pathelement location="${libs}/eclipselink.jar" />
11 <pathelement location="${libs}/persistence.jar" />
12 </path>
13
14 <!-- class paths for generated classes -->
15 <path id="infrastructure.class.path">
16 <path refid="project.class.path" />
17 <pathelement location="${dist}/${build.file}" />
18 <pathelement location="${libs}/jdbc/postgresql-8.3-603.jdbc3.jar" />
19 <pathelement location="${libs}/jdbc/sqljdbc-2005-1.2.jar" />
20 </path>
21
22 <!-- class paths for runtime -->
23 <path id="runtime.class.path">
24 <path refid="infrastructure.class.path" />
25 <pathelement location="${sources.gen.dist}/${build.gen.file}" />
26 <pathelement location="${properties}" />
27 </path>
28
29
30 <!-- checks if build is necessary : java source code & libraries -->
31 <uptodate property="build.base.notRequired">
32 <srcfiles dir= "${root}" includes="build.properties"/>
33 <srcfiles dir= "${sources}" includes="**/*"/>
34 <srcfiles dir= "${libs}" includes="**/*.jar"/>
35 <mapper type="merge" to="${dist}/${build.file}"/>
36 </uptodate>
37
38
39 <!-- defines Jalopy task -->
40 <taskdef name="jalopy"
41 classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
42 <classpath>
43 <pathelement location="${libs}/ant/jalopy.jar" />
44 <pathelement location="${libs}/ant/jalopy-ant.jar" />
45 <pathelement location="${libs}/log4j-1.2.15.jar"/>
46 </classpath>
47 </taskdef>
48
49
50
51
52 <!-- target makeJava : cleans, compiles java code -->
53 <target name="makeJava" depends="compile">
54 <echo>makeJava : done.</echo>
55 </target>
56
57
58
59
60 <!-- target cleanJava : clean build files -->
61 <target name="cleanJava" depends="init, cleanDist">
62 <echo>cleaning directory : ${build} ...</echo>
63
64 <delete includeemptydirs="false" verbose="true">
65 <fileset dir="${build}" includes="**/*"/>
66 </delete>
67
68 <echo>cleaned directory : ${build} : done.</echo>
69 </target>
70
71
72
73
74 <!-- target cleanDist : clean build files -->
75 <target name="cleanDist" depends="init">
76 <echo>cleaning directory : ${dist} ...</echo>
77
78 <delete includeemptydirs="false" verbose="true">
79 <fileset dir="${dist}" includes="**/*"/>
80 </delete>
81
82 <echo>cleaned directory : ${dist} : done.</echo>
83 </target>
84
85
86
87
88
89 <!-- Compile java files and jar them -->
90 <target name="compile" depends="cleanJava">
91 <echo>compile ${base.title} ...</echo>
92 <echo>compile from : ${sources}</echo>
93 <echo>compile to : ${build.src}</echo>
94
95 <mkdir dir="${build.src}"/>
96
97 <javac sourcepath="" srcdir="${sources}" destdir="${build.src}" listfiles="false"
98 fork="true" verbose="false" encoding="UTF-8"
99 debug="on" deprecation="on" optimize="on" casesensitive="true"
100 source="1.5" target="1.5">
101
102 <classpath refid="project.class.path" />
103
104 <include name="**/*.java"/>
105 </javac>
106
107 <pathconvert pathsep=" " property="jar.classpath">
108 <path refid="project.class.path"/>
109 <map from="${root}/" to=""/>
110 </pathconvert>
111
112 <jar jarfile="${dist}/${build.file}" compress="true">
113 <fileset dir="${build.src}" />
114 <fileset file="${properties}/global.properties" />
115 <fileset file="${properties}/log4j.*" />
116
117 <manifest>
118 <attribute name="Built-By" value="${build.by}"/>
119 <attribute name="Built-Date" value="${build.date}"/>
120
121 <attribute name="Build-Jdk" value="${java.vm.version}"/>
122 <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>
123
124 <attribute name="Class-Path" value="${jar.classpath}"/>
125
126 <section name="Common">
127 <attribute name="Specification-Title" value="${base.title}"/>
128 <attribute name="Specification-Version" value="${version}"/>
129 <attribute name="Specification-Vendor" value="${vendor}"/>
130 <attribute name="Implementation-Title" value="${base.title}"/>
131 <attribute name="Implementation-Version" value="${version} - ${build.date}"/>
132 </section>
133 </manifest>
134
135 </jar>
136
137 <delete dir="${build.src}"/>
138
139 <echo>compile ${base.title} : done.</echo>
140 </target>
141
142
143
144
145 <!-- target makeOutput : compiles generated java code and javadoc -->
146 <target name="makeOutput" depends="makeJava, compileOutput, format, makeJavaDoc">
147 <echo>makeOutput : done.</echo>
148 </target>
149
150
151
152
153 <!-- Compile generated java files -->
154 <target name="compileOutput">
155 <echo>compile ${gen.title} ...</echo>
156 <echo>compile from : ${sources.gen}</echo>
157 <echo>compile to : ${build.gen}</echo>
158
159 <mkdir dir="${build.gen}"/>
160
161 <javac sourcepath="" srcdir="${sources.gen}" destdir="${build.gen}" listfiles="false"
162 fork="true" verbose="false" encoding="UTF-8"
163 debug="on" deprecation="on" optimize="on" casesensitive="true"
164 source="1.5" target="1.5">
165
166 <classpath refid="infrastructure.class.path" />
167
168 <include name="**/*.java"/>
169 </javac>
170
171 <pathconvert pathsep=" " property="jar.gen.classpath">
172 <path refid="infrastructure.class.path"/>
173 <map from="${dist}/" to=""/>
174 </pathconvert>
175
176 <jar jarfile="${sources.gen.dist}/${build.gen.file}" compress="true">
177 <fileset dir="${build.gen}" />
178 <fileset dir="${outputJava}">
179 <include name="META-INF/*.*"/>
180 </fileset>
181
182 <manifest>
183 <attribute name="Built-By" value="${build.by}"/>
184 <attribute name="Built-Date" value="${build.date}"/>
185
186 <attribute name="Build-Jdk" value="${java.vm.version}"/>
187 <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>
188
189 <attribute name="Class-Path" value="${jar.gen.classpath}"/>
190
191 <section name="Common">
192 <attribute name="Specification-Title" value="${gen.title}"/>
193 <attribute name="Specification-Version" value="${version}"/>
194 <attribute name="Specification-Vendor" value="${vendor}"/>
195 <attribute name="Implementation-Title" value="${gen.title}"/>
196 <attribute name="Implementation-Version" value="${version} - ${build.date}"/>
197 </section>
198 </manifest>
199
200 </jar>
201
202 <!-- remove to avoid classes in svn -->
203 <delete dir="${build.gen}"/>
204
205 <echo>compile ${gen.title} : done.</echo>
206 </target>
207
208
209
210
211 <!-- target makeJavaDoc : creates javadoc from source code -->
212 <target name="makeJavaDoc">
213 <echo>making generated Java classes javadoc ...</echo>
214
215 <mkdir dir="${sources.gen.docs}"/>
216
217 <javadoc additionalparam="-notimestamp"
218 destdir="${sources.gen.docs}"
219 access="private"
220 author="true"
221 encoding="UTF-8"
222 use="false"
223 windowtitle="${source} : ${gen.title}" >
224
225 <classpath refid="project.class.path" />
226
227 <fileset dir="${sources}" defaultexcludes="yes" includes="**/*.java" />
228 <fileset dir="${sources.gen}" defaultexcludes="yes" includes="**/*.java" />
229
230 </javadoc>
231
232 <echo>generated Java classes javadoc : done.</echo>
233 </target>
234
235
236
237
238 <!-- target format : formats all generated java sources -->
239 <target name="format">
240 <!--
241 Invokes Jalopy as follows:
242
243 - All formatted files will have unix fileformat (\n)
244 - Load your code convention from the given url
245 - Override the convention to use loglevel "info"
246 - Override the convention to use 2 threads
247 - The import optimization feature will work (if enabled in the active
248 convention), because a classpath reference is specified
249
250 Don't forget to setup an include pattern as Jalopy truly expects
251 valid Java source files as input!
252
253
254 -->
255 <jalopy fileformat="unix"
256 convention="${jalopyConvention}"
257 encoding="UTF-8"
258 failonerror="false"
259 history="NONE"
260 loglevel="warn"
261 threads="1"
262 classpathref="infrastructure.class.path">
263 <fileset dir="${sources.gen}">
264 <include name="**/*.java" />
265 </fileset>
266 </jalopy>
267 </target>
268
269
270
271
272 <!-- Compile Unit Tests -->
273 <target name="compileTest">
274 <echo>compile tests ...</echo>
275 <echo>compile from : ${sources.test}</echo>
276 <echo>compile to : ${build.test}</echo>
277
278 <mkdir dir="${build.test}"/>
279
280 <javac sourcepath="" srcdir="${sources.test}" destdir="${build.test}" listfiles="false"
281 fork="true" verbose="false" encoding="UTF-8"
282 debug="on" deprecation="on" optimize="on" casesensitive="true"
283 source="1.5" target="1.5">
284
285 <classpath refid="runtime.class.path" />
286
287 <include name="**/*.java"/>
288 </javac>
289
290 <jar jarfile="${dist}/${build.test.file}" compress="true">
291 <fileset dir="${build.test}" />
292
293 <manifest>
294 <attribute name="Built-By" value="${build.by}"/>
295 <attribute name="Built-Date" value="${build.date}"/>
296
297 <attribute name="Build-Jdk" value="${java.vm.version}"/>
298 <attribute name="Build-Os" value="${os.name} ${os.version} - ${os.arch}"/>
299
300 <attribute name="Main-Class" value="org.ivoa.test.Main"/>
301
302 <section name="Common">
303 <attribute name="Specification-Title" value="${gen.title}"/>
304 <attribute name="Specification-Version" value="${version}"/>
305 <attribute name="Specification-Vendor" value="${vendor}"/>
306 <attribute name="Implementation-Title" value="${gen.title}"/>
307 <attribute name="Implementation-Version" value="${version} - ${build.date}"/>
308 </section>
309 </manifest>
310
311 </jar>
312
313 <!-- remove to avoid classes in svn -->
314 <delete dir="${build.test}"/>
315
316 <echo>compile tests : done.</echo>
317 </target>
318
319
320
321
322 <!-- target run : launches deployed application on Unix environment (bash used) -->
323 <target name="run">
324 <echo message="running ${gen.title} ..."/>
325
326 <delete file="${build}/root.log" />
327
328 <java classname="org.ivoa.test.Main" dir="${build}" fork="true" failonerror="true">
329 <jvmarg value="-Xms128m"/>
330 <jvmarg value="-Xmx384m"/>
331 <classpath>
332 <path refid="runtime.class.path" />
333 <pathelement location="${dist}/${build.test.file}" />
334 </classpath>
335 </java>
336
337 <echo message="run ${gen.title} : terminated."/>
338 </target>
339
340
341 <!-- end of build_java.xml -->

msdemlei@ari.uni-heidelberg.de
ViewVC Help
Powered by ViewVC 1.1.26