Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

88 lines (77 sloc) 3.936 kb
<project name="java-helloworld" basedir="." default="runcukes">
<property name="repo" value="https://oss.sonatype.org/content/repositories/releases"/>
<property name="cucumber-jvm.version" value="1.0.11"/>
<property name="cucumber-html.version" value="0.2.1"/>
<property name="gherkin.version" value="2.11.1"/>
<property name="jchronic.version" value="0.2.6"/>
<property name="junit.version" value="4.10"/>
<property name="jars" value="lib"/>
<target name="download">
<mkdir dir="${jars}"/>
<get src="${repo}/info/cukes/cucumber-core/${cucumber-jvm.version}/cucumber-core-${cucumber-jvm.version}.jar"
dest="${jars}/cucumber-core-${cucumber-jvm.version}.jar"/>
<get src="${repo}/info/cukes/cucumber-html/${cucumber-html.version}/cucumber-html-${cucumber-html.version}.jar"
dest="${jars}/cucumber-html-${cucumber-html.version}.jar"/>
<get src="${repo}/info/cukes/cucumber-java/${cucumber-jvm.version}/cucumber-java-${cucumber-jvm.version}.jar"
dest="${jars}/cucumber-java-${cucumber-jvm.version}.jar"/>
<get src="${repo}/info/cukes/cucumber-junit/${cucumber-jvm.version}/cucumber-junit-${cucumber-jvm.version}.jar"
dest="${jars}/cucumber-junit-${cucumber-jvm.version}.jar"/>
<get src="${repo}/info/cukes/gherkin/${gherkin.version}/gherkin-${gherkin.version}.jar"
dest="${jars}/gherkin-${gherkin.version}.jar"/>
<get src="${repo}/com/rubiconproject/oss/jchronic/${jchronic.version}/jchronic-${jchronic.version}.jar"
dest="${jars}/jchronic-${jchronic.version}.jar"/>
<get src="${repo}/junit/junit/${junit.version}/junit-${junit.version}.jar"
dest="${jars}/junit-${junit.version}.jar"/>
</target>
<target name="classpath">
<path id="classpath">
<fileset dir="${jars}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="target/classes"/>
<pathelement location="target/test-classes"/>
</path>
</target>
<target name="compile" depends="classpath">
<mkdir dir="target/classes"/>
<javac srcdir="src/main/java" destdir="target/classes" classpathref="classpath" includeantruntime="false"/>
</target>
<target name="compile-test" depends="compile,classpath">
<mkdir dir="target/test-classes"/>
<javac srcdir="src/test/java" destdir="target/test-classes" classpathref="classpath" includeantruntime="false"/>
</target>
<target name="runcukes" depends="compile-test">
<mkdir dir="target/cucumber-junit-report"/>
<java classname="cucumber.cli.Main" fork="true" failonerror="false" resultproperty="cucumber.exitstatus">
<classpath refid="classpath"/>
<arg value="--format"/>
<arg value="junit:target/cucumber-junit-report/allcukes.xml"/>
<arg value="--format"/>
<arg value="pretty"/>
<arg value="--format"/>
<arg value="html:target/cucumber-html-report"/>
<arg value="--glue"/>
<arg value="cucumber.examples.java.helloworld"/>
<arg value="src/test/resources"/>
</java>
<junitreport todir="target/cucumber-junit-report">
<fileset dir="target/cucumber-junit-report">
<include name="allcukes.xml"/>
</fileset>
<report format="frames" todir="target/cucumber-junit-report"/>
</junitreport>
<fail message="Cucumber failed">
<condition>
<not>
<equals arg1="${cucumber.exitstatus}" arg2="0"/>
</not>
</condition>
</fail>
</target>
<target name="clean">
<delete dir="target"/>
</target>
<target name="clobber" depends="clean">
<delete dir="${jars}"/>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.