Last active
December 18, 2015 07:29
-
-
Save xconnecting/5746552 to your computer and use it in GitHub Desktop.
[Groovy] cucumber-jvm-groovy sample (gradle)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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