Advertisement
Guest User

build.gradle

a guest
Jan 15th, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 2.28 KB | None | 0 0
  1. apply plugin: 'java'
  2. apply plugin: 'eclipse'
  3. apply plugin: 'idea'
  4. apply plugin: 'groovy'
  5. apply plugin: 'findbugs'
  6.  
  7. def gitIgnore = file(".gitignore").readLines()
  8. def gitIgnoreDirs = gitIgnore*.trim().findAll { !it.startsWith("#") && it.endsWith("/") }
  9.  
  10. version = '0.1-SNAPSHOT'
  11. description = 'TranslateR'
  12.  
  13. sourceCompatibility = 1.7
  14.  
  15. defaultTasks 'clean', 'unitTest'
  16.  
  17. repositories {
  18.     mavenCentral()
  19.  
  20.     // Spock snapshots repository
  21.     maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
  22. }
  23.  
  24. buildscript {
  25.     repositories {
  26.         mavenCentral()
  27.         maven {
  28.             url = 'http://oss.sonatype.org/content/repositories/snapshots/'
  29.         }
  30.     }
  31.     dependencies {
  32.         classpath "org.spockframework:spock-report:1.0-groovy-1.8-SNAPSHOT"
  33.     }
  34. }
  35.  
  36. dependencies {
  37.     compile 'org.codehaus.groovy:groovy-all:2.1.6'
  38.     testCompile 'org.spockframework:spock-core:1.0-groovy-2.0-SNAPSHOT'
  39. }
  40.  
  41. // Custom test report for the new style Spock reports
  42. ext.spockLogFileDir = file("$buildDir/spock/logFiles")
  43. ext.configFile = file("SpockReportConfig.groovy")
  44.  
  45. test {
  46.     systemProperty "spock.configuration", configFile
  47.     systemProperty "spock.logFileDir", spockLogFileDir
  48.  
  49.     ignoreFailures = true
  50.     doFirst {
  51.         delete spockLogFileDir
  52.     }
  53. }
  54.  
  55. task testReport(dependsOn: test) {
  56.     doFirst {
  57.         Set files = spockLogFileDir.listFiles()
  58.         def reportDir = file("$buildDir/reports/spock")
  59.         new org.spockframework.report.HtmlReportGenerator().with {
  60.             reportName = 'TranslateR Test Report'
  61.             reportFileName = 'index.html'
  62.             logFiles = files
  63.             outputDirectory = reportDir
  64.             local = false
  65.             debug = false
  66.             generate()
  67.         }
  68.         println "See Spock report at ${org.spockframework.util.ConsoleUtil.asClickableFileUrl(new File(reportDir, 'index.html'))}"
  69.     }
  70. }
  71.  
  72. idea {
  73.     project {
  74.         jdkName "1.7"
  75.         configure(modules) {
  76.             excludeDirs = files(gitIgnoreDirs) as Set
  77.         }
  78.         ipr {
  79.             withXml { provider ->
  80.                 def node = provider.asNode()
  81.                 node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
  82.             }
  83.         }
  84.     }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement