<?xml version="1.0"?>
<project name="Bibliography" default="all" basedir=".">

    <target id="all" name="all" depends="convertToBibTex, convertToDocBook"/>
    
    <target id="clean" name="clean">
        <delete>
            <fileset dir="." includes="cheminf.dbx" />
            <fileset dir="." includes="cheminf.bib" />
            <fileset dir="." includes="biblio.dbx" />
            <fileset dir="." includes="*.bak" />
            <fileset dir="." includes="*.log*" />
            <fileset dir="." includes="*~" />
        </delete>
    </target>
    
    <target id="convertToDocBook" name="convertToDocBook">
        <!-- biblio.dbx is used for website via DocBook/Website DTD etc -->
        
        <java jar="../jar/jabref.jar" fork="yes">
            <arg value="--nogui"/>
            <arg value="--import"/>
            <arg value="cheminf.bibx,bibtexml"/>
            <arg value="--output"/>
            <arg value="cheminf.dbx,docbook"/>
        </java>
        <replace file="cheminf.dbx" token='&lt;?xml version="1.0" ?>' value=""/>
    </target>

    <target id="convertToBibTex" name="convertToBibTex">
        <!-- cheminf.bib is used for latex source -->
        <java jar="../jar/jabref.jar" fork="yes">
            <arg value="--nogui"/>
            <arg value="--import"/>
            <arg value="cheminf.bibx,bibtexml"/>
            <arg value="--output"/>
            <arg value="cheminf.bib"/>
        </java>
        <!-- cdknews.bib is used for on the website -->
        <java jar="../jar/jabref.jar" fork="yes">
            <arg value="--nogui"/>
            <arg value="--import"/>
            <arg value="cdknews.bibx,bibtexml"/>
            <arg value="--output"/>
            <arg value="cdknews.bib"/>
        </java>
    </target>

</project>
