Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1f099c7165
Fetching contributors…

Cannot retrieve contributors at this time

177 lines (156 sloc) 7.466 kb
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="ant-task-sitemap" basedir="." default="test">
<property file="build.properties" />
<path id="classpath.run">
<path path="${java.class.path}"/>
<path location="${jar}"/>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<path id="classpath.test">
<path refid="classpath.run"/>
<path location="${ant.test.lib}"/>
<fileset dir="${testlib.dir}" includes="**/*.jar"/>
</path>
<!-- clean directories -->
<target name="clean" description="Delete all generated files">
<delete failonerror="false" includeEmptyDirs="true">
<fileset dir="." includes="${jar}"/>
<fileset dir="${classes.dir}"/>
<fileset dir="${report.dir}"/>
<fileset dir="${docs.dir}"/>
</delete>
<mkdir dir="${classes.dir}"/>
</target>
<!-- compile tasks -->
<target name="compile" description="Compiles the source">
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath.run" includeAntRuntime="false">
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="compile-test" description="Compiles the tests">
<javac srcdir="${test.dir}" destdir="${classes.dir}" classpathref="classpath.test" includeAntRuntime="false">
<compilerarg value="-Xlint"/>
</javac>
</target>
<!-- create jar -->
<target name="jar" description="JARs the Task" depends="compile">
<jar destfile="${jar}" basedir="${classes.dir}"/>
</target>
<!-- create docs -->
<target name="javadoc" description="Generates the javadoc">
<javadoc packagenames="uk.co.arjones.ant.task.*"
sourcepath="src"
excludepackagenames="uk.co.arjones.ant.task.*Test"
defaultexcludes="yes"
destdir="${docs.dir}/api"
author="true"
version="true"
use="true"
windowtitle="ant-task-sitemap"
classpathref="classpath.run">
<doctitle><![CDATA[<h1>Test</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright 2012 Andrew Jones</i>]]></bottom>
</javadoc>
</target>
<!-- 'use' tasks for our new task -->
<target name="use.without.url" description="Use without URL" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap/>
</target>
<target name="use.without.destdir" description="Use without URL" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com"/>
</target>
<target name="use.without.files" description="Use without any files" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}"/>
</target>
<target name="use.default" description="Use with default" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}">
<fileset dir="${test-resources.dir}">
<include name="**.htm"/>
<include name="**.html"/>
</fileset>
</sitemap>
</target>
<target name="use.gzip" description="Use with default" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}" gzip="yes">
<fileset dir="${test-resources.dir}">
<include name="**.htm"/>
<include name="**.html"/>
</fileset>
</sitemap>
</target>
<target name="use.index" description="Use with index defined" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}">
<fileset dir="${test-resources.dir}">
<include name="**.htm"/>
<include name="**.html"/>
</fileset>
</sitemap>
</target>
<target name="use.index.about" description="Use with index defined" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}" index="about.*">
<fileset dir="${test-resources.dir}">
<include name="**.htm"/>
<include name="**.html"/>
</fileset>
</sitemap>
</target>
<target name="use.lastmod.now" description="Use with lastmod=today" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}" lastmod="now">
<fileset dir="${test-resources.dir}">
<include name="**.htm"/>
<include name="**.html"/>
</fileset>
</sitemap>
</target>
<target name="use.lastmod.fromfile" description="Use with lastmod=fromfile" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}" lastmod="fromfile">
<fileset dir="${test-resources.dir}">
<include name="**.htm"/>
<include name="**.html"/>
</fileset>
</sitemap>
</target>
<target name="use.lastmod.fail" description="Use with lastmod=fail" depends="jar">
<taskdef name="sitemap" classname="uk.co.arjones.ant.task.Sitemap" classpathref="classpath.run"/>
<sitemap url="http://www.example.com" destdir="${test-resources.dir}" lastmod="fail">
<fileset dir="${test-resources.dir}">
<include name="**.htm"/>
<include name="**.html"/>
</fileset>
</sitemap>
</target>
<!-- test tasks -->
<target name="junit" description="Runs the unit tests" depends="compile-test, jar">
<delete dir="${junit.out.dir.xml}"/>
<mkdir dir="${junit.out.dir.xml}"/>
<junit printsummary="yes" haltonfailure="no">
<classpath refid="classpath.test"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${junit.out.dir.xml}">
<fileset dir="${test.dir}" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="junitreport" description="Create a report for the rest result">
<mkdir dir="${junit.out.dir.html}"/>
<junitreport todir="${junit.out.dir.html}">
<fileset dir="${junit.out.dir.xml}">
<include name="*.xml"/>
</fileset>
<report format="frames" todir="${junit.out.dir.html}"/>
</junitreport>
</target>
<target name="test"
depends="junit,junitreport"
description="Runs unit tests and creates a report"
/>
</project>
Jump to Line
Something went wrong with that request. Please try again.