Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apply plugin: 'java'
- apply plugin: 'eclipse'
- apply plugin: 'idea'
- apply plugin: 'groovy'
- apply plugin: 'findbugs'
- def gitIgnore = file(".gitignore").readLines()
- def gitIgnoreDirs = gitIgnore*.trim().findAll { !it.startsWith("#") && it.endsWith("/") }
- version = '0.1-SNAPSHOT'
- description = 'TranslateR'
- sourceCompatibility = 1.7
- defaultTasks 'clean', 'unitTest'
- repositories {
- mavenCentral()
- // Spock snapshots repository
- maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
- }
- buildscript {
- repositories {
- mavenCentral()
- maven {
- url = 'http://oss.sonatype.org/content/repositories/snapshots/'
- }
- }
- dependencies {
- classpath "org.spockframework:spock-report:1.0-groovy-1.8-SNAPSHOT"
- }
- }
- dependencies {
- compile 'org.codehaus.groovy:groovy-all:2.1.6'
- testCompile 'org.spockframework:spock-core:1.0-groovy-2.0-SNAPSHOT'
- }
- // Custom test report for the new style Spock reports
- ext.spockLogFileDir = file("$buildDir/spock/logFiles")
- ext.configFile = file("SpockReportConfig.groovy")
- test {
- systemProperty "spock.configuration", configFile
- systemProperty "spock.logFileDir", spockLogFileDir
- ignoreFailures = true
- doFirst {
- delete spockLogFileDir
- }
- }
- task testReport(dependsOn: test) {
- doFirst {
- Set files = spockLogFileDir.listFiles()
- def reportDir = file("$buildDir/reports/spock")
- new org.spockframework.report.HtmlReportGenerator().with {
- reportName = 'TranslateR Test Report'
- reportFileName = 'index.html'
- logFiles = files
- outputDirectory = reportDir
- local = false
- debug = false
- generate()
- }
- println "See Spock report at ${org.spockframework.util.ConsoleUtil.asClickableFileUrl(new File(reportDir, 'index.html'))}"
- }
- }
- idea {
- project {
- jdkName "1.7"
- configure(modules) {
- excludeDirs = files(gitIgnoreDirs) as Set
- }
- ipr {
- withXml { provider ->
- def node = provider.asNode()
- node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement