Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
257 lines (211 sloc) 11.7 KB
<?xml version="1.0"?>
<project name="neo4j-tutorial" default="run.koans" basedir=".">
<property name="settings.dir" location="settings"/>
<import file="${settings.dir}/install-ant-eclipse.xml"/>
<import file="${settings.dir}/path.xml"/>
<import file="${settings.dir}/test.xml"/>
<import file="${settings.dir}/koan.xml"/>
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isUnix">
<os family="unix"/>
</condition>
<target name="-download.check">
<available property="neo4j.already.downloaded" file="${neo4j.download.dir}/${neo4j.unix.distribution}"/>
<available property="neo4j.already.downloaded" file="${neo4j.download.dir}/${neo4j.windows.distribution}"/>
<available property="jars.already.downloaded" file="${additional.jars.dir}"/>
</target>
<target name="-make.download.dirs">
<mkdir dir="${neo4j.download.dir}"/>
<mkdir dir="${additional.jars.dir}"/>
</target>
<target name="-download.additional.jars" unless="jars.already.downloaded">
<get src="http://repo.maven.apache.org/maven2/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/com/sun/jersey/jersey-bundle/1.9.1/jersey-bundle-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/commons-cli/commons-cli/1.0/commons-cli-1.0.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/sonatype/plexus/plexus-build-api/0.0.4/plexus-build-api-0.0.4.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/apache/maven/shared/maven-filtering/1.1/maven-filtering-1.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-manager/1.9.1/plexus-compiler-manager-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.9.1/plexus-compiler-javac-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-api/1.9.1/plexus-compiler-api-1.9.1.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo1.maven.org/maven2/junit/junit/4.12/junit-4.12.jar" dest="${additional.jars.dir}/"/>
<get src="http://repo1.maven.org/maven2/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/org/neo4j/test/neo4j-harness/${neo4j.version}/neo4j-harness-${neo4j.version}.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/org/neo4j/neo4j-kernel/${neo4j.version}/neo4j-kernel-${neo4j.version}-tests.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/org/neo4j/neo4j-io/${neo4j.version}/neo4j-io-${neo4j.version}-tests.jar" dest="${additional.jars.dir}/"/>
<get src="http://central.maven.org/maven2/asm/asm/3.1/asm-3.1.jar" dest="${additional.jars.dir}/"/>
</target>
<target name="-download.and.unzip.neo4j.windows" if="isWindows" depends="-make.download.dirs"
unless="neo4j.already.downloaded">
<get dest="${neo4j.download.dir}" src="http://dist.neo4j.org/${neo4j.windows.distribution}"/>
<unzip src="${neo4j.download.dir}/${neo4j.windows.distribution}" dest="${neo4j.download.dir}/"/>
</target>
<target name="-download.and.uncompress.neo4j.unix" if="isUnix" depends="-make.download.dirs"
unless="neo4j.already.downloaded">
<get dest="${neo4j.download.dir}" src="http://dist.neo4j.org/${neo4j.unix.distribution}"/>
<gunzip src="${neo4j.download.dir}/${neo4j.unix.distribution}" dest="${neo4j.download.dir}/"/>
<untar src="${neo4j.download.dir}/neo4j-community-${neo4j.version}-unix.tar" dest="${neo4j.download.dir}"/>
</target>
<target name="download.neo4j.and.test.dependencies"
depends="-download.check, -download.and.unzip.neo4j.windows, -download.and.uncompress.neo4j.unix, -download.additional.jars"
description="Downloads the most appropriate Neo4j version for the current platform">
<copy todir="${lib.dir}">
<fileset dir="${neo4j.install.dir}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${neo4j.install.dir}/system/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${additional.jars.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
</target>
<target name="clean" description="Cleans the build, but leaves binary dependencies">
<delete dir="target"/>
<delete dir="build"/>
<delete dir="out"/>
</target>
<target name="really.clean"
description="Cleans the build, removes the cached database, and removes the Neo4j binaries (but not the download)."
depends="clean">
<delete dir="${neo4j.install.dir}"/>
<delete dir="${cached.db.dir}"/>
</target>
<target name="nuke"
description="Removes everything, except sources. Use with caution, you'll have to download Neo4j again."
depends="really.clean">
<delete dir="${download.dir}"/>
<delete dir="${lib.dir}"/>
</target>
<target name="compile" description="Compile koans" depends="download.neo4j.and.test.dependencies">
<mkdir dir="${main.target}"/>
<javac srcdir="${main.src}" destdir="${main.target}" classpathref="path.libs" source="1.7"/>
<tstamp>
<format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss"/>
</tstamp>
</target>
<target name="compile.tests" description="Compile unit test classes" depends="compile">
<mkdir dir="${test.target}"/>
<javac srcdir="${test.src}" destdir="${test.target}" classpathref="path.testing" debug="true" target="1.7"/>
</target>
<target name="test" depends="compile, compile.tests">
<fileset id="unittest.source.files" dir="${test.src}">
<include name="**/*Test*.java"/>
</fileset>
<run_junit_tests testclasspath="path.testing" testfileset="unittest.source.files" outputdir="${test.reports}"/>
<fail if="tests.failed.or.errored" message="Build failed due to Unit test failures or errors"/>
</target>
<target name="compile.koans" description="Compile koans">
<mkdir dir="${koan.target}"/>
<javac srcdir="${koan.src}" destdir="${koan.target}" classpathref="path.koan" debug="true" target="1.7"/>
</target>
<target name="run.koans"
depends="test, compile.koans, run.koan1, run.koan2, run.koan3, run.koan4, run.koan5, run.koan6, run.koan7, run.koan8, run.koan9, run.koan1, run.koan11, run.koan12, run.koan13, run.koan14, run.koan15, run.advancedkoan02, run.advancedkoan03, run.advancedkoan04, run.advancedkoan05, run.advancedkoan07, run.advancedkoan09, run.advancedkoan10, run.advancedkoan11, run.advancedkoan12, run.advancedkoan13"/>
<target name="run.koan1" depends="test, compile.koans">
<koan number="1"/>
</target>
<target name="run.koan2" depends="test, compile.koans">
<koan number="2"/>
</target>
<target name="run.koan3" depends="test, compile.koans">
<koan number="3"/>
</target>
<target name="run.koan4" depends="test, compile.koans">
<koan number="4"/>
</target>
<target name="run.koan5" depends="test, compile.koans">
<koan number="5"/>
</target>
<target name="run.koan6" depends="test, compile.koans">
<koan number="6"/>
</target>
<target name="run.koan7" depends="test, compile.koans">
<koan number="7"/>
</target>
<target name="run.koan8" depends="test, compile.koans">
<koan number="8"/>
</target>
<target name="run.koan9" depends="test, compile.koans">
<koan number="9"/>
</target>
<target name="run.koan10" depends="test, compile.koans">
<koan number="10"/>
</target>
<target name="run.koan11" depends="test, compile.koans">
<koan number="11"/>
</target>
<target name="run.koan12" depends="test, compile.koans">
<koan number="12"/>
</target>
<target name="run.koan13" depends="test, compile.koans">
<koan number="13"/>
</target>
<target name="run.koan14" depends="test, compile.koans">
<koan number="14"/>
</target>
<target name="run.koan15" depends="test, compile.koans">
<koan number="15"/>
</target>
<target name="run.advancedkoan02" depends="test, compile.koans">
<advancedkoan number="02"/>
</target>
<target name="run.advancedkoan03" depends="test, compile.koans">
<advancedkoan number="03"/>
</target>
<target name="run.advancedkoan04" depends="test, compile.koans">
<advancedkoan number="04"/>
</target>
<target name="run.advancedkoan05" depends="test, compile.koans">
<advancedkoan number="05"/>
</target>
<target name="run.advancedkoan07" depends="test, compile.koans">
<advancedkoan number="07"/>
</target>
<target name="run.advancedkoan09" depends="test, compile.koans">
<advancedkoan number="09"/>
</target>
<target name="run.advancedkoan10" depends="test, compile.koans">
<advancedkoan number="10"/>
</target>
<target name="run.advancedkoan11" depends="test, compile.koans">
<advancedkoan number="11"/>
</target>
<target name="run.advancedkoan12" depends="test, compile.koans">
<advancedkoan number="12"/>
</target>
<target name="run.advancedkoan13" depends="test, compile.koans">
<advancedkoan number="13"/>
</target>
<target name="generate.eclipse.project" depends="-install.ant-eclipse">
<mkdir dir="${main.target}"/>
<mkdir dir="${test.target}"/>
<mkdir dir="${koan.target}"/>
<eclipse mode="java">
<settings>
<jdtcore compilercompliance="6.0"/>
</settings>
<project name="neo4j-tutorial"/>
<classpath>
<library pathref="path.libs"/>
<source path="${main.src}"/>
<source path="${test.src}"/>
<source path="${koan.src}"/>
<source path="${koan.resource}"/>
<output path="${target}"/>
</classpath>
</eclipse>
</target>
<target name="remove.snippets" description="Remove the snippets">
<replaceregexp match="// SNIPPET_START(.+?)// SNIPPET_END" replace="" flags="gis">
<fileset dir="${koan.src}" includes="**/*.java"/>
</replaceregexp>
</target>
</project>