-
Notifications
You must be signed in to change notification settings - Fork 83
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
} | ||
} | ||
|
||
plugins { | ||
id "com.jfrog.artifactory" version "4.15.2" apply false | ||
id 'jacoco' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be |
||
} | ||
|
||
description = 'Reactor Core Addons including processors, adapters and more' | ||
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why add this to this particular block? |
||
} | ||
|
||
|
||
|
@@ -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", | ||
|
@@ -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 { | ||
|
@@ -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' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
|
@@ -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' | ||
|
||
|
There was a problem hiding this comment.
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