blob: 1c0b217ca6c4bc79e42b5a1b4d568da269c9536a [file]
<?xml version="1.0" encoding="UTF-8"?>
<project name="build template" default="dist">
<commapatternset id="pattern.id" includes="${includes}" excludes="${excludes}"/>
<commapatternset id="copy.id" includes="${includes}" excludes="**/*.java"/>
<commapatternset id="includes.id" includes="${includes}"/>
<commapatternset id="excludes.id" excludes="${excludes}"/>
<fileset id="file.id" dir=".">
<patternset refid="pattern.id"/>
</fileset>
<path id="path.id">
<fileset refid="file.id"/>
</path>
<stripMapper id="stripMapper.id" from="${mapping}"/>
<target name="jar" depends="">
<property name="build.compiler" value="org.eclipse.pde.internal.core.JDTCompilerAdapter"/>
<property name="out" value="${dest}.bin"/>
<delete dir="${out}"/>
<mkdir dir="${out}"/>
<javac srcdir="${basedir}" destdir="${out}" verbose="yes" failonerror="no">
<patternset refid="pattern.id"/>
<classpath path="${rt};${compilePath}"/>
</javac>
<copy todir="${out}">
<fileset dir=".">
<patternset refid="copy.id"/>
</fileset>
<mapper refid="stripMapper.id"/>
</copy>
<delete file="${dest}"/>
<antcall target="runJar">
<param name="resultingFile" value="${dest}"/>
<param name="targetDir" value="${out}"/>
</antcall>
<copy todir="${basedir}">
<fileset dir="." includes="*.log" />
</copy>
<delete dir="${out}"/>
</target>
<target name="includesExcludesCopy" depends="">
<mkdir dir="${dest}"/>
<copy todir="${dest}">
<fileset refid="file.id"/>
</copy>
</target>
<target name="mapperCopy" depends="">
<mkdir dir="${dest}" />
<copy todir="${dest}">
<fileset refid="file.id"/>
<mapper refid="stripMapper.id"/>
</copy>
</target>
<target name="src">
<delete dir="${dest}.pdetemp" />
<mkdir dir="${dest}.pdetemp" />
<copy todir="${dest}.pdetemp">
<fileset refid="file.id"/>
<mapper refid="stripMapper.id"/>
</copy>
<delete file="${dest}"/>
<antcall target="runZip">
<param name="resultingFile" value="${dest}"/>
<param name="targetDir" value="${dest}.pdetemp"/>
</antcall>
<delete dir="${dest}.pdetemp"/>
</target>
<target name="log">
<delete dir="${dest}"/>
<mkdir dir="${dest}"/>
<copy todir="${dest}">
<fileset dir="." includes="*.log"/>
<mapper type="glob" from="*.bin.log" to="*.log"/>
</copy>
</target>
<!-- Delegates the zip call to either the default task or an external program. -->
<!-- In order to define which one to run, the user should set a property -->
<!-- called useExternalZip. -->
<target name="runZip" depends="">
<antcall target="externalZip"/>
<antcall target="antZip"/>
</target>
<!-- Executes an external zip program -->
<target name="externalZip" if="useExternalZip">
<exec dir="${targetDir}" executable="zip">
<arg line="-r ${resultingFile} ."/>
</exec>
</target>
<!-- Executes the default zip task defined by Ant -->
<target name="antZip" unless="useExternalZip">
<zip zipfile="${resultingFile}" basedir="${targetDir}"/>
</target>
<!-- Delegates the jar call to either the default task or an external program. -->
<!-- In order to define which one to run, the user should set a property -->
<!-- called useExternalZip. -->
<target name="runJar" depends="">
<antcall target="externalZip"/>
<antcall target="antJar"/>
</target>
<!-- Executes the default jar task defined by Ant -->
<target name="antJar" unless="useExternalZip">
<jar jarfile="${resultingFile}" basedir="${targetDir}"/>
</target>
</project>