-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.gradle
55 lines (42 loc) · 1.46 KB
/
build.gradle
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
apply plugin: 'java'
apply plugin: 'groovy'
//build stuff
sourceCompatibility = 1.6
targetCompatibility = 1.6
def cucumberVersion = "1.2.4"
repositories {
mavenCentral()
}
configurations {
cucumberRuntime {
extendsFrom testRuntime
}
}
task cucumber() {
dependsOn assemble
doLast {
javaexec {
main = "cucumber.api.cli.Main"
classpath = configurations.cucumberRuntime
args = ['--plugin', 'pretty', '--glue', 'src/test/groovy', 'src/test/resources']
}
}
}
//Ensure the cucumber tests are executed as part of the build. Makes for a very pretty output.
build.dependsOn cucumber
dependencies {
// Groovy library for groovy building!
compile 'org.codehaus.groovy:groovy-all:2.4.3'
/*
In order to work around a really flagrant bug ( http://issues.gradle.org/browse/GRADLE-732 )
You have to create a configuration that includes the jar.archivePath (the jar.archivePath is created by the java plugin)
and give it the same name as the cucumberRuntime configuration, or name it something different and have the cucumberRuntime
configuration extend from it as well.
Still a bug in gradle 2.4, despite their saying that they would fix it before 1.0
VERY ANNOYING BUG
*/
cucumberRuntime files("${jar.archivePath}")
testCompile 'junit:junit:4.11'
testCompile "info.cukes:cucumber-junit:$cucumberVersion"
testCompile "info.cukes:cucumber-groovy:$cucumberVersion"
}