1+ buildscript {
2+ repositories {
3+ maven {
4+ url " https://plugins.gradle.org/m2/"
5+ }
6+ }
7+
8+ dependencies {
9+ classpath " net.saliman:gradle-cobertura-plugin:2.2.8"
10+ }
11+ }
12+
113allprojects {
2- apply plugin : ' idea'
14+ apply plugin : ' java'
15+ apply plugin : ' idea'
16+ apply plugin : ' eclipse'
17+ apply plugin : ' net.saliman.cobertura'
18+
19+ repositories {
20+ mavenCentral()
21+ }
22+
23+ dependencies {
24+ testCompile group : ' junit' , name : ' junit' , version : ' 4.11'
25+ // Cobertura declares a dependency on the slf4j API, so we need to supply
26+ // a runtime implementation to avoid NoClassDefFoundErrors
27+ testRuntime " org.slf4j:slf4j-log4j12:1.7.5"
28+ testRuntime " log4j:log4j:1.2.17"
29+ }
330}
431
532ext {
@@ -11,16 +38,6 @@ task printProperties << {
1138}
1239
1340subprojects {
14- apply plugin : ' eclipse'
15- apply plugin : ' java'
16-
17- repositories {
18- mavenCentral()
19- }
20-
21- dependencies {
22- testCompile group : ' junit' , name : ' junit' , version : ' 4.11'
23- }
2441
2542 sourceCompatibility = 1.5
2643 targetCompatibility = 1.5
@@ -34,3 +51,33 @@ subprojects {
3451 }
3552 }
3653}
54+
55+ test. dependsOn([' :core:test' , ' :prov:test' , ' :pkix:test' , ' :mail:test' , ' pg:test' ])
56+
57+ cobertura {
58+ coverageDirs = [
59+ " ${ rootProject.projectDir} /core/build/classes/main" ,
60+ " ${ rootProject.projectDir} /mail/build/classes/main" ,
61+ " ${ rootProject.projectDir} /pg/build/classes/main" ,
62+ " ${ rootProject.projectDir} /pkix/build/classes/main" ,
63+ " ${ rootProject.projectDir} /prov/build/classes/main"
64+ ]
65+ coverageSourceDirs = [
66+ " ${ rootProject.projectDir} /core/src/main/java" ,
67+ " ${ rootProject.projectDir} /mail/src/main/java" ,
68+ " ${ rootProject.projectDir} /pg/src/main/java" ,
69+ " ${ rootProject.projectDir} /pkix/src/main/java" ,
70+ " ${ rootProject.projectDir} /prov/src/main/java" ,
71+ ]
72+ coverageMergeDatafiles = [
73+ file(" ${ rootProject.projectDir} /core/build/cobertura/cobertura.ser" ),
74+ file(" ${ rootProject.projectDir} /mail/build/cobertura/cobertura.ser" ),
75+ file(" ${ rootProject.projectDir} /pg/build/cobertura/cobertura.ser" ),
76+ file(" ${ rootProject.projectDir} /pkix/build/cobertura/cobertura.ser" ),
77+ file(" ${ rootProject.projectDir} /prov/build/cobertura/cobertura.ser" ),
78+ ]
79+ auxiliaryClasspath + = files(" ${ rootProject.projectDir} /core/build/classes/main" )
80+ coverageFormats = [' html' , ' xml' ]
81+ coverageReportDir = new File (" ${ rootProject.projectDir} /build/reports/cobertura" )
82+ }
83+
0 commit comments