Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add merged jacoco report #271

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ buildscript {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.1.0'
classpath "org.jacoco:org.jacoco.core:0.8.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as for agent, I don't believe we usually add core jacoco classpath

}
}

plugins {
id "com.jfrog.artifactory" version "4.15.2" apply false
id 'jacoco'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be apply false if you're applying the plugin in each subproject ?

}

description = 'Reactor Core Addons including processors, adapters and more'
Expand Down Expand Up @@ -88,10 +90,15 @@ ext {

apply from: "$gradleScriptDir/doc.gradle"
apply from: "$gradleScriptDir/releaser.gradle"
apply plugin: 'jacoco'

configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
apply plugin: 'jacoco'
repositories {
mavenCentral()
}
Comment on lines +98 to +101
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add this to this particular block? apply plugin: 'jacoco' above should be enough

}


Expand All @@ -102,6 +109,7 @@ configure(subprojects) { project ->
apply plugin: 'java'
apply plugin: 'kotlin'
apply from: "${rootDir}/gradle/setup.gradle"
apply plugin: 'jacoco'

[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:varargs",
"-Xlint:cast",
Expand Down Expand Up @@ -143,6 +151,14 @@ configure(subprojects) { project ->
kotlinOptions.freeCompilerArgs = ["-Xjsr305=strict"]
}

jacocoTestReport {
reports {
html.enabled = true
xml.enabled = true
csv.enabled = true
}
}

// now that kotlin-gradle-plugin 1.1.60 is out with fix for https://youtrack.jetbrains.com/issue/KT-17564
// be wary and fail if the issue of source file duplication in jar comes up again
sourcesJar {
Expand Down Expand Up @@ -186,6 +202,7 @@ configure(subprojects) { project ->
// dependencies that are common across all java projects
dependencies {
compile "io.projectreactor:reactor-core:$reactorCoreVersion"
compile 'org.jacoco:org.jacoco.agent:0.8.3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've never had to add the agent nor even the core jars in our projects before. can you clarify why this is needed?


// JSR-305 annotations
optional "com.google.code.findbugs:jsr305:3.0.2"
Expand All @@ -205,6 +222,37 @@ configure(subprojects) { project ->
}
}

task jacocoMergeAll(type: JacocoMerge) {
dependsOn(subprojects.test, subprojects.jacocoTestReport)
subprojects.each { subproject ->
// exclude common and integration subprojects
if (subproject.name != 'integration' &&
subproject.name != 'common') {
executionData subproject.tasks.withType(Test)
}
}
}

task jacocoRootReport(type: JacocoReport, group: 'verification') {
description = 'Generates an aggregate report from all subprojects'
dependsOn(jacocoMergeAll)

additionalSourceDirs.from =
files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from =
files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from =
files(subprojects.sourceSets.main.output)
executionData.from =
files("${buildDir}/jacoco/jacocoMergeAll.exec")

reports {
html.enabled = true
xml.enabled = false
csv.enabled = true
}
}

project('reactor-adapter') {
description = 'Adapters on top of various async boundary providers'

Expand Down