Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
90 lines (80 sloc) 2.86 KB
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="Cuke4Duke Codebreaker" default="cucumber" basedir=".">
<property name="dotgem.parent" value="${basedir}/lib"/>
<property name="gem.home" value="${dotgem.parent}/.gem"/>
<property name="cucumber.bin" value="${gem.home}/bin/cucumber"/>
<property name="feature" value="features" />
<path id="lib">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="compile-main" description="Compile main classes">
<mkdir dir="target/classes"/>
<javac srcdir="src/main/java" destdir="target/classes">
<classpath refid="lib" />
</javac>
</target>
<target name="compile-steps" depends="compile-main" description="Compile test classes">
<mkdir dir="target/test-classes"/>
<javac srcdir="src/test/java" destdir="target/test-classes">
<classpath refid="lib" />
<classpath>
<pathelement location="target/classes"/>
</classpath>
</javac>
</target>
<target name="cucumber" depends="compile-steps" description="Run Cucumber">
<mkdir dir="target/junit-report"/>
<java classname="org.jruby.Main" fork="true" failonerror="true">
<classpath>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="target/classes"/>
<pathelement location="target/test-classes"/>
</classpath>
<env key="GEM_PATH" value="${gem.home}"/>
<jvmarg value="-Dcuke4duke.objectFactory=cuke4duke.internal.java.PicoFactory"/>
<arg value="-r"/>
<arg value="cuke4duke/cucumber_ext"/>
<arg value="${cucumber.bin}"/>
<arg value="--require"/>
<arg value="src/test/java"/>
<arg value="--color"/>
<arg value="--format"/>
<arg value="pretty"/>
<arg value="--format"/>
<arg value="junit"/>
<arg value="--out"/>
<arg value="target/junit-report"/>
<arg value="${feature}"/>
</java>
</target>
<target name="install-deps" depends="download-jars, install-gems" description="Install all dependencies"/>
<target name="download-jars" description="Download jars with ivy">
<ivy:retrieve/>
</target>
<target name="install-gems">
<java classname="org.jruby.Main" fork="true" failonerror="true">
<classpath>
<fileset dir="lib">
<include name="**/jruby*.jar"/>
</fileset>
</classpath>
<!-- Gems will go into lib/.gems -->
<env key="HOME" value="${dotgem.parent}"/>
<arg value="-S"/>
<arg value="gem"/>
<arg value="install"/>
<arg value="--no-ri"/>
<arg value="--no-rdoc"/>
<arg value="--install-dir"/>
<arg value="${gem.home}"/>
<arg value="cucumber"/>
<arg value="rspec"/>
</java>
</target>
<target name="clean" description="Delete all generated artifacts">
<delete dir="${basedir}/target"/>
</target>
</project>