mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
Merged in COR-276 (pull request #239)
Added Jacoco code coverage to gradle.
This commit is contained in:
commit
7d39a101d4
51
build.gradle
51
build.gradle
@ -1,6 +1,5 @@
|
||||
group 'com.r3corda'
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'project-report'
|
||||
@ -8,12 +7,32 @@ apply plugin: QuasarPlugin
|
||||
apply plugin: 'com.github.ben-manes.versions'
|
||||
|
||||
allprojects {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'jacoco'
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||
}
|
||||
|
||||
// Our version: bump this on release.
|
||||
group 'com.r3corda'
|
||||
version '0.2-SNAPSHOT'
|
||||
}
|
||||
|
||||
subprojects {
|
||||
jacocoTestReport {
|
||||
additionalSourceDirs = files(sourceSets.main.allSource.srcDirs)
|
||||
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
|
||||
classDirectories = files(sourceSets.main.output)
|
||||
reports {
|
||||
html.enabled = true
|
||||
xml.enabled = true
|
||||
csv.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
@ -41,12 +60,6 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
// Our version: bump this on release.
|
||||
group 'com.r3corda'
|
||||
version '0.2-SNAPSHOT'
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
mavenCentral()
|
||||
@ -154,6 +167,28 @@ task integrationTest(type: Test) {
|
||||
}
|
||||
test.finalizedBy(integrationTest)
|
||||
|
||||
|
||||
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
|
||||
dependsOn = subprojects.test
|
||||
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
|
||||
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
|
||||
classDirectories = files(subprojects.sourceSets.main.output)
|
||||
executionData = files(subprojects.jacocoTestReport.executionData)
|
||||
reports {
|
||||
html.enabled = true
|
||||
xml.enabled = true
|
||||
csv.enabled = false
|
||||
}
|
||||
onlyIf = {
|
||||
true
|
||||
}
|
||||
doFirst {
|
||||
executionData = files(executionData.findAll {
|
||||
it.exists()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(Test) {
|
||||
reports.html.destination = file("${reporting.baseDir}/${name}")
|
||||
}
|
||||
@ -165,4 +200,4 @@ applicationDistribution.into("bin") {
|
||||
from(getIRSDemo)
|
||||
from(getTraderDemo)
|
||||
fileMode = 0755
|
||||
}
|
||||
}
|
@ -61,7 +61,6 @@ class CanonicalizerPlugin implements Plugin<Project> {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
apply plugin: CanonicalizerPlugin
|
||||
|
@ -61,7 +61,6 @@ class CanonicalizerPlugin implements Plugin<Project> {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
apply plugin: CanonicalizerPlugin
|
||||
|
@ -1,4 +1,3 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: QuasarPlugin
|
||||
// Applying the maven plugin means this will get installed locally when running "gradle install"
|
||||
|
@ -114,7 +114,9 @@ fun <T> Iterable<T>.noneOrSingle(): T? {
|
||||
// An alias that can sometimes make code clearer to read.
|
||||
val RunOnCallerThread = MoreExecutors.directExecutor()
|
||||
|
||||
inline fun <T> logElapsedTime(label: String, logger: Logger? = null, body: () -> T): T {
|
||||
// TODO: Add inline back when a new Kotlin version is released and check if the java.lang.VerifyError
|
||||
// returns in the IRSSimulationTest. If not, commit the inline back.
|
||||
fun <T> logElapsedTime(label: String, logger: Logger? = null, body: () -> T): T {
|
||||
val now = System.currentTimeMillis()
|
||||
val r = body()
|
||||
val elapsed = System.currentTimeMillis() - now
|
||||
|
@ -1,7 +1,6 @@
|
||||
group 'com.r3cev.prototyping'
|
||||
version '1.0-SNAPSHOT'
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
sourceCompatibility = 1.5
|
||||
|
@ -1,4 +1,3 @@
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
apply plugin: QuasarPlugin
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user