This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
forked from cucumber/cucumber-java-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 45
/
build.xml
89 lines (79 loc) · 4 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
84
85
86
87
88
89
<project name="java-helloworld" basedir="." default="runcukes">
<property name="repo" value="https://repo1.maven.org/maven2"/>
<!-- To figure out compatible combinations of versions, you should examine dependencies in the Maven POM files -->
<property name="cucumber-jvm.version" value="1.2.4"/>
<property name="cucumber-jvm-deps.version" value="1.0.5"/>
<property name="gherkin.version" value="2.12.2"/>
<property name="cucumber-html.version" value="0.2.3"/>
<property name="junit.version" value="4.12"/>
<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-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/cucumber-jvm-deps/${cucumber-jvm-deps.version}/cucumber-jvm-deps-${cucumber-jvm-deps.version}.jar"
dest="${jars}/cucumber-jvm-deps-${cucumber-jvm-deps.version}.jar"/>
<get src="${repo}/info/cukes/gherkin/${gherkin.version}/gherkin-${gherkin.version}.jar"
dest="${jars}/gherkin-${gherkin.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}/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="src/test/resources"/>
<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.api.cli.Main" fork="true" failonerror="false" resultproperty="cucumber.exitstatus">
<classpath refid="classpath"/>
<arg value="--plugin"/>
<arg value="junit:target/cucumber-junit-report.xml"/>
<arg value="--plugin"/>
<arg value="pretty"/>
<arg value="--plugin"/>
<arg value="html:target/cucumber-html-report"/>
<arg value="--glue"/>
<arg value="skeleton"/>
<arg value="src/test/resources"/>
</java>
<junitreport todir="target/cucumber-junit-report">
<fileset dir="target">
<include name="cucumber-junit-report.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>