debian/rules: drop override_dh_installchangelogs.
[debian/jabref.git] / build.xml
1 <?xml version="1.0"?>
2 <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3    Filename: build.xml
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@FreeCode:       http://apps.freecode.com/projects/jabref
12              Jabref@Ohloh:          https://www.ohloh.net/p/jabref
13              Jabref git repository: git://jabref.git.sourceforge.net/gitroot/jabref/jabref
14
15              Further questions:
16                help mailing list:   https://lists.sourceforge.net/lists/listinfo/jabref-users
17
18    Precondition: 1. Ant should be installed.
19                  2. JAVA_HOME environment variable contains the path to JDK1.6 or higher
20                  3. ANT_HOME environment variable contains the path to ant's home directory
21
22    Language: XML
23    Compiler: Ant
24    Authors:  Joerg K. Wegner, wegnerj@informatik.uni-tuebingen.de
25              Morten O. Alver
26
27    modified: see at git checkout and "gitk build.xml"
28
29 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
30
31 <project name="JabRef" default="jars" basedir=".">
32
33         <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
34         PROPERTY SETUP
35      +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
36
37         <!-- some version information -->
38         <property name="jabref.version" value="2.11b" />
39         <property name="jabref.version.full" value="2.11.1.0" /> <!-- a version number with 4 places. Required by launch4j -->
40         <property name="jabref.year" value="2015" />
41         <property name="jabref.placeholder.version" value="@version@" />
42         <property name="jabref.placeholder.year" value="@year@" />
43         <!-- used by replace task -->
44
45         <!-- Set the properties for intermediate directory -->
46         <property name="build.jar" value="JabRef-${jabref.version}.jar" />
47         <property name="build.dir" value="buildant" />
48         <property name="build.classes" value="${build.dir}/classes" />
49         <property name="build.tmp" value="${build.dir}/tmp" />
50         <property name="build.classes.osx" value="${build.dir}/classes/osxadapter" />
51         <property name="build.lib" value="${build.dir}/lib" />
52         <property name="build.win" value="${build.dir}/windows" />
53         <property name="build.images" value="${build.dir}/images" />
54         <property name="build.resource" value="${build.dir}/resource" />
55         <property name="build.help" value="${build.dir}/help" />
56         <property name="build.extensions" value="${build.dir}/extensions" />
57         <property name="build.extension-javadocs" value="${build.extensions}/API" />
58         <property name="build.extension-layout" value="${build.extensions}/layout" />
59         <property name="build.openoffice.meta" value="${build.resource}/openoffice" />
60
61         <!-- Set the properties for source directories -->
62         <property name="resources.dir" value="src/main/resources" />
63         <property name="plugin.dir" value="${resources.dir}/plugins/" />
64         <property name="txt.dir" value="." />
65         <property name="java.dir" value="src/main/java" />
66     <property name="gen.dir" value="src/main/gen" />
67         <property name="osx.dir" value="${resources.dir}/osx" />
68         <property name="win.installer.dir" value="${resources.dir}/windows/nsis" />
69         <property name="resource.dir" value="${resources.dir}/resource" />
70         <property name="images.dir" value="${resources.dir}/images" />
71         <property name="help.dir" value="${resources.dir}/help" />
72         <property name="extensions.dir" value="${resources.dir}/extensions" />
73         <property name="layout.dir" value="${resources.dir}/resource/layout" />
74         <property name="lib.dir" value="lib" />
75         <property name="buildlib.dir" value="buildlib" />
76
77         <property name="osxbin.dir" value="osx" />
78
79         <!-- Load user dependent properties. Has to happen before setting the properties here -->
80         <!-- For instance to redefine the NSIS-compiler write
81                 nsis.executable="d:\\prog\\dev\\NSIS\\makensis.exe"
82           -->
83         <property file="user.properties" />
84
85         <property name="nsis.executable" value="C:\Program files\NSIS\makensis.exe"/>
86         <property name="nsis.executable.linux" value="makensis"/>
87         <property name="launch4j.dir" location="/opt/launch4j" />
88
89         <!-- win.installer can only be build under Windows if the nsis.executable is found -->
90         <condition property="is.windows">
91           <and>
92             <isset property="nsis.executable" />
93             <os family="windows" />
94           </and>
95         </condition>
96
97         <fileset id="jarsFileset" dir="${lib.dir}">
98                 <include name="antlr.jar" />
99                 <include name="antlr-3.4-complete.jar" />
100         <include name="jgoodies-common-1.4.0.jar" />
101                 <include name="jgoodies-looks-2.5.2.jar" />
102                 <include name="jgoodies-forms-1.6.0.jar" />
103         <include name="jgoodies/jgoodies-uif-lite.jar" />
104         <include name="jna-4.1.0.jar" />
105         <include name="ritopt/ritopt-0.2.1-bin.jar" />
106                 <include name="jayatana-1.2.4.jar" />
107                 <include name="spin.jar" />
108                 <include name="glazedlists-1.8.0_java15.jar" />
109                 <include name="microba.jar" />
110                 <include name="pdfbox-1.7.1.jar" />
111                 <include name="jempbox-1.7.1.jar" />
112                 <include name="fontbox-1.7.1.jar" />
113                 <include name="zoom-java.jar" />
114         <include name="mysql-connector-java-5.0.7-bin.jar" />
115                 <include name="postgresql-9.2-1002.jdbc4.jar" />
116         <!-- Plugin runtime dependencies -->
117                 <include name="plugin/JPFCodeGenerator-rt.jar" />
118                 <include name="plugin/jpf.jar" />
119                 <include name="plugin/jpf-boot.jar" />
120                 <include name="plugin/commons-logging.jar" />
121         </fileset>
122
123     <!-- Openoffice connection dependencies. Compile-time only -->
124     <fileset id="ooFileset" dir="${lib.dir}">
125         <include name="oo/unoil.jar" />
126         <include name="oo/ridl.jar" />
127         <include name="oo/juh.jar" />
128         <include name="oo/jurt.jar" />
129     </fileset>
130
131     <!-- Done by MrDlib -->
132     <fileset id="splJars" dir="${lib.dir}">
133         <include name="spl/**/*.jar" />
134     </fileset>
135         <fileset id="deletableMeta-InfFiles" dir="${build.tmp}/META-INF">
136                 <exclude name="services/**/*" />
137         </fileset>
138     <!-- Done by MrDlib -->
139
140         <!-- Build classpath -->
141         <path id="classpath">
142                 <pathelement path="${build.classes}" />
143                 <pathelement path="${build.dir}" />
144         <!-- Done by MrDlib -->
145         <fileset refid="splJars" />
146         <!-- Done by MrDlib -->
147                 <fileset refid="jarsFileset" />
148         <fileset refid="ooFileset" />
149         </path>
150
151         <target name="run" depends="build">
152                 <java classname="net.sf.jabref.JabRefMain" fork="true">
153                         <classpath refid="classpath" />
154                 </java>
155         </target>
156
157         <!-- Runs project -->
158         <target name="runFromJar">
159                 <java dir="${build.lib}" classname="net.sf.jabref.JabRefMain" fork="true">
160                         <classpath>
161                                 <pathelement location="${build.lib}/${build.jar}" />
162                         </classpath>
163                 </java>
164         </target>
165
166         <!-- Compiles project -->
167         <target name="compile">
168                 <mkdir dir="${build.classes}" />
169                 <javac destdir="${build.classes}" encoding="UTF8" source="1.6" target="1.6">
170                         <src path="${java.dir}" />
171             <src path="${gen.dir}" />
172                         <classpath refid="classpath" />
173                 </javac>
174         </target>
175
176         <!-- Builds the OSXAdapter -->
177         <target name="osx">
178                 <mkdir dir="${build.classes}" />
179
180                 <javac srcdir="${osx.dir}" destdir="${build.classes}" target="1.6">
181                 </javac>
182         </target>
183
184         <!-- Copies in the OSXAdapter class, which is compilable only on Mac  -->
185         <target name="non_osx">
186                 <mkdir dir="${build.classes.osx}" />
187                 <copy file="${osxbin.dir}/OSXAdapter.class" todir="${build.classes.osx}" />
188         </target>
189
190         <!-- Jars up project -->
191         <target name="jars" depends="build, unjarlib">
192                 <mkdir dir="${build.lib}" />
193
194                 <mkdir dir="${build.tmp}" />
195                 <jar destfile="${build.lib}/${build.jar}" >
196
197                         <fileset dir="${build.classes}" />
198                         <fileset dir="${build.tmp}" />
199                         <fileset dir="${build.dir}">
200                                 <include name="images/**" />
201                                 <include name="help/**" />
202                                 <include name="resource/**" />
203                         </fileset>
204
205                         <!-- Add Plugins -->
206                         <fileset dir="${resources.dir}">
207                                 <include name="plugins/**" />
208                         </fileset>
209                         <fileset dir="${txt.dir}">
210                                 <include name="gpl2.txt" />
211                                 <include name="gpl3.txt" />
212                                 <include name="lesser.txt" />
213                                 <include name="jgoodies.txt" />
214                                 <include name="README" />
215                         </fileset>
216                         <manifest>
217                                 <attribute name="Main-Class" value="net.sf.jabref.JabRefMain" />
218                 <attribute name="Class-Path" value="." />
219                         </manifest>
220                 </jar>
221
222         </target>
223
224         <!-- updates version information with git information.
225              should be used in development builds only
226
227              Use "ant addgitinfo jars" to generate a jar with version information in the filename
228         -->
229         <target name="addgitinfo" description="Adds git version information in ${jabref.version} and ${build.jar}">
230                 <exec executable="git" searchpath="true" outputproperty="git.version" failifexecutionfails="true" errorproperty="">
231                         <arg value="log" />
232                         <arg value="-1" />
233                         <arg value="--pretty=format:%cd - %H" />
234                         <arg value="--date=iso" />
235                 </exec>
236                 <script language="javascript"><![CDATA[
237                         var gitVersion = project.getProperty("git.version");
238                         if ((gitVersion != undefined) && (gitVersion.length() > 0)) {
239                                 // convert "2012-12-16 15:44:07 +0100 - a249a226" to "2012-12-16 15.44.07 - a249a226"
240                                 gitVersion = gitVersion.substr(0,13) + "." + gitVersion.substr(14,2) + "." + gitVersion.substr(17, 2) + gitVersion.substr(25);
241
242                                 // we have to update the properties using JavaScript as properties are normally immutable
243                                 // Properties can be updated using JavaScript and not with the <property>-Task
244                                 var jabrefVersion = project.getProperty("jabref.version");
245                                 jabrefVersion = jabrefVersion + " - " + gitVersion;
246                                 project.setProperty("jabref.version", jabrefVersion);
247                                 project.setProperty("build.jar", "JabRef-" + jabrefVersion + ".jar");
248                         }
249                 ]]></script>
250         </target>
251
252         <!-- copy all necessary files and insert version informations -->
253         <target name="build" depends="compile, buildinfos" description="Build project">
254
255                 <mkdir dir="${build.resource}" />
256
257                 <copy todir="${build.resource}">
258                         <fileset dir="${resource.dir}">
259                                 <include name="**" />
260                         </fileset>
261                 </copy>
262                 <mkdir dir="${build.images}" />
263                 <copy todir="${build.images}">
264                         <fileset dir="${images.dir}">
265                                 <include name="**" />
266                         </fileset>
267                 </copy>
268
269                 <mkdir dir="${build.help}" />
270                 <copy todir="${build.help}">
271                         <fileset dir="${help.dir}" />
272                 </copy>
273
274                 <!-- Insert version informations -->
275                 <replace dir="${build.help}">
276                     <replacefilter
277                             token="${jabref.placeholder.version}"
278                                 value="${jabref.version}" />
279                     <replacefilter
280                             token="${jabref.placeholder.year}"
281                                 value="${jabref.year}" />
282                         <include name="**/About.html" />
283                 </replace>
284                 <replace dir="${build.openoffice.meta}" token="${jabref.placeholder.version}" value="${jabref.version}">
285                         <include name="meta.xml" />
286                 </replace>
287
288         </target>
289
290         <!-- generate and save some build infos !!! necessary for dynamic build infos !!! -->
291         <!-- todo : replace it by the replace task :-),
292           src/resource/build.properties = template
293           build/resource/build.properties = real info file
294         -->
295         <target name="buildinfos">
296                 <tstamp />
297                 <!-- get date -->
298                 <buildnumber />
299                 <!-- generate new build number -> build.number -->
300                 <echo message="build number = ${build.number}" />
301                 <!-- write the file, please do not edit this lines -->
302                 <echo file="${resource.dir}/build.properties">builddate=${TODAY}
303 build=${build.number}
304 version=${jabref.version}</echo>
305         </target>
306
307         <!-- Creates javadocs for the extensions -->
308         <target name="extension-javadocs" depends="build" description="Generates the javadocs for the extensions archive">
309                 <mkdir dir="${build.extension-javadocs}" />
310                 <copy todir="${build.extension-javadocs}">
311                         <fileset dir="${help.dir}" defaultexcludes="yes">
312                                 <include name="CustomExports.html" />
313                                 <include name="CustomImports.html" />
314                         </fileset>
315                 </copy>
316
317                 <javadoc sourcepath="${java.dir}" destdir="${build.extension-javadocs}" author="true" version="true" windowtitle="JabRef-Extensions API" link="http://docs.oracle.com/javase/6/docs/api/" Overview="${extensions.dir}/API/overview.html" access="protected">
318                         <!--
319                  create javadoc only selectively for classes that
320                  users extending JabRef are likely to use
321               -->
322                         <fileset dir="${java.dir}" defaultexcludes="yes">
323                                 <include name="net/sf/jabref/imports/ImportFormat.java" />
324                                 <include name="net/sf/jabref/imports/ImportFormatReader.java" />
325                                 <include name="net/sf/jabref/BibtexEntry.java" />
326                                 <include name="net/sf/jabref/BibtexEntryType.java" />
327                                 <include name="net/sf/jabref/AuthorList.java" />
328                                 <include name="net/sf/jabref/AuthorList.java" />
329                                 <include name="net/sf/jabref/export/layout/LayoutFormatter.java" />
330                         </fileset>
331
332                         <classpath refid="classpath" />
333                 </javadoc>
334         </target>
335
336         <!-- Creates javadocs for the extensions -->
337         <target name="extensions" depends="extension-javadocs" description="Generates the extensions archive">
338                 <!-- copy examples -->
339                 <copy todir="${build.extensions}">
340                         <fileset dir="${java.dir}">
341                                 <include name="net/sf/jabref/export/layout/format/CurrentDate.java" />
342                                 <include name="net/sf/jabref/export/layout/format/ToLowerCase.java" />
343                                 <include name="net/sf/jabref/export/layout/format/HTMLChars.java" />
344                                 <include name="net/sf/jabref/imports/*Importer.java" />
345                         </fileset>
346                 </copy>
347                 <mkdir dir="${build.extension-layout}" />
348                 <copy todir="${build.extension-layout}">
349                         <fileset dir="${layout.dir}" />
350                 </copy>
351                 <copy todir="${build.extensions}">
352                         <fileset dir="${extensions.dir}" />
353                         <filterset>
354                                 <filter token="version" value="${jabref.version}" />
355                         </filterset>
356                 </copy>
357                 <!-- create extensions-zip file -->
358                 <zip destfile="${build.dir}/jabref-extensions.zip">
359                         <zipfileset dir="${build.extensions}" prefix="jabref-extensions" />
360                 </zip>
361         </target>
362
363         <target name="clean" depends="win.installer.clean" description="Clean project">
364                 <delete dir="${build.dir}" />
365         </target>
366
367         <!-- Unpacks jar needed jar files from lib directory into temp directory. -->
368         <target name="unjarlib" description="Unpacks jars from library">
369                 <mkdir dir="${build.tmp}" />
370                 <unjar dest="${build.tmp}">
371                         <fileset refid="jarsFileset" />
372                         <fileset refid="splJars" />
373                 </unjar>
374                 <!-- done by MrDlib -->
375                 <delete includeEmptyDirs="true">
376                         <fileset refid="deletableMeta-InfFiles" />
377                 </delete>
378                 <!-- done by MrDlib -->
379                 <!-- rename the microba license file -->
380                 <move file="${build.tmp}/license.txt" tofile="${build.tmp}/microba-license.txt" />
381         </target>
382
383
384         <target name="osxjar" depends="jars">
385                 <jarbundler dir="${build.lib}"
386                     name="JabRef"
387                     mainclass="net.sf.jabref.JabRef"
388                     jar="${build.lib}/${build.jar}"
389                     icon="${images.dir}/JabRef-Logo.icns"
390                     version="${jabref.version}"
391                     jvmversion="1.6+"
392                     vmoptions="-Xms128m -Xmx512m"
393                     stubfile="${osxbin.dir}/JavaApplicationStub"
394                     signature="JABr">
395             <documenttype name="BibTeX file" extensions="bib" role="Editor"
396                           iconFile="${images.dir}/JabRef-Logo.icns"/>
397         </jarbundler>
398         <!-- After running jarbundler we need to hack the Info.plist file: -->
399         <replace file="${build.lib}/JabRef.app/Contents/Info.plist" token="&lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;"
400             value="&lt;key&gt;NSPrincipalClass&lt;/key&gt;${line.separator}
401    &lt;string&gt;NSApplication&lt;/string&gt;${line.separator}
402    &lt;key&gt;CFBundleDocumentTypes&lt;/key&gt;"/>
403                 <zip basedir="${build.lib}"
404                         destfile="${build.lib}/JabRef-${jabref.version}-OSX.zip"
405                         excludes="JabRef.app/Contents/MacOS/JavaApplicationStub"
406                         includes="JabRef.app/"
407                         level="9">
408                         <zipfileset dir="${build.lib}" includes="JabRef.app/Contents/MacOS/JavaApplicationStub" filemode="755" />
409                 </zip>
410         </target>
411
412
413         <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
414         <!-- Build Windows Installer                                                    -->
415         <!--                                                                            -->
416         <!-- Don't forget to set nsis.executable and launch4j.dir properties            -->
417         <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
418
419         <target name="win.installer.clean" description="Delete Installer and Exe-Wrapper + Temp-files">
420                 <delete failonerror="false" dir="${win.installer.dir}/dist" />
421                 <delete file="${win.installer.dir}/JabRefSetup.exe" />
422         </target>
423
424         <target name="win.installer.win.pre" description="Precondition for win.installer on Windows">
425                 <fail unless="is.windows" message="Not running on windows or NSIS not found. Please make sure that user.properties exists" />
426         </target>
427
428         <target name="win.installer.step1">
429                 <!-- Gather everything that will go into the installer in dist -->
430                 <mkdir dir="${win.installer.dir}/dist" />
431
432                 <copy file="${build.lib}/${build.jar}" todir="${win.installer.dir}/dist" />
433
434                 <available property="win.installer.jar.available" file="${win.installer.dir}/dist/${build.jar}" />
435
436                 <fail unless="win.installer.jar.available" message="Did not find jar: ${build.jar}" />
437
438                 <copy todir="${win.installer.dir}/dist">
439                         <fileset dir="${txt.dir}">
440                                 <include name="gpl2.txt" />
441                                 <include name="gpl3.txt" />
442                                 <include name="lesser.txt" />
443                                 <include name="README" />
444                         </fileset>
445                 </copy>
446
447                 <!-- "Create Exe-Wrapper" -->
448
449                 <!-- first of all, update version information -->
450                 <script language="javascript"><![CDATA[
451                         // create new property with a maximum length of 50 characters
452                         var txtFileVersion = project.getProperty("jabref.version");
453                         if (txtFileVersion.length()>50) {
454                                 txtFileVersion = txtFileVersion.substring(0,50);
455                         }
456                         project.setProperty("txtFileVersion", txtFileVersion);
457                 ]]></script>
458                 <delete file="jabref-launch4j.tmp" />
459                 <copy file="jabref-launch4j.xml" tofile="jabref-launch4j.tmp" />
460                 <replace file="jabref-launch4j.tmp">
461                         <replacefilter token="1.1.1" value="${jabref.version}" />
462                         <replacefilter token="3.3.3" value="${txtFileVersion}" />
463                         <replacefilter token="2.2.2.2" value="${jabref.version.full}" />
464                         <replacefilter token="./" value="${basedir}/" />
465                 </replace>
466
467         </target>
468
469         <target name="win.installer.step2.linux" description="Create Windows launcher and Windows installer on Linux">
470                 <!-- launch4j ant task does not work as ld.exe gets the wrong path passed - see https://sourceforge.net/tracker/?func=detail&aid=3598164&group_id=95944&atid=613100 -->
471                 <exec
472                         executable="${launch4j.dir}/launch4j"
473                         dir="${launch4j.dir}">
474                         <arg value="${basedir}/jabref-launch4j.tmp"/>
475                 </exec>
476
477                 <!-- Finally create Windows-Installer -->
478                 <exec dir="." executable="${nsis.executable.linux}" failonerror="true">
479                         <arg line="'-DVERSION=${jabref.version}' ${win.installer.dir}/setup.nsi" />
480                 </exec>
481         </target>
482
483         <target name="win.installer.step2.win" description="Create Windows launcher and Windows installer on Windows">
484                 <!-- launch4j ant task does not work as ld.exe gets the wrong path passed - see https://sourceforge.net/tracker/?func=detail&aid=3598164&group_id=95944&atid=613100 -->
485                 <exec
486                         executable="${launch4j.dir}/launch4jc.exe"
487                         dir="${launch4j.dir}">
488                         <arg value="${basedir}/jabref-launch4j.tmp"/>
489                 </exec>
490
491                 <exec dir="." executable="${nsis.executable}" failonerror="true">
492                         <arg line="'/DVERSION=${jabref.version}' ${win.installer.dir}/setup.nsi" />
493                 </exec>
494         </target>
495
496         <target name="win.installer.step3">
497                 <move file="${win.installer.dir}/JabRefSetup.exe" tofile="${build.lib}/JabRef-${jabref.version}-setup.exe" />
498                 <delete dir="${win.installer.dir}/dist" />
499         </target>
500
501         <target name="win.installer" description="Copy files in place to be used by the installer" depends="win.installer.win.pre, jars, win.installer.step1, win.installer.step2.win, win.installer.step3">
502         </target>
503
504         <target name="win.installer.linux" description="Copy files in place to be used by the installer" depends="jars, win.installer.step1, win.installer.step2.linux, win.installer.step3">
505                 <delete dir="${win.installer.dir}/dist" />
506
507         </target>
508
509         <!--+++++++++++++++++++++++++++++++++++++++++++++++++
510            Auxiliary targets
511           +++++++++++++++++++++++++++++++++++++++++++++++++-->
512
513         <taskdef name="jarbundler" classpath="${buildlib.dir}/jarbundler-2.2.0.jar" classname="net.sourceforge.jarbundler.JarBundler" />
514
515         <macrodef name="compresssrc">
516         <attribute name="git-core-autocrlf" />
517         <attribute name="temp-dir" />
518         <attribute name="base-dir" />
519
520         <sequential>
521             <!-- clone current repo into tmp dir. Reason: we want to have a clean src.zip, but do not want to execute "git clean -xdf" to allow developers having some temporary files (and user.properties) -->
522             <mkdir dir="@{temp-dir}"/>
523             <echo message="@{temp-dir}" />
524             <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull">
525                 <arg value="clone" />
526                 <arg value="@{base-dir}" />
527                 <arg value="@{temp-dir}" />
528             </exec>
529
530             <!-- ensure correct line endings -->
531             <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="@{temp-dir}">
532                 <arg value="config" />
533                 <arg value="core.autocrlf" />
534                 <arg value="@{git-core-autocrlf}" />
535             </exec>
536             <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="@{temp-dir}">
537                 <arg value="rm" />
538                 <arg value="--cached" />
539                 <arg value="-r" />
540                 <arg value="." />
541             </exec>
542             <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="@{temp-dir}">
543                 <arg value="reset" />
544                 <arg value="--hard" />
545             </exec>
546         </sequential>
547         </macrodef>
548
549         <target name="zipsrc">
550                 <tempfile property="temp.dir" destDir="${java.io.tmpdir}" prefix="jabrefsrc" />
551                 <compresssrc git-core-autocrlf="true" temp-dir="${temp.dir}/jabref-${jabref.version}" base-dir="${basedir}" />
552                 <zip destfile="${build.lib}/JabRef-${jabref.version}-src.zip" basedir="${temp.dir}" level="9" />
553                 <delete dir="${temp.dir}" failonerror="no"/>
554         </target>
555
556         <target name="bzip2src">
557                 <tempfile property="temp.dir" destDir="${java.io.tmpdir}" prefix="jabrefsrc" />
558         <compresssrc git-core-autocrlf="false" temp-dir="${temp.dir}/jabref-${jabref.version}" base-dir="${basedir}" />
559                 <tar destfile="${build.lib}/JabRef-${jabref.version}-src.tar.bz2" basedir="${temp.dir}" excludes=".git/" compression="bzip2" />
560                 <delete dir="${temp.dir}" failonerror="no"/>
561         </target>
562
563         <target name="devsnapshot" depends="clean, addgitinfo, non_osx, win.installer, osxjar" description="creates development snapshot binaries" />
564
565         <target name="release" depends="clean, win.installer, non_osx, osxjar, bzip2src, zipsrc" description="Do a release on Windows. Creates all distribution files in ${build.lib}"/>
566         <target name="release.linux" depends="clean, win.installer.linux, non_osx, osxjar, bzip2src, zipsrc" description="Do a release on Linux. Creates all distribution files in ${build.lib}" />
567 </project>