Imported Upstream version 2.11~beta1+ds
[debian/jabref.git] / build.xml
index d13a9f3..a44f9f8 100644 (file)
--- a/build.xml
+++ b/build.xml
      +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
 
        <!-- some version information -->
-       <property name="jabref.version" value="2.10" />
-       <property name="jabref.version.full" value="2.10.0.5" /> <!-- a version number with 4 places. Required by launch4j -->
-       <property name="jabref.year" value="2014" />
+       <property name="jabref.version" value="2.11b" />
+       <property name="jabref.version.full" value="2.11.1.0" /> <!-- a version number with 4 places. Required by launch4j -->
+       <property name="jabref.year" value="2015" />
        <property name="jabref.placeholder.version" value="@version@" />
        <property name="jabref.placeholder.year" value="@year@" />
        <!-- used by replace task -->
 
        <!-- Set the properties for intermediate directory -->
        <property name="build.jar" value="JabRef-${jabref.version}.jar" />
-       <property name="build.dir" value="build" />
+       <property name="build.dir" value="buildant" />
        <property name="build.classes" value="${build.dir}/classes" />
        <property name="build.tmp" value="${build.dir}/tmp" />
-       <property name="build.osx" value="${build.dir}/classes/osxadapter" />
+       <property name="build.classes.osx" value="${build.dir}/classes/osxadapter" />
        <property name="build.lib" value="${build.dir}/lib" />
        <property name="build.win" value="${build.dir}/windows" />
        <property name="build.images" value="${build.dir}/images" />
-       <property name="build.fonts" value="${build.dir}/images/font" />
        <property name="build.resource" value="${build.dir}/resource" />
        <property name="build.help" value="${build.dir}/help" />
-       <property name="build.javadocs" value="${build.dir}/docs/API" />
        <property name="build.extensions" value="${build.dir}/extensions" />
        <property name="build.extension-javadocs" value="${build.extensions}/API" />
        <property name="build.extension-layout" value="${build.extensions}/layout" />
        <property name="build.openoffice.meta" value="${build.resource}/openoffice" />
-       <property name="build.tests" value="${build.dir}/tests" />
 
        <!-- Set the properties for source directories -->
-       <property name="src.dir" value="src" />
-       <property name="src.tests" value="src/java/tests" />
-       <property name="plugin.dir" value="src/plugins/" />
-       <property name="txt.dir" value="src/txt" />
-       <property name="java.dir" value="${src.dir}/java" />
-       <property name="osx.dir" value="${src.dir}/osx" />
-       <property name="win.installer.dir" value="${src.dir}/windows/nsis" />
-       <property name="resource.dir" value="${src.dir}/resource" />
-       <property name="bin.dir" value="${src.dir}/scripts" />
-       <property name="images.dir" value="${src.dir}/images" />
-       <property name="fonts.dir" value="${src.dir}/images/font" />
-       <property name="help.dir" value="${src.dir}/help" />
-       <property name="extensions.dir" value="${src.dir}/extensions" />
-       <property name="layout.dir" value="${src.dir}/resource/layout" />
+       <property name="resources.dir" value="src/main/resources" />
+       <property name="plugin.dir" value="${resources.dir}/plugins/" />
+       <property name="txt.dir" value="." />
+       <property name="java.dir" value="src/main/java" />
+    <property name="gen.dir" value="src/main/gen" />
+       <property name="osx.dir" value="${resources.dir}/osx" />
+       <property name="win.installer.dir" value="${resources.dir}/windows/nsis" />
+       <property name="resource.dir" value="${resources.dir}/resource" />
+       <property name="images.dir" value="${resources.dir}/images" />
+       <property name="help.dir" value="${resources.dir}/help" />
+       <property name="extensions.dir" value="${resources.dir}/extensions" />
+       <property name="layout.dir" value="${resources.dir}/resource/layout" />
        <property name="lib.dir" value="lib" />
        <property name="buildlib.dir" value="buildlib" />
-       <property name="tests.dir" value="${src.dir}/tests" />
 
        <property name="osxbin.dir" value="osx" />
 
         <include name="jgoodies-common-1.4.0.jar" />
                <include name="jgoodies-looks-2.5.2.jar" />
                <include name="jgoodies-forms-1.6.0.jar" />
+        <include name="jgoodies/jgoodies-uif-lite.jar" />
+        <include name="jna-4.1.0.jar" />
+        <include name="ritopt/ritopt-0.2.1-bin.jar" />
                <include name="jayatana-1.2.4.jar" />
                <include name="spin.jar" />
                <include name="glazedlists-1.8.0_java15.jar" />
     <!-- Done by MrDlib -->
     <fileset id="splJars" dir="${lib.dir}">
         <include name="spl/**/*.jar" />
-        <include name="spl/*.jar" />
     </fileset>
        <fileset id="deletableMeta-InfFiles" dir="${build.tmp}/META-INF">
                <exclude name="services/**/*" />
                <pathelement path="${build.classes}" />
                <pathelement path="${build.dir}" />
         <!-- Done by MrDlib -->
-        <pathelement path="${lib.dir}/spl" />
         <fileset refid="splJars" />
         <!-- Done by MrDlib -->
                <fileset refid="jarsFileset" />
         <fileset refid="ooFileset" />
        </path>
 
-       <!-- Classpath for running the code generator -->
-       <path id="codegenerator">
-               <pathelement location="${lib.dir}/plugin/JPFCodeGenerator.jar" />
-               <pathelement location="${lib.dir}/plugin/jpf.jar" />
-               <pathelement location="${lib.dir}/plugin/jpf-boot.jar" />
-               <pathelement location="${lib.dir}/plugin/velocity-dep-1.5.jar" />
-       </path>
-
-       <!-- Classpath for tests -->
-       <path id="classpathTest">
-               <path refid="classpath" />
-               <pathelement location="${buildlib.dir}/junit.jar" />
-       </path>
-
        <target name="run" depends="build">
                <java classname="net.sf.jabref.JabRefMain" fork="true">
                        <classpath refid="classpath" />
                </java>
        </target>
 
-       <!-- Only rerun the code generator if plug-in xml or jars are newer than generated java file. -->
-       <uptodate property="needsNoRegenerate" targetfile="${java.dir}/net/sf/jabref/plugin/core/generated/_JabRefPlugin.java">
-               <srcfiles dir=".">
-                       <include name="${plugin.dir}/**/plugin.xml" />
-                       <include name="${lib.dir}/plugin/*.jar" />
-               </srcfiles>
-       </uptodate>
-
-       <!-- Run the JPF Code Generator -->
-       <target name="generate" unless="needsNoRegenerate">
-               <java classname="net.sf.jabref.plugin.util.CodeGenerator" fork="true">
-                       <arg value="${plugin.dir}" />
-                       <classpath refid="codegenerator" />
-               </java>
-       </target>
-
-       <!-- Compiles project excluding tests -->
-       <target name="compile" depends="generate">
+       <!-- Compiles project -->
+       <target name="compile">
                <mkdir dir="${build.classes}" />
-               <javac debug="on" deprecation="on" destdir="${build.classes}" encoding="UTF8" source="1.6" target="1.6">
+               <javac destdir="${build.classes}" encoding="UTF8" source="1.6" target="1.6">
                        <src path="${java.dir}" />
-                       <exclude name="tests/**" />
-                       <exclude name="**/JabRefMain.java" />
+            <src path="${gen.dir}" />
                        <classpath refid="classpath" />
                </javac>
-               <javac debug="off" deprecation="on" destdir="${build.classes}" encoding="UTF8" source="1.6" target="1.6">
-                       <src path="${java.dir}" />
-                       <include name="**/JabRefMain.java" />
-               </javac>
-       </target>
-
-       <!-- Compiles project including tests -->
-       <target name="compiletest">
-               <mkdir dir="${build.classes}" />
-               <javac debug="on" destdir="${build.classes}" encoding="UTF8" source="1.6" target="1.6">
-                       <src path="${java.dir}" />
-                       <include name="tests/**" />
-                       <classpath refid="classpathTest" />
-               </javac>
        </target>
 
        <!-- Builds the OSXAdapter -->
        <target name="osx">
                <mkdir dir="${build.classes}" />
 
-               <javac srcdir="${osx.dir}" debug="off" destdir="${build.classes}" target="1.6">
+               <javac srcdir="${osx.dir}" destdir="${build.classes}" target="1.6">
                </javac>
        </target>
 
        <!-- Copies in the OSXAdapter class, which is compilable only on Mac  -->
        <target name="non_osx">
-               <mkdir dir="${build.osx}" />
-               <copy file="${osxbin.dir}/OSXAdapter.class" todir="${build.osx}" />
+               <mkdir dir="${build.classes.osx}" />
+               <copy file="${osxbin.dir}/OSXAdapter.class" todir="${build.classes.osx}" />
        </target>
 
        <!-- Jars up project -->
 
                <mkdir dir="${build.tmp}" />
                <jar destfile="${build.lib}/${build.jar}" >
-        <!--<jar destfile="${build.lib}/JabRef-${revision}.jar" manifest="${src.dir}/MANIFEST.MF">-->
 
                        <fileset dir="${build.classes}" />
                        <fileset dir="${build.tmp}" />
                        </fileset>
 
                        <!-- Add Plugins -->
-                       <fileset dir="${src.dir}">
+                       <fileset dir="${resources.dir}">
                                <include name="plugins/**" />
                        </fileset>
-             <!-- Done by MrDlib -->
-            <fileset dir ="${java.dir}">
-                <include name="spl/localization/spljabref.properties"/>
-                <include name="spl/gui/ajax-loader.gif"/>
-                <include name="spl/gui/mrdlib header.png"/>
-            </fileset>
-            <!-- Done by MrDlib -->
-                       <fileset dir="${lib.dir}">
-                               <include name="EndNote.zip" />
-                       </fileset>
                        <fileset dir="${txt.dir}">
                                <include name="gpl2.txt" />
                                <include name="gpl3.txt" />
 
        </target>
 
-       <!-- Prepare for testing -->
-       <target name="buildtest" depends="build, compiletest" description="Build project for testing">
-
-               <mkdir dir="${build.tests}" />
-               <copy todir="${build.tests}">
-                       <fileset dir="${tests.dir}">
-                               <include name="**" />
-                       </fileset>
-               </copy>
-       </target>
-
        <!-- generate and save some build infos !!! necessary for dynamic build infos !!! -->
        <!-- todo : replace it by the replace task :-),
           src/resource/build.properties = template
@@ -376,23 +304,6 @@ build=${build.number}
 version=${jabref.version}</echo>
        </target>
 
-
-       <!-- Creates all docs -->
-       <target name="docs" depends="javadocs" description="Generates all the documentation" />
-
-       <!-- Creates javadocs -->
-       <target name="javadocs" depends="compile" description="Generates the javadocs">
-               <mkdir dir="${build.javadocs}" />
-               <javadoc sourcepath="${java.dir}" destdir="${build.javadocs}" author="true" version="true" windowtitle="JabRef API" link="http://docs.oracle.com/javase/6/docs/api/">
-
-                       <fileset dir="${java.dir}" defaultexcludes="yes">
-                               <include name="**/*.java" />
-                       </fileset>
-
-                       <classpath refid="classpath" />
-               </javadoc>
-       </target>
-
        <!-- Creates javadocs for the extensions -->
        <target name="extension-javadocs" depends="build" description="Generates the javadocs for the extensions archive">
                <mkdir dir="${build.extension-javadocs}" />
@@ -595,106 +506,57 @@ version=${jabref.version}</echo>
 
        </target>
 
-       <target name="test" depends="buildtest" description="Runs all unit tests">
-               <java fork="yes" classname="junit.textui.TestRunner" failonerror="true">
-                       <arg value="tests.net.sf.jabref.AllTests" />
-                       <classpath refid="classpathTest" />
-               </java>
-       </target>
-
        <!--+++++++++++++++++++++++++++++++++++++++++++++++++
           Auxiliary targets
          +++++++++++++++++++++++++++++++++++++++++++++++++-->
 
-       <target name="profile" depends="jars" description="Profile JabRef">
-               <fail unless="netbeans.home">This target can only run inside the NetBeans IDE.</fail>
-
-               <nbprofiledirect>
-                       <classpath refid="classpath" />
-               </nbprofiledirect>
-
-               <property environment="env" />
-               <java fork="true" classname="net.sf.jabref.JabRef" dir="${build.dir}" jvm="${profiler.info.jvm}">
-                       <jvmarg value="${profiler.info.jvmargs.agent}" />
-                       <jvmarg line="${profiler.info.jvmargs}" />
-                       <env key="LD_LIBRARY_PATH" path="${profiler.info.agentpath}:${env.LD_LIBRARY_PATH}" />
-                       <classpath refid="classpath" />
-               </java>
-       </target>
-
-       <!--++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-        What's about the software design ?!;-)
-    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-->
-
-       <target name="jalopy" description="SOFTWAREDESIGN: source code formatter using the JOELib convention.">
-               <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
-                       <classpath>
-                               <pathelement path="${classpath}" />
-                               <fileset dir="${lib.dir}">
-                                       <include name="*.jar" />
-                               </fileset>
-                               <fileset dir="${buildlib.dir}">
-                                       <include name="*.jar" />
-                               </fileset>
-                       </classpath>
-               </taskdef>
-               <jalopy fileformat="unix" convention="${src.dir}/java/jalopy.format.convention.xml" history="file" historymethod="adler32" loglevel="error" threads="2" classpathref="classpath" backup="bak">
-                       <fileset dir="${src.dir}">
-                               <include name="java/net/sf/jabref/**/*.java" />
-                       </fileset>
-               </jalopy>
-       </target>
-
        <taskdef name="jarbundler" classpath="${buildlib.dir}/jarbundler-2.2.0.jar" classname="net.sourceforge.jarbundler.JarBundler" />
 
-       <target name="compresssrc">
-               <!-- 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) -->
-               <mkdir dir="${temp.dir}"/>
-               <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull">
-                       <arg value="clone" />
-                       <arg value="${basedir}/.." />
-                       <arg value="${temp.dir}" />
-               </exec>
-
-               <!-- ensure correct line endings -->
-               <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="${temp.dir}">
-                       <arg value="config" />
-                       <arg value="core.autocrlf" />
-                       <arg value="${git.core.autocrlf}" />
-               </exec>
-               <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="${temp.dir}">
-                       <arg value="rm" />
-                       <arg value="--cached" />
-                       <arg value="-r" />
-                       <arg value="." />
-               </exec>
-               <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="${temp.dir}">
-                       <arg value="reset" />
-                       <arg value="--hard" />
-               </exec>
-
-               <!-- we want to have jabref-${jabref.version} as main directory -->
-               <mkdir dir="${distsrc}" />
-               <move file="${temp.dir}/jabref" tofile="${distsrc}/jabref-${jabref.version}" />
-       </target>
+       <macrodef name="compresssrc">
+        <attribute name="git-core-autocrlf" />
+        <attribute name="temp-dir" />
+        <attribute name="base-dir" />
+
+        <sequential>
+            <!-- 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) -->
+            <mkdir dir="@{temp-dir}"/>
+            <echo message="@{temp-dir}" />
+            <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull">
+                <arg value="clone" />
+                <arg value="@{base-dir}" />
+                <arg value="@{temp-dir}" />
+            </exec>
+
+            <!-- ensure correct line endings -->
+            <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="@{temp-dir}">
+                <arg value="config" />
+                <arg value="core.autocrlf" />
+                <arg value="@{git-core-autocrlf}" />
+            </exec>
+            <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="@{temp-dir}">
+                <arg value="rm" />
+                <arg value="--cached" />
+                <arg value="-r" />
+                <arg value="." />
+            </exec>
+            <exec executable="git" searchpath="true" failifexecutionfails="true" outputproperty="devnull" errorproperty="devnull" dir="@{temp-dir}">
+                <arg value="reset" />
+                <arg value="--hard" />
+            </exec>
+        </sequential>
+       </macrodef>
 
        <target name="zipsrc">
-               <tempfile property="temp.dir" destDir="${java.io.tmpdir}" prefix="jabrefsrc"/>
-               <property name="distsrc" value="${temp.dir}/distsrc/" />
-               <antcall target="compresssrc">
-                       <param name="git.core.autocrlf" value="true" />
-               </antcall>
-               <zip destfile="${build.lib}/JabRef-${jabref.version}-src.zip" basedir="${distsrc}" level="9" />
+               <tempfile property="temp.dir" destDir="${java.io.tmpdir}" prefix="jabrefsrc" />
+               <compresssrc git-core-autocrlf="true" temp-dir="${temp.dir}/jabref-${jabref.version}" base-dir="${basedir}" />
+               <zip destfile="${build.lib}/JabRef-${jabref.version}-src.zip" basedir="${temp.dir}" level="9" />
                <delete dir="${temp.dir}" failonerror="no"/>
        </target>
 
        <target name="bzip2src">
-               <tempfile property="temp.dir" destDir="${java.io.tmpdir}" prefix="jabrefsrc"/>
-               <property name="distsrc" value="${temp.dir}/distsrc/" />
-               <antcall target="compresssrc">
-                       <param name="git.core.autocrlf" value="false" />
-               </antcall>
-               <tar destfile="${build.lib}/JabRef-${jabref.version}-src.tar.bz2" basedir="${distsrc}" excludes=".git/" compression="bzip2" />
+               <tempfile property="temp.dir" destDir="${java.io.tmpdir}" prefix="jabrefsrc" />
+        <compresssrc git-core-autocrlf="false" temp-dir="${temp.dir}/jabref-${jabref.version}" base-dir="${basedir}" />
+               <tar destfile="${build.lib}/JabRef-${jabref.version}-src.tar.bz2" basedir="${temp.dir}" excludes=".git/" compression="bzip2" />
                <delete dir="${temp.dir}" failonerror="no"/>
        </target>