Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Last active December 18, 2015 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xconnecting/5746552 to your computer and use it in GitHub Desktop.
Save xconnecting/5746552 to your computer and use it in GitHub Desktop.
[Groovy] cucumber-jvm-groovy sample (gradle)
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
//build stuff
sourceCompatibility = 1.6
targetCompatibility = 1.6
configurations {
cucumberRuntime {
extendsFrom testRuntime
}
}
dependencies {
// Groovy library for groovy building!
groovy 'org.codehaus.groovy:groovy-all:2.0.0-beta-2'
/*
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.
VERY ANNOYING BUG
*/
cucumberRuntime files("${jar.archivePath}")
testCompile 'junit:junit:4.10'
testCompile 'info.cukes:cucumber-junit:1.0.9'
testCompile 'info.cukes:cucumber-groovy:1.0.9'
}
repositories {
mavenCentral()
}
task cucumber() {
dependsOn assemble
doLast {
javaexec {
main = "cucumber.cli.Main"
classpath = configurations.cucumberRuntime
args = ['-f', 'pretty', '--glue', 'src/test/groovy', 'src/test/resources']
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment