New upstream release.
[debian/jabref.git] / build.xml
1 <?xml version="1.0"?>
2 <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3    Filename: $RCSfile$
4    Purpose:  Ant build file for Jabref.
5
6              Ant-Download: http://jakarta.apache.org/ant
7              Ant-Manual:   http://jakarta.apache.org/ant/manual/index.html
8
9              Jabref-Homepage:    http://jabref.sourceforge.net
10              Jabref@SourceForge: http://sourceforge.net/projects/jabref
11              Jabref@FreshMeat:   http://freshmeat.net
12              Jabref-CVSRoot:     :pserver:anonymous@cvs.jabref.sourceforge.net:/cvsroot/jabref
13
14              Further questions:
15                help mailing list:      must be inserted
16
17    Precondition: 1. Ant should be installed.
18                  2. JAVA_HOME environment variable contains the path to JDK1.5 or higher
19                  3. ANT_HOME environment variable contains the path to ant's home directory
20
21    Language: XML
22    Compiler: Ant
23    Authors:  Joerg K. Wegner, wegnerj@informatik.uni-tuebingen.de
24              Morten O. Alver
25    Version:  $Revision: 2460 $
26              $Date: 2007-11-04 16:58:28 +0100 (Sun, 04 Nov 2007) $
27              $Author: mortenalver $
28
29    modified:
30              23.11.2006 c.oezbek
31              - tried to fix classpath issues
32              28.07.2005 r.nagel
33              - insert dynamic build info generation (resource/build.properties)
34              - copy fonts directory, used by the new about dialog
35              - change static "version" into mainfest file into ${jabref.version}
36              09.06.2005 r.nagel
37              - bugfix, first it should be made a rebuild of the build directory
38              and then a jar should be generated from this directory
39              - take all files for the jar archive !!! FROM BUILD directory !!!
40
41 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
42
43 <project name="JabRef" default="jars" basedir=".">
44
45         <!-- ==========================================================================================
46         PROPERTY SETUP
47      ========================================================================================== -->
48
49         <!-- some version information -->
50         <property name="jabref.version" value="2.3.1" />
51         <property name="jabref.placeholder.version" value="@version@" />
52         <!-- used by replace task -->
53
54
55         <!-- Set the properties for intermediate directory -->
56         <property name="build.jar" value="JabRef-${jabref.version}.jar" />
57         <property name="build.dir" value="build" />
58         <property name="build.classes" value="${build.dir}/classes" />
59         <property name="build.tmp" value="${build.dir}/tmp" />
60         <property name="build.osx" value="${build.dir}/classes/osxadapter" />
61         <property name="build.lib" value="${build.dir}/lib" />
62         <property name="build.win" value="${build.dir}/windows" />
63         <property name="build.images" value="${build.dir}/images" />
64         <property name="build.fonts" value="${build.dir}/images/font" />
65         <property name="build.resource" value="${build.dir}/resource" />
66         <property name="build.help" value="${build.dir}/help" />
67         <property name="build.javadocs" value="${build.dir}/docs/API" />
68         <property name="build.extensions" value="${build.dir}/extensions" />
69         <property name="build.extension-javadocs" value="${build.extensions}/API" />
70         <property name="build.extension-layout" value="${build.extensions}/layout" />
71         <property name="build.openoffice.meta" value="${build.resource}/openoffice" />
72
73         <!-- Set the properties for source directories -->
74         <property name="src.dir" value="src" />
75         <property name="src.tests" value="src/java/tests" />
76         <property name="txt.dir" value="src/txt" />
77         <property name="java.dir" value="${src.dir}/java" />
78         <property name="osx.dir" value="${src.dir}/osx" />
79         <property name="win.installer.dir" value="${src.dir}/windows/nsis" />
80         <property name="resource.dir" value="${src.dir}/resource" />
81         <property name="bin.dir" value="${src.dir}/scripts" />
82         <property name="images.dir" value="${src.dir}/images" />
83         <property name="fonts.dir" value="${src.dir}/images/font" />
84         <property name="help.dir" value="${src.dir}/help" />
85         <property name="extensions.dir" value="${src.dir}/extensions" />
86         <property name="layout.dir" value="${src.dir}/resource/layout" />
87
88         <!-- Set the properties for library directories -->
89         <property name="library.directory" value="lib" />
90
91 <!--    <property name="nsis.executable" value="makensis.exe"/> -->
92         <property name="nsis.executable.linux" value="makensis"/>
93
94         <!-- Load user dependent properties -->
95         <!-- For instance to redefine the NSIS-compiler write 
96                 nsis.executable="d:\prog\dev\NSIS\makensis.exe"
97           -->
98         <property file="user.properties" />
99
100         <!-- win.installer can only be build under Windows if the nsis.executable is found -->
101         <condition property="is.windows">
102                 <and>
103                         <os family="windows" />
104                         <isset property="nsis.executable" />
105                 </and>
106         </condition>
107
108         <taskdef name="jarbundler" classpath="${library.directory}/jarbundler-1.4.jar" classname="com.loomcom.ant.tasks.jarbundler.JarBundler" />
109
110
111         <!-- Build classpath -->
112         <path id="classpath">
113                 <pathelement path="${build.classes}" />
114                 <pathelement path="${build.dir}" />
115                 <pathelement location="${library.directory}/antlr.jar" />
116                 <pathelement location="${library.directory}/antlr-3.0b5.jar" />
117                 <pathelement location="${library.directory}/looks-2.0.4.jar" />
118                 <pathelement location="${library.directory}/forms-1.1.0.jar" />
119                 <pathelement location="${library.directory}/spin.jar" />
120                 <pathelement location="${library.directory}/glazedlists-1.7.0_java15.jar" />
121                 <pathelement location="${library.directory}/microba.jar" />
122                 <pathelement location="${library.directory}/PDFBox-0.7.3-dev-reduced.jar" />
123                 <pathelement location="${library.directory}/JempBox-0.1.0-dev.jar" />
124         </path>
125
126         <target name="run" depends="build">
127                 <java classname="net.sf.jabref.JabRefMain" fork="true">
128                         <classpath refid="classpath" />
129                 </java>
130         </target>
131
132         <!-- Runs project -->
133         <target name="runFromJar" depends="jars">
134                 <java classname="net.sf.jabref.JabRefMain" fork="true">
135                         <classpath>
136                                 <pathelement location="${build.lib}/${build.jar}" />
137                         </classpath>
138                 </java>
139         </target>
140
141         <target name="profile" depends="jars" description="Profile JabRef">
142                 <fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
143
144                 <nbprofiledirect>
145                         <classpath refid="classpath" />
146                 </nbprofiledirect>
147
148                 <property environment="env" />
149                 <java fork="true" classname="net.sf.jabref.JabRef" dir="${build.dir}" jvm="${profiler.info.jvm}">
150                         <jvmarg value="${profiler.info.jvmargs.agent}" />
151                         <jvmarg line="${profiler.info.jvmargs}" />
152                         <env key="LD_LIBRARY_PATH" path="${profiler.info.agentpath}:${env.LD_LIBRARY_PATH}" />
153                         <classpath refid="classpath" />
154                 </java>
155         </target>
156
157         <!-- Compiles project -->
158         <target name="compile">
159                 <mkdir dir="${build.classes}" />
160                 <javac debug="off" deprecation="on" destdir="${build.classes}" source="1.5" target="1.5">
161                         <src path="${java.dir}" />
162                         <exclude name="tests/**" />
163                         <exclude name="**/JabRefMain.java" />
164                         <classpath refid="classpath" />
165                 </javac>
166                 <javac debug="off" deprecation="on" destdir="${build.classes}" source="1.4" target="1.4">
167                   <src path="${java.dir}" />
168                   <include name="**/JabRefMain.java" />
169                 </javac>
170
171         </target>
172
173         <!-- Compiles only the tests -->
174         <target name="compiletest">
175                 <mkdir dir="${build.classes}" />
176                 <!--deprecation="on"-->
177                 <javac srcdir="${java.dir}/tests" debug="off" destdir="${build.classes}" source="1.5" target="1.5">
178                         <classpath refid="classpath" />
179                 </javac>
180         </target>
181
182         <!-- Builds the OSXAdapter -->
183         <target name="osx">
184                 <mkdir dir="${build.classes}" />
185
186                 <javac srcdir="${osx.dir}" debug="on" destdir="${build.classes}" target="1.5">
187                 </javac>
188         </target>
189
190         <!-- Copies in the OSXAdapter class, which is compilable only on Mac  -->
191         <target name="non_osx">
192                 <mkdir dir="${build.osx}" />
193                 <copy file="${library.directory}/OSXAdapter.class" todir="${build.osx}" />
194         </target>
195
196         <!-- Jars up project -->
197         <target name="jars" depends="build, unjarlib">
198                 <mkdir dir="${build.lib}" />
199                 <mkdir dir="${build.tmp}" />
200                 <jar destfile="${build.lib}/${build.jar}">
201
202                         <fileset dir="${build.classes}" />
203                         <fileset dir="${build.tmp}" />
204                         <fileset dir="${build.dir}">
205                                 <include name="images/**" />
206                                 <include name="help/**" />
207                                 <include name="help/de/**" />
208                                 <include name="help/no/**" />
209                                 <include name="resource/**" />
210                         </fileset>
211                         <fileset dir="${library.directory}">
212                                 <include name="EndNote.zip" />
213                         </fileset>
214                         <fileset dir="${txt.dir}">
215                                 <include name="gpl.txt" />
216                                 <include name="lesser.txt" />
217                                 <include name="jgoodies.txt" />
218                                 <include name="README" />
219                         </fileset>
220                         <manifest>
221                                 <attribute name="Main-Class" value="net.sf.jabref.JabRefMain" />
222                         </manifest>
223                 </jar>
224
225         </target>
226
227         <!-- copy all necessary files and insert version informations -->
228         <target name="build" depends="compile, buildinfos" description="Build project">
229
230                 <mkdir dir="${build.resource}" />
231
232                 <copy todir="${build.resource}">
233                         <fileset dir="${resource.dir}">
234                                 <include name="**" />
235                         </fileset>
236                 </copy>
237                 <mkdir dir="${build.images}" />
238                 <copy todir="${build.images}">
239                         <fileset dir="${images.dir}">
240                                 <include name="**" />
241                         </fileset>
242                 </copy>
243
244                 <!-- the fonts are used by the new about dialog
245                 <mkdir dir="${build.fonts}" />
246                 <copy todir="${build.fonts}">
247                         <fileset dir="${fonts.dir}">
248                                 <include name="*" />
249                         </fileset>
250                 </copy> -->
251
252                 <mkdir dir="${build.help}" />
253                 <copy todir="${build.help}">
254                         <fileset dir="${help.dir}">
255                                 <!--<include name="*" />-->
256                         </fileset>
257                 </copy>
258
259                 <!-- Insert version informations -->
260                 <replace dir="${build.help}" token="${jabref.placeholder.version}" value="${jabref.version}">
261                         <include name="**/About.html" />
262                 </replace>
263                 <replace dir="${build.openoffice.meta}" token="${jabref.placeholder.version}" value="${jabref.version}">
264                         <include name="meta.xml" />
265                 </replace>
266
267         </target>
268
269         <!-- generate and save some build infos !!! necessary for dynamic build infos !!! -->
270         <!-- todo : replace it by the replace task :-),
271           src/resource/build.properties = template
272           build/resource/build.properties = real info file
273         -->
274         <target name="buildinfos">
275                 <tstamp />
276                 <!-- get date -->
277                 <buildnumber />
278                 <!-- generate new build number -> build.number -->
279                 <echo message="build number = ${build.number}" />
280                 <!-- write the file, please do not edit this lines -->
281                 <echo file="${resource.dir}/build.properties">builddate=${TODAY}
282 build=${build.number}
283 version=${jabref.version}</echo>
284         </target>
285
286
287         <!-- Creates all docs -->
288         <target name="docs" depends="javadocs" description="Generates all the documentation" />
289
290         <!-- Creates javadocs -->
291         <target name="javadocs" depends="compile" description="Generates the javadocs">
292                 <mkdir dir="${build.javadocs}" />
293                 <javadoc sourcepath="${java.dir}" destdir="${build.javadocs}" author="true" version="true" windowtitle="JabRef API" link="http://java.sun.com/j2se/1.4.1/docs/api/">
294
295                         <fileset dir="${java.dir}" defaultexcludes="yes">
296                                 <include name="**/*.java" />
297                         </fileset>
298
299                         <classpath refid="classpath" />
300                 </javadoc>
301         </target>
302
303         <!-- Creates javadocs for the extensions -->
304         <target name="extension-javadocs" depends="build" description="Generates the javadocs for the extensions archive">
305                 <mkdir dir="${build.extension-javadocs}" />
306                 <copy todir="${build.extension-javadocs}">
307                         <fileset dir="${help.dir}" defaultexcludes="yes">
308                                 <include name="CustomExports.html" />
309                                 <include name="CustomImports.html" />
310                         </fileset>
311                 </copy>
312
313                 <javadoc sourcepath="${java.dir}" destdir="${build.extension-javadocs}" author="true" version="true" windowtitle="JabRef-Extensions API" link="http://java.sun.com/j2se/1.4.1/docs/api/" Overview="${extensions.dir}/API/overview.html" access="protected">
314                         <!-- 
315                  create javadoc only selectively for classes that 
316                  users extending JabRef are likely to use
317               -->
318                         <fileset dir="${java.dir}" defaultexcludes="yes">
319                                 <include name="net/sf/jabref/imports/ImportFormat.java" />
320                                 <include name="net/sf/jabref/imports/ImportFormatReader.java" />
321                                 <include name="net/sf/jabref/BibtexEntry.java" />
322                                 <include name="net/sf/jabref/BibtexEntryType.java" />
323                                 <include name="net/sf/jabref/AuthorList.java" />
324                                 <include name="net/sf/jabref/AuthorList.java" />
325                                 <include name="net/sf/jabref/export/layout/LayoutFormatter.java" />
326                         </fileset>
327
328                         <classpath refid="classpath" />
329                 </javadoc>
330         </target>
331
332         <!-- Creates javadocs for the extensions -->
333         <target name="extensions" depends="extension-javadocs" description="Generates the extensions archive">
334                 <!-- copy examples -->
335                 <copy todir="${build.extensions}">
336                         <fileset dir="${java.dir}">
337                                 <include name="net/sf/jabref/export/layout/format/CurrentDate.java" />
338                                 <include name="net/sf/jabref/export/layout/format/ToLowerCase.java" />
339                                 <include name="net/sf/jabref/export/layout/format/HTMLChars.java" />
340                                 <include name="net/sf/jabref/imports/*Importer.java" />
341                         </fileset>
342                 </copy>
343                 <mkdir dir="${build.extension-layout}" />
344                 <copy todir="${build.extension-layout}">
345                         <fileset dir="${layout.dir}" />
346                 </copy>
347                 <copy todir="${build.extensions}">
348                         <fileset dir="${extensions.dir}" />
349                         <filterset>
350                                 <filter token="version" value="${jabref.version}" />
351                         </filterset>
352                 </copy>
353                 <!-- create extensions-zip file -->
354                 <zip destfile="${build.dir}/jabref-extensions.zip">
355                         <zipfileset dir="${build.extensions}" prefix="jabref-extensions" />
356                 </zip>
357         </target>
358
359         <target name="clean" depends="win.installer.clean" description="Clean project">
360                 <delete dir="${build.dir}" />
361         </target>
362
363         <!-- Unpacks jar needed jar files from lib directory into temp directory. -->
364         <target name="unjarlib" description="Unpacks jars from library">
365                 <mkdir dir="${build.tmp}" />
366                 <unjar src="${library.directory}/antlr.jar" dest="${build.tmp}" />
367                 <unjar src="${library.directory}/antlr-3.0b5.jar" dest="${build.tmp}" />
368                 <unjar src="${library.directory}/looks-2.0.4.jar" dest="${build.tmp}" />
369                 <unjar src="${library.directory}/forms-1.1.0.jar" dest="${build.tmp}" />
370                 <unjar src="${library.directory}/spin.jar" dest="${build.tmp}" />
371                 <unjar src="${library.directory}/glazedlists-1.7.0_java15.jar" dest="${build.tmp}" />
372                 <unjar src="${library.directory}/microba.jar" dest="${build.tmp}" />
373                 <unjar src="${library.directory}/PDFBox-0.7.3-dev-reduced.jar" dest="${build.tmp}" />
374                 <unjar src="${library.directory}/JempBox-0.1.0-dev.jar" dest="${build.tmp}" />
375                 <delete dir="${build.tmp}/META-INF" />
376                 <!-- rename the microba license file -->
377                 <move file="${build.tmp}/license.txt" tofile="${build.tmp}/microba-license.txt" />
378         </target>
379
380
381         <target name="osxjar">
382                 <jarbundler dir="${build.lib}" name="JabRef" mainclass="net.sf.jabref.JabRef" jars="${build.lib}/${build.jar}" icon="${images.dir}/JabRef-Logo.icns" version="${jabref.version}" jvmversion="1.4+" stubfile="${library.directory}/JavaApplicationStub" />
383         </target>
384
385
386         <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
387         <!-- Build Windows Installer                                                    -->
388         <!--                                                                            -->
389         <!-- Don't forget to set nsis.executable property                               -->
390         <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
391
392         <target name="win.installer.clean" description="Delete Installer and Exe-Wrapper + Temp-files">
393                 <delete failonerror="false" dir="${win.installer.dir}/dist" />
394                 <delete file="${win.installer.dir}/JabRefSetup.exe" />
395         </target>
396
397         <target name="win.installer" description="Copy files in place to be used by the installer" depends="jars">
398
399                 <fail unless="is.windows" message="Not running on windows or NSIS not found. Please make sure that user.properties exists"/>
400                 
401                 <!-- Gather everything that will go into the installer in dist -->
402                 <mkdir dir="${win.installer.dir}/dist" />
403
404                 <copy file="${build.lib}/${build.jar}" 
405                 todir="${win.installer.dir}/dist" />
406
407                 <available property="win.installer.jar.available" file="${win.installer.dir}/dist/${build.jar}"/>
408                 
409                 <fail unless="win.installer.jar.available" message="Did not find jar: ${build.jar}"/>
410                 
411                 <copy todir="${win.installer.dir}/dist">
412                         <fileset dir="${txt.dir}">
413                                 <include name="gpl.txt" />
414                                 <include name="lesser.txt" />
415                                 <include name="README" />
416                         </fileset>
417                 </copy>
418
419                 <!-- "Create Exe-Wrapper" -->
420                 <exec dir="." executable="${nsis.executable}" failonerror="true">
421                         <arg line="'/DJARFILE=${build.jar}' '/DVERSION=${jabref.version}' '/DAPPICON=../../../${images.dir}/JabRef.ico' ${win.installer.dir}/launcher.nsi" />
422                 </exec>
423
424                 <!-- Finally create Windows-Installer -->
425                 <exec dir="." executable="${nsis.executable}" failonerror="true">
426                         <arg line="'/DVERSION=${jabref.version}' ${win.installer.dir}/setup.nsi" />
427                 </exec>
428                 
429                 <delete dir="${win.installer.dir}/dist" />
430                 
431         </target>
432
433         <target name="win.installer.linux" description="Copy files in place to be used by the installer" depends="jars">
434
435                 <!-- Gather everything that will go into the installer in dist -->
436                 <mkdir dir="${win.installer.dir}/dist" />
437
438                 <copy file="${build.lib}/${build.jar}" todir="${win.installer.dir}/dist" />
439
440                 <available property="win.installer.jar.available" file="${win.installer.dir}/dist/${build.jar}" />
441
442                 <fail unless="win.installer.jar.available" message="Did not find jar: ${build.jar}" />
443
444                 <copy todir="${win.installer.dir}/dist">
445                         <fileset dir="${txt.dir}">
446                                 <include name="gpl.txt" />
447                                 <include name="lesser.txt" />
448                                 <include name="README" />
449                         </fileset>
450                 </copy>
451
452                 <!-- "Create Exe-Wrapper" -->
453                 <exec dir="." executable="${nsis.executable.linux}" failonerror="true">
454                   <arg line="'-DJARFILE=${build.jar}' '-DVERSION=${jabref.version}' '-DAPPICON=../../../${images.dir}/JabRef.ico' ${win.installer.dir}/launcher.nsi" />
455                 </exec>
456
457                 <!-- Finally create Windows-Installer -->
458                 <exec dir="." executable="${nsis.executable.linux}" failonerror="true">
459                         <arg line="'-DVERSION=${jabref.version}' ${win.installer.dir}/setup.nsi" />
460                 </exec>
461
462                 <delete dir="${win.installer.dir}/dist" />
463
464         </target>
465
466         <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
467         What's about the software design ?!;-)
468     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
469
470         <target name="pmd" description="SOFTWAREDESIGN: Project Mess Detector !;-)">
471                 <echo>Checking Project Mess Detection (PMD) rulesets.</echo>
472                 <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
473                         <classpath>
474                                 <pathelement path="${classpath}" />
475                                 <fileset dir="${library.directory}">
476                                         <include name="*.jar" />
477                                 </fileset>
478                         </classpath>
479                 </taskdef>
480                 <!-- allowed Pretty Much Done rulsets -->
481                 <!-- rulesets/basic.xml -->
482                 <!-- rulesets/braces.xml -->
483                 <!-- rulesets/codesize.xml-->
484                 <!-- rulesets/controversial.xml-->
485                 <!-- rulesets/coupling.xml-->
486                 <!-- rulesets/design.xml -->
487                 <!-- rulesets/experimental.xml -->
488                 <!-- rulesets/favorites.xml -->
489                 <!-- rulesets/imports.xml -->
490                 <!-- rulesets/naming.xml -->
491                 <!-- rulesets/javabean.xml -->
492                 <!-- rulesets/junit.xml -->
493                 <!-- rulesets/scratchpad.xml -->
494                 <!-- rulesets/strictexception.xml -->
495                 <!-- rulesets/strings.xml -->
496                 <!-- rulesets/unusedcode.xml -->
497
498                 <pmd rulesetfiles="rulesets/unusedcode.xml,rulesets/basic.xml" failonerror="no">
499                         <formatter type="html" toFile="${build.dir}/pmd_report.html" />
500                         <fileset dir="${src.dir}">
501                                 <include name="**/*.java" />
502                         </fileset>
503                 </pmd>
504
505                 <!-- check for duplicated code -->
506                 <echo>WARNING: use environment variable: ANT_OPTS=-Xmx512m or this task will fail.</echo>
507                 <echo>Checking for duplicated code using the Copy/Paste Detector (CPD).</echo>
508                 <taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask">
509                         <classpath>
510                                 <pathelement path="${classpath}" />
511                                 <fileset dir="${library.directory}">
512                                         <include name="*.jar" />
513                                 </fileset>
514                         </classpath>
515                 </taskdef>
516                 <cpd format="text" minimumTokenCount="100" outputFile="${build.dir}/duplicated_code_report.txt">
517                         <fileset dir="${src.dir}">
518                                 <include name="**/*.java" />
519                         </fileset>
520                 </cpd>
521         </target>
522
523
524         <target name="javancss" description="SOFTWAREDESIGN: Determining the NCSS and CCN code metrics for JOELib.">
525                 <taskdef name="javancss" classname="javancss.JavancssAntTask">
526                         <classpath>
527                                 <pathelement path="${classpath}" />
528                                 <fileset dir="${library.directory}">
529                                         <include name="*.jar" />
530                                 </fileset>
531                         </classpath>
532                 </taskdef>
533                 <echo>Cyclomatic
534 Complexity             Ease of       Risk
535 Number (CCN)           maintenance
536 (McCabe metric)
537 ---------------------------------------------
538 1-10, simple           easy          minimum
539 11-20, complex         moderate      moderate
540 21-50, more complex    hard          high
541 >50, unstable          very hard     very high
542
543 </echo>
544                 <javancss srcdir="${src.dir}" includes="**/*.java" excludes="jama/**/*.java, jmat/**/*.java, cformat/**/*.java" abortOnFail="false" ccnPerFuncMax="30" generateReport="true" outputfile="${build.dir}/javancss_report.plain" format="plain" packageMetrics="true" classMetrics="false" functionMetrics="false" />
545         </target>
546
547         <target name="jalopy" description="SOFTWAREDESIGN: source code formatter using the JOELib convention.">
548                 <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
549                         <classpath>
550                                 <pathelement path="${classpath}" />
551                                 <fileset dir="${library.directory}">
552                                         <include name="*.jar" />
553                                 </fileset>
554                         </classpath>
555                 </taskdef>
556                 <jalopy fileformat="unix" convention="${src.dir}/java/jalopy.format.convention.xml" history="file" historymethod="adler32" loglevel="error" threads="2" classpathref="classpath" backup="bak">
557                         <fileset dir="${src.dir}">
558                                 <include name="java/net/sf/jabref/**/*.java" />
559                         </fileset>
560                 </jalopy>
561         </target>
562
563         <target name="test">
564                 <junit printsummary="yes" fork="yes" haltonfailure="no">
565                         <batchtest fork="yes" todir="/tmp/testres">
566                                 <fileset dir="${build.classes}">
567                                         <include name="**/*Tester.class" />
568                                         <include name="**/*Test.class" />
569                                 </fileset>
570                         </batchtest>
571                         <classpath refid="classpath" />
572                 </junit>
573         </target>
574
575 </project>