<project name="PMDJEditPlugin" default="compile" basedir="../">

	<property name="config" value="config/"/>
	<property name="src" value="src/"/>
	<property name="lib" value="lib/"/>
	<property name="build" value="build/"/>
	<property name="pmdjar" value="pmd-1.01.jar"/>
	<property name="pluginversion" value="1.2"/>
	<property name="jedit.install.dir"  value="c:\jedit\jars"/>


	<path id="project.class.path">
		<pathelement location="${lib}/${pmdjar}"/>
		<pathelement location="${lib}/jedit.jar"/>
		<pathelement location="${lib}/ErrorList.jar"/>
		<pathelement location="${build}"/>
	</path>


    <target name="delete">
        <delete file="${lib}/${ant.project.name}.jar"/>
        <delete file="${jedit.install.dir}/${ant.project.name}.jar"/>
		<delete dir="${build}"/>
        <mkdir dir="${build}"/>
    </target>

	<target name="compile">
		<javac
			srcdir="${src}"
			destdir="${build}"
			debug="on"
			deprecation="on">
			<classpath refid="project.class.path"/>
		</javac>
	</target>

    <target name="jar">
		<jar jarfile="${lib}/${ant.project.name}-${pluginversion}.jar">
			<fileset dir="${build}"/>
			<fileset dir="${config}">
				<include name="*.props"/>
				<include name="*.xml"/>
				<include name="*.html"/>
			</fileset>
		</jar>
    </target>


	<target name="dist" depends="clean">
        <antcall target="jar"/>
        <copy file="${lib}/${ant.project.name}-${pluginversion}.jar" todir="${jedit.install.dir}"/>
	</target>

    <target name="release">
        <antcall target="clean"/>
        <antcall target="jar"/>
        <mkdir dir="tmp/jars"/>
        <copy file="${lib}/${ant.project.name}-${pluginversion}.jar" todir="tmp/jars"/>
        <copy file="${lib}/${pmdjar}" todir="tmp/jars"/>
        <zip zipfile="pmd-jedit-bin-${pluginversion}.zip" basedir="tmp"/>
        <move file="pmd-jedit-bin-${pluginversion}.zip" todir="c:\tmp"/>
        <delete dir="tmp"/>
    </target>

	<target name="clean" depends="delete,compile">
	</target>

</project>