apply plugin: 'java'
apply plugin: 'groovy'
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "net.saliman:gradle-cobertura-plugin:2.0.0"
}
buildDir = 'target'
}
apply plugin: 'cobertura'
group = 'org.me'
version = '0.1'
sourceCompatibility = 1.7
targetCompatibility = 1.7
def isOnJenkins = System.properties.containsKey('jenkins')
cobertura.coverageFormats = (isOnJenkins)?['xml']:['html']
Jenkinsの設定でswitchesに-Djenkins
と設定しておくとxmlファイルでレポートされる。