forked from mvallebr/BDD-java-cucumber-selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
83 lines (74 loc) · 3.62 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<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.8"/>
<property name="cucumber-html.version" value="0.2.1"/>
<property name="gherkin.version" value="2.10.0"/>
<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}/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>