Caleb Cushing
08/12/2024, 8:03 PMtest suite in 2 and now my coverage has droppedVampire
08/13/2024, 12:17 AMhow can I make jacoco play nice with JvmTestSuiteIt does in one way of the definition. It provides you with coverage report per test type. And with the
jacoco-report-aggregation plugin you can merge the reports of multiple projects per test type.
If you want an overall JaCoCo report over all test types, you have to manually configure it.Caleb Cushing
08/13/2024, 3:22 PMCould not create domain object 'whitebox' (JvmTestSuite)
> Cannot query the value of this provider because it has no value available.
The value of this provider is derived from:
- property 'testType'
I'm applying the jacoco* plugins via a convention pluginCaleb Cushing
08/13/2024, 3:23 PMCaleb Cushing
08/13/2024, 3:28 PMCaleb Cushing
08/13/2024, 3:29 PMCaleb Cushing
08/13/2024, 3:29 PMVampire
08/13/2024, 3:31 PMCaleb Cushing
08/13/2024, 3:31 PMCaleb Cushing
08/13/2024, 3:36 PMVampire
08/13/2024, 3:36 PMCaleb Cushing
08/13/2024, 3:37 PMCaleb Cushing
08/13/2024, 3:38 PMCaleb Cushing
08/13/2024, 3:39 PM72
val whitebox by registering(JvmTestSuite::class) {Vampire
08/13/2024, 3:44 PMtesting.suites.all { ... } or testing.suites.configureEach { ... } that tries to use the suite type before it got set, and something causes the suite to be realized immediatelyCaleb Cushing
08/13/2024, 3:46 PMVampire
08/13/2024, 3:47 PMCaleb Cushing
08/13/2024, 3:49 PMCaleb Cushing
08/13/2024, 3:49 PMCaleb Cushing
08/13/2024, 3:53 PMCaleb Cushing
08/13/2024, 3:54 PMCaleb Cushing
08/13/2024, 4:00 PMif (!testType.isPresent) testType.set(TestSuiteType.INTEGRATION_TEST)Caleb Cushing
08/13/2024, 4:00 PMCaleb Cushing
08/13/2024, 4:00 PMVampire
08/13/2024, 4:02 PMVampire
08/13/2024, 4:02 PMCaleb Cushing
08/13/2024, 4:02 PMVampire
08/13/2024, 4:03 PMCaleb Cushing
08/13/2024, 4:03 PMCaleb Cushing
08/13/2024, 4:03 PMVampire
08/13/2024, 4:03 PMCaleb Cushing
08/13/2024, 4:04 PMVampire
08/13/2024, 4:04 PMCaleb Cushing
08/13/2024, 4:04 PMVampire
08/13/2024, 4:04 PMVampire
08/13/2024, 4:04 PMsnippets is arguably better than the backtick supportIt's arguably much worse, yes 🙂
Vampire
08/13/2024, 4:05 PMVampire
08/13/2024, 4:06 PMCaleb Cushing
08/13/2024, 4:06 PMVampire
08/13/2024, 4:07 PMCaleb Cushing
08/13/2024, 4:07 PMCaleb Cushing
08/13/2024, 4:07 PMCaleb Cushing
08/13/2024, 4:07 PMCaleb Cushing
08/13/2024, 4:08 PMVampire
08/13/2024, 4:08 PMCaleb Cushing
08/13/2024, 4:08 PMCaleb Cushing
08/13/2024, 4:08 PMCaleb Cushing
08/13/2024, 4:08 PMCaleb Cushing
08/13/2024, 4:09 PMCaleb Cushing
08/13/2024, 4:09 PMVampire
08/13/2024, 4:10 PMVampire
08/13/2024, 4:10 PMso what's the right answer for the aggregate pluginset the test type on the report you defined, as I said
Caleb Cushing
08/13/2024, 4:21 PM// © Copyright 2023-2024 Caleb Cushing
// SPDX-License-Identifier: MIT
plugins {
`java-base`
jacoco
}
val coverage = project.extensions.create<CoveragePluginExtension>("coverage")
tasks.withType<JacocoReport> {
dependsOn(project.tasks.withType<Test>())
}
project.tasks.check.configure {
dependsOn(tasks.withType<JacocoCoverageVerification>())
}
tasks.withType<JacocoCoverageVerification>().configureEach {
dependsOn(project.tasks.withType<JacocoReport>())
violationRules {
rule {
limit {
coverage.minimum.convention(0.9).let { minimum = it.get().toBigDecimal() }
}
}
}
}
interface CoveragePluginExtension {
val minimum: Property<Double>
}Caleb Cushing
08/13/2024, 4:22 PMVampire
08/13/2024, 4:23 PMVampire
08/13/2024, 4:31 PMVampire
08/13/2024, 4:31 PMVampire
08/13/2024, 4:32 PMconfiugreEach could be the problem, as then the report is eagerly evaluated and then is missing the testtype as it is not set on the test suite yetVampire
08/13/2024, 4:33 PMtestType property is missing a value 😕Caleb Cushing
08/13/2024, 5:06 PMCaleb Cushing
08/13/2024, 5:08 PMCaleb Cushing
08/13/2024, 5:09 PMCaleb Cushing
08/13/2024, 5:10 PMVampire
08/13/2024, 5:10 PMCaleb Cushing
08/13/2024, 5:10 PMCaleb Cushing
08/13/2024, 5:10 PMVampire
08/13/2024, 5:10 PMVampire
08/13/2024, 5:11 PMreportsOn all the test tasks.Vampire
08/13/2024, 5:11 PMCaleb Cushing
08/13/2024, 5:11 PMVampire
08/13/2024, 5:12 PMCaleb Cushing
08/13/2024, 5:12 PMCaleb Cushing
08/13/2024, 5:12 PMVampire
08/13/2024, 5:13 PMVampire
08/13/2024, 5:13 PMVampire
08/13/2024, 5:13 PMVampire
08/13/2024, 5:14 PMCaleb Cushing
08/13/2024, 5:14 PMVampire
08/13/2024, 5:14 PMVampire
08/13/2024, 5:15 PMCaleb Cushing
08/13/2024, 5:15 PMVampire
08/13/2024, 5:15 PMVampire
08/13/2024, 5:15 PMCaleb Cushing
08/13/2024, 5:15 PMVampire
08/13/2024, 5:15 PMVampire
08/13/2024, 5:16 PMI mean, I didn't create it, but I think only one is created by default for testExactly
Vampire
08/13/2024, 5:19 PMexecutionData(tasks.withType<Test>()) and can then even remove the explicit dependency from report task to test tasksCaleb Cushing
08/13/2024, 5:28 PMtasks.withType<JacocoReport>().configureEach {
dependsOn(project.tasks.withType<Test>()) // tried removing
executionData(project.tasks.withType<Test>())
}
Could not determine the dependencies of task ':controller-authn:jacocoTestCoverageVerification'.
> Could not create task ':controller-authn:jacocoTestReport'.
> DefaultTaskCollection#all(Action) on task set cannot be executed in the current context.Caleb Cushing
08/13/2024, 5:30 PMCaleb Cushing
08/13/2024, 5:31 PM// © Copyright 2024 Caleb Cushing
// SPDX-License-Identifier: MIT
import com.github.spotbugs.snom.SpotBugsTask
buildscript { dependencyLocking { lockAllConfigurations() } }
plugins {
our.javalibrary
}
val demoServer by sourceSets.creating
java {
registerFeature("demoServer") {
usingSourceSet(demoServer)
}
}
val demoServerImplementation by configurations.existing
val demoServerRuntimeOnly by configurations.existing
val demoServerApi by configurations.existing
dependencies {
implementation(libs.spring.security.config)
implementation(libs.spring.security.web)
implementation(libs.spring.context)
runtimeOnly(libs.starter.security)
runtimeOnly(libs.starter.web)
runtimeOnly(libs.starter.oauth2.resource.server)
testFixturesImplementation(platform(libs.spring.bom))
testFixturesImplementation(libs.log4j.api)
testFixturesImplementation(libs.spring.security.core)
testFixturesImplementation(libs.spring.web)
testImplementation(libs.bundles.spring.test)
testRuntimeOnly(libs.starter.web)
testRuntimeOnly(libs.starter.webflux)
testRuntimeOnly(projects.testApp)
demoServerApi(platform(libs.spring.bom))
demoServerApi(libs.spring.context)
demoServerApi(libs.spring.boot.autoconfigure)
demoServerImplementation(platform(libs.spring.bom))
demoServerImplementation(libs.spring.security.config)
demoServerImplementation(libs.spring.webmvc)
demoServerImplementation(libs.spring.boot.actuator)
demoServerImplementation(libs.spring.boot.core)
demoServerRuntimeOnly(platform(libs.spring.bom))
demoServerRuntimeOnly(testFixtures(project))
demoServerRuntimeOnly(libs.spring.boot.devtools)
demoServerRuntimeOnly(libs.starter.actuator)
demoServerRuntimeOnly(libs.starter.log4j2)
demoServerRuntimeOnly(libs.starter.web)
demoServerRuntimeOnly(libs.starter.security)
demoServerRuntimeOnly(libs.starter.oauth2.resource.server)
modules {
module("org.springframework.boot:spring-boot-starter-logging") {
replacedBy(
"org.springframework.boot:spring-boot-starter-log4j2",
"Use Log4j2 instead of Logback",
)
}
}
}
tasks.withType<Test>().configureEach {
enabled = false
}
tasks.withType<JacocoCoverageVerification>().configureEach {
enabled = false
}
tasks.withType<SpotBugsTask>().configureEach {
enabled = false
}
tasks.withType<Javadoc>().configureEach {
enabled = false
}Caleb Cushing
08/13/2024, 5:32 PMVampire
08/13/2024, 5:32 PMCaleb Cushing
08/13/2024, 5:32 PMCaleb Cushing
08/13/2024, 5:33 PMVampire
08/13/2024, 5:33 PMCaleb Cushing
08/13/2024, 5:33 PMCaleb Cushing
08/13/2024, 5:34 PMCaleb Cushing
08/13/2024, 5:34 PMCaleb Cushing
08/13/2024, 5:35 PMCaleb Cushing
08/13/2024, 5:35 PMCaleb Cushing
08/13/2024, 5:36 PMCaleb Cushing
08/13/2024, 5:46 PMCaleb Cushing
08/13/2024, 5:50 PMCould not create task ':jpa:whiteboxCodeCoverageReport'.
DefaultTaskCollection#all(Action) on task set cannot be executed in the current context.Caleb Cushing
08/13/2024, 5:52 PMCaleb Cushing
08/13/2024, 5:55 PMCaleb Cushing
08/13/2024, 5:55 PMCaleb Cushing
08/13/2024, 5:56 PM.gradlew foo:bar --json | jq ".scan" | clipVampire
08/13/2024, 6:10 PMif scans are preferred to snippetyes, always for me 🙂
Vampire
08/13/2024, 6:12 PMdevelocity {
buildScan {
buildScanPublished {
// log ${this.buildScanUri} in parseable form or set clipboard to it
}
}
}Caleb Cushing
08/13/2024, 6:13 PMCaleb Cushing
08/13/2024, 6:14 PMVampire
08/13/2024, 6:21 PMall is no longer legalVampire
08/13/2024, 6:25 PMtasks.withType<Test>().configureEach {
tasks.jacocoTestReport {
executionData(this@configureEach)
}
}Caleb Cushing
08/13/2024, 6:34 PMtasks.withType<Test>().configureEach {
tasks.withType<JacocoReport>().named("jacocoTestReport") {
executionData(this@configureEach)
}
}
https://gradle.com/s/rjqsnzklgxfuqVampire
08/13/2024, 6:38 PMtasks.withType<Test>().configureEach {
tasks.named<JacocoReport>("jacocoTestReport") {
executionData(this@configureEach)
}
}Caleb Cushing
08/13/2024, 6:40 PMVampire
08/13/2024, 6:44 PMVampire
08/13/2024, 6:45 PMCaleb Cushing
08/13/2024, 6:47 PMCaleb Cushing
08/13/2024, 6:47 PMCaleb Cushing
08/13/2024, 6:47 PMVampire
08/13/2024, 6:51 PMtasks.jacocoTestReport {
tasks.withType<Test>().forEach(::executionData)
}
And you do seem to still need the explicit task dependency 😞Vampire
08/13/2024, 6:51 PMwithType but simply in the test suite configuration if that worksVampire
08/13/2024, 6:54 PMtesting {
suites {
val fooTests by registering(JvmTestSuite::class) {
targets.all {
tasks.jacocoTestReport {
executionData(testTask)
}
}
}
}
}Vampire
08/13/2024, 6:55 PMjacocoTestReport it gives no error and automatically depends on fooTestsVampire
08/13/2024, 6:55 PMCaleb Cushing
08/13/2024, 6:56 PMwhitebox not fooTests and test will automoagically work?Vampire
08/13/2024, 7:18 PMsuites.configureEach I hopeCaleb Cushing
08/13/2024, 7:24 PM> Task :prepareKotlinBuildScriptModel UP-TO-DATE
Download <https://plugins.gradle.org/m2/com/diffplug/spotless/spotless-plugin-gradle/maven-metadata.xml>, took 116 ms
Download <https://plugins.gradle.org/m2/com/github/spotbugs/snom/spotbugs-gradle-plugin/maven-metadata.xml>, took 44 ms
Download <https://plugins.gradle.org/m2/net/ltgt/gradle/gradle-errorprone-plugin/maven-metadata.xml>, took 39 msCaleb Cushing
08/13/2024, 7:31 PMCaleb Cushing
08/13/2024, 7:31 PM// © Copyright 2023-2024 Caleb Cushing
// SPDX-License-Identifier: MIT
buildscript { dependencyLocking { lockAllConfigurations() } }
plugins { our.javalibrary }
coverage {
// right now whitebox testing has broken this
minimum.set(0.2)
}
dependencies {
annotationProcessor(platform(libs.jakarta.bom))
annotationProcessor(platform(libs.spring.bom))
annotationProcessor(libs.hibernate.jpa.modelgen)
compileOnly(libs.java.tools)
api(projects.model)
api(libs.jakarta.persistence)
api(libs.jakarta.validation)
api(libs.spring.context)
api(libs.spring.data.commons)
api(libs.hibernate.envers)
implementation(libs.commons.lang)
implementation(libs.spring.beans)
implementation(libs.spring.transaction)
runtimeOnly(libs.starter.data.jpa)
runtimeOnly(libs.starter.validation)
// transients required by jakarta transaction which is required by hibernate
runtimeOnly(libs.jakarta.cdi)
runtimeOnly(libs.jakarta.lang.model)
runtimeOnly(libs.jakarta.interceptor)
testFixturesAnnotationProcessor(platform(libs.jakarta.bom))
testFixturesAnnotationProcessor(platform(libs.spring.bom))
testFixturesAnnotationProcessor(libs.hibernate.jpa.modelgen)
testFixturesApi(projects.model)
testFixturesApi(libs.spring.data.jpa)
testFixturesImplementation(libs.uuid.creator)
testFixturesImplementation(libs.java.tools)
testFixturesCompileOnlyApi(libs.jspecify)
}
testing {
suites {
withType<JvmTestSuite>().configureEach {
dependencies {
implementation(testFixtures(project()))
implementation(platform(libs.jakarta.bom))
implementation(platform(libs.spring.bom))
implementation(libs.spring.test)
implementation(libs.spring.boot.test.autoconfigure)
implementation(libs.spring.boot.test.core)
runtimeOnly(libs.h2)
runtimeOnly(libs.starter.validation)
runtimeOnly(libs.starter.data.jpa)
runtimeOnly(libs.starter.aop)
runtimeOnly(projects.testApp)
runtimeOnly(libs.spring.data.envers)
}
}
val test by getting(JvmTestSuite::class) {
dependencies {
implementation(libs.spring.orm)
compileOnly(libs.jspecify)
}
}
val whitebox by registering(JvmTestSuite::class) {
targets.all {
tasks.jacocoTestReport {
executionData(testTask)
}
}
dependencies {
implementation(projects.jpa)
implementation(projects.model)
implementation(libs.equalsverifier)
implementation(libs.commons.lang)
implementation(libs.spring.beans)
implementation(libs.spring.transaction)
implementation(libs.hibernate.orm.core)
}
}
}
}
tasks.compileJava {
options.release = 17
options.compilerArgs.addAll(
listOf(
"-AaddSuppressWarningsAnnotation=true",
"-AaddGeneratedAnnotation=true",
),
)
}Caleb Cushing
08/13/2024, 8:08 PMtasks.withType<JacocoReport>().configureEach {
dependsOn(project.tasks.withType<Test>())
val files = project.layout.buildDirectory.dir("jacoco").get().asFileTree.toList()
logger.quiet("Jacoco: {}", files)
executionData(files)
}
would have thought that would work based on my understanding of the googleCaleb Cushing
08/13/2024, 8:12 PMCaleb Cushing
08/13/2024, 8:16 PM// © Copyright 2023-2024 Caleb Cushing
// SPDX-License-Identifier: MIT
plugins {
`java-base`
jacoco
// `jacoco-report-aggregation`
}
val coverage = project.extensions.create<CoveragePluginExtension>("coverage")
tasks.withType<JacocoReport>().configureEach {
dependsOn(project.tasks.withType<Test>())
val files = project.layout.buildDirectory.dir("jacoco").map { it.asFileTree.toList() }
executionData(files)
}
project.tasks.check.configure {
dependsOn(tasks.withType<JacocoCoverageVerification>())
}
tasks.withType<JacocoCoverageVerification>().configureEach {
dependsOn(project.tasks.withType<JacocoReport>())
violationRules {
rule {
limit {
coverage.minimum.convention(0.9).let { minimum = it.get().toBigDecimal() }
}
}
}
}
interface CoveragePluginExtension {
val minimum: Property<Double>
}Caleb Cushing
08/13/2024, 8:16 PMCaleb Cushing
08/13/2024, 8:16 PMCaleb Cushing
08/13/2024, 8:20 PM// © Copyright 2023-2024 Caleb Cushing
// SPDX-License-Identifier: MIT
plugins {
`java-base`
jacoco
// `jacoco-report-aggregation`
}
val coverage = project.extensions.create<CoveragePluginExtension>("coverage")
tasks.withType<JacocoReport>().configureEach {
dependsOn(project.tasks.withType<Test>())
val files = project.layout.buildDirectory.dir("jacoco").map { it.asFileTree.toList() }
executionData(files)
}
project.tasks.check.configure {
dependsOn(tasks.withType<JacocoCoverageVerification>())
}
tasks.withType<JacocoCoverageVerification>().configureEach {
executionData(project.tasks.withType<JacocoReport>().map { it.executionData })
violationRules {
rule {
limit {
coverage.minimum.convention(0.9).let { minimum = it.get().toBigDecimal() }
}
}
}
}
interface CoveragePluginExtension {
val minimum: Property<Double>
}Caleb Cushing
08/13/2024, 8:52 PMtasks.withType<JacocoReport>().configureEach {
dependsOn(project.tasks.withType<Test>())
// execution data needs to be aggregated from all exec files in the project for multi jvm test suite testing
executionData(project.layout.buildDirectory.dir("jacoco"))
}
seems to work, but I'm wondering if there's a way to get that jacoco string from a configured setting instead which feels like surprising behavior because it can be overriden in the jacoco task but I can't find a way to get the resultCaleb Cushing
08/13/2024, 9:12 PMVampire
08/13/2024, 9:20 PMVampire
08/13/2024, 9:20 PMVampire
08/13/2024, 9:20 PMVampire
08/13/2024, 9:20 PM...filetree... I meanCaleb Cushing
08/13/2024, 9:20 PMCaleb Cushing
08/13/2024, 9:20 PMCaleb Cushing
08/13/2024, 9:21 PMVampire
08/13/2024, 9:21 PMif there's a way to get thatI guessstring from a configured settingjacoco
output on the JacocoTaskExtension on the Test task?Caleb Cushing
08/13/2024, 9:22 PMCaleb Cushing
08/13/2024, 9:22 PMVampire
08/13/2024, 9:23 PMVampire
08/13/2024, 9:23 PMfiltree doesVampire
08/13/2024, 9:23 PMexecutionData called with not task collection or task is basically like configurableFileColleciton.from I thinkCaleb Cushing
08/13/2024, 9:24 PMjacoco dir was missing...Vampire
08/13/2024, 9:27 PMCaleb Cushing
08/13/2024, 9:28 PMCaleb Cushing
08/13/2024, 9:28 PMbuildCaleb Cushing
08/13/2024, 9:42 PMmodel tooCaleb Cushing
08/13/2024, 9:45 PMVampire
08/13/2024, 10:11 PMCaleb Cushing
08/13/2024, 10:12 PMVampire
08/13/2024, 10:14 PMTEST_SUITE_TYPE_ATTRIBUTE set to all.
Then like the jacoco plugin you configureEach all test suites, doing adding testTask.map { it.jacoco.destinationFile!! } as artifact to that configuration with type BINARY_DATA_TYPE.
And then you can register a report for the jacoco report aggregation plugin with test type all.Vampire
08/13/2024, 10:14 PMand how will I be able to validate that each library meets its standard? so that I don't end up with entire libraries untested because they're smallNot sure what you mean
Caleb Cushing
08/13/2024, 10:14 PMVampire
08/13/2024, 10:14 PMCaleb Cushing
08/13/2024, 10:15 PMCaleb Cushing
08/13/2024, 10:15 PMCaleb Cushing
08/13/2024, 10:15 PMVampire
08/13/2024, 10:16 PMCaleb Cushing
08/13/2024, 10:16 PMCaleb Cushing
08/13/2024, 10:16 PMVampire
08/13/2024, 10:17 PMisTransitive = falseVampire
08/13/2024, 10:17 PMCaleb Cushing
08/13/2024, 10:24 PMCaleb Cushing
08/13/2024, 10:24 PMVampire
08/13/2024, 10:24 PMCaleb Cushing
08/13/2024, 10:25 PMCaleb Cushing
09/05/2024, 4:42 PMCaleb Cushing
09/05/2024, 4:44 PMjacocoTestReport - Generates code coverage report for the test task. but that didn't actually generate a reportVampire
09/05/2024, 4:45 PMVampire
09/05/2024, 4:45 PMtestSuite is italic, that means it is a placeholderCaleb Cushing
09/05/2024, 4:45 PMVampire
09/05/2024, 4:45 PMVampire
09/05/2024, 4:45 PMintegTestCodeCoverageReport if the test suite is called integTestVampire
09/05/2024, 4:45 PMjacocoTestReport is the standard JaCoCo report task, not related to the aggregation pluginVampire
09/05/2024, 4:46 PMprobably, they should be better writtenAlways
Vampire
09/05/2024, 4:46 PMCaleb Cushing
09/05/2024, 4:46 PMVampire
09/05/2024, 4:46 PMVampire
09/05/2024, 4:46 PMyes, I know, but it was the one listed in gradlew tasksBoth should be listed
Caleb Cushing
09/05/2024, 4:46 PMCaleb Cushing
09/05/2024, 4:47 PMCaleb Cushing
09/05/2024, 4:47 PMReusing configuration cache.
> Task :tasks
------------------------------------------------------------
Tasks runnable from root project 'spring-app-commons'
------------------------------------------------------------
Build tasks
-----------
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
classes - Assembles main classes.
clean - Deletes the build directory.
demoServerClasses - Assembles demo server classes.
demoServerJar - Assembles a jar archive containing the classes of the 'demoServer' feature.
jar - Assembles a jar archive containing the classes of the 'main' feature.
javadocJar - Assembles a jar archive containing the main javadoc.
sourcesJar - Assembles a jar archive containing the main sources.
testClasses - Assembles test classes.
testFixturesClasses - Assembles test fixtures classes.
testFixturesJar - Assembles a jar archive containing the classes of the 'testFixtures' feature.
whiteboxClasses - Assembles whitebox classes.
Build Setup tasks
-----------------
init - Initializes a new Gradle build.
updateDaemonJvm - Generates or updates the Gradle Daemon JVM criteria.
wrapper - Generates Gradle wrapper files.
Dependency-analysis tasks
-------------------------
abiAnalysisDemoServer - Produces a report of the ABI of this project
abiAnalysisMain - Produces a report of the ABI of this project
abiAnalysisTestFixtures - Produces a report of the ABI of this project
buildHealth - Generates holistic advice for whole project, and can fail the build if desired
computeDominatorTreeCompileDemoServer - Computes a dominator view of the dependency graph
computeDominatorTreeCompileMain - Computes a dominator view of the dependency graph
computeDominatorTreeCompileTest - Computes a dominator view of the dependency graph
computeDominatorTreeCompileTestFixtures - Computes a dominator view of the dependency graph
computeDominatorTreeCompileWhitebox - Computes a dominator view of the dependency graph
computeDominatorTreeRuntimeDemoServer - Computes a dominator view of the dependency graph
computeDominatorTreeRuntimeMain - Computes a dominator view of the dependency graph
computeDominatorTreeRuntimeTest - Computes a dominator view of the dependency graph
computeDominatorTreeRuntimeTestFixtures - Computes a dominator view of the dependency graph
computeDominatorTreeRuntimeWhitebox - Computes a dominator view of the dependency graph
computeDuplicateDependencies - Computes 'duplicate' external dependencies across entire build.
computeResolvedDependencies - Computes resolved external dependencies for all variants.
fixDependencies - Rewrite build script for this project to match dependency advice
generateProjectGraphDemoServer - Generates a graph view of this project's local dependency graph
generateProjectGraphMain - Generates a graph view of this project's local dependency graph
generateProjectGraphTest - Generates a graph view of this project's local dependency graph
generateProjectGraphTestFixtures - Generates a graph view of this project's local dependency graph
generateProjectGraphWhitebox - Generates a graph view of this project's local dependency graph
printDominatorTreeCompileDemoServer - Prints a dominator view of the dependency graph
printDominatorTreeCompileMain - Prints a dominator view of the dependency graph
printDominatorTreeCompileTest - Prints a dominator view of the dependency graph
printDominatorTreeCompileTestFixtures - Prints a dominator view of the dependency graph
printDominatorTreeCompileWhitebox - Prints a dominator view of the dependency graph
printDominatorTreeRuntimeDemoServer - Prints a dominator view of the dependency graph
printDominatorTreeRuntimeMain - Prints a dominator view of the dependency graph
printDominatorTreeRuntimeTest - Prints a dominator view of the dependency graph
printDominatorTreeRuntimeTestFixtures - Prints a dominator view of the dependency graph
printDominatorTreeRuntimeWhitebox - Prints a dominator view of the dependency graph
printDuplicateDependencies - Prints report of dependencies that have multiple versions across the build.
projectHealth - Prints advice for this project
reason - Explain how a dependency is used
Documentation tasks
-------------------
demoServerJavadoc - Generates Javadoc API documentation for the 'demoServer' feature.
javadoc - Generates Javadoc API documentation for the 'main' feature.
testFixturesJavadoc - Generates Javadoc API documentation for the 'testFixtures' feature.
Gradle Enterprise tasks
-----------------------
buildScanPublishPrevious - Publishes the data captured by the last build.
provisionGradleEnterpriseAccessKey - Provisions a new access key for this build environment.
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'spring-app-commons'.
dependencies - Displays all dependencies declared in root project 'spring-app-commons'.
dependencyInsight - Displays the insight into a specific dependency in root project 'spring-app-commons'.
help - Displays a help message.
javaToolchains - Displays the detected java toolchains.
kotlinDslAccessorsReport - Prints the Kotlin code for accessing the currently available project extensions and conventions.
outgoingVariants - Displays the outgoing variants of root project 'spring-app-commons'.
projects - Displays the sub-projects of root project 'spring-app-commons'.
properties - Displays the properties of root project 'spring-app-commons'.
resolvableConfigurations - Displays the configurations that can be resolved in root project 'spring-app-commons'.
tasks - Displays the tasks runnable from root project 'spring-app-commons' (some of the displayed tasks may belong to subprojects).
Publishing tasks
----------------
generateMetadataFileForMavenPublication - Generates the Gradle metadata file for publication 'maven'.
generatePomFileForMavenPublication - Generates the Maven POM file for publication 'maven'.
publish - Publishes all publications produced by this project.
publishAllPublicationsToGhRepository - Publishes all Maven publications produced by this project to the gh repository.
publishMavenPublicationToGhRepository - Publishes Maven publication 'maven' to Maven repository 'gh'.
publishMavenPublicationToMavenLocal - Publishes Maven publication 'maven' to the local Maven repository.
publishToMavenLocal - Publishes all Maven publications produced by this project to the local Maven cache.
Verification tasks
------------------
check - Runs all checks.
jacocoTestCoverageVerification - Verifies code coverage metrics based on specified rules for the test task.
jacocoTestReport - Generates code coverage report for the test task.
spotbugsDemoServer - Run SpotBugs analysis for the source set 'demoServer'
spotbugsMain - Run SpotBugs analysis for the source set 'main'
spotbugsTest - Run SpotBugs analysis for the source set 'test'
spotbugsTestFixtures - Run SpotBugs analysis for the source set 'testFixtures'
spotbugsWhitebox - Run SpotBugs analysis for the source set 'whitebox'
spotlessApply - Applies code formatting steps to sourcecode in-place.
spotlessCheck - Checks that sourcecode satisfies formatting steps.
spotlessDiagnose
spotlessJava
spotlessJavaApply
spotlessJavaCheck
spotlessJavaDiagnose
spotlessKotlinGradle
spotlessKotlinGradleApply
spotlessKotlinGradleCheck
spotlessKotlinGradleDiagnose
test - Runs the test suite.
whitebox - Runs the whitebox suite.
Rules
-----
Pattern: clean<TaskName>: Cleans the output files of a task.
Pattern: build<ConfigurationName>: Assembles the artifacts of a configuration.
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task <task>
BUILD SUCCESSFUL in 681ms
1 actionable task: 1 executed
Configuration cache entry reused.Vampire
09/05/2024, 4:48 PMCaleb Cushing
09/05/2024, 4:49 PMCaleb Cushing
09/05/2024, 4:49 PMVampire
09/05/2024, 4:49 PMVampire
09/05/2024, 4:49 PMCaleb Cushing
09/05/2024, 4:49 PMVampire
09/05/2024, 4:50 PMVampire
09/05/2024, 4:50 PMVampire
09/05/2024, 4:51 PMCaleb Cushing
09/05/2024, 4:52 PMreporting {
reports {
val testCodeCoverageReport by creating(JacocoCoverageReport::class) {
testType = TestSuiteType.UNIT_TEST
}
}
}
which won't work because not all test types are UNIT_TESTCaleb Cushing
09/05/2024, 4:52 PMCaleb Cushing
09/05/2024, 4:52 PMVampire
09/05/2024, 4:54 PMCaleb Cushing
09/05/2024, 4:54 PMCaleb Cushing
09/05/2024, 4:55 PMVampire
09/05/2024, 4:56 PMCaleb Cushing
09/05/2024, 4:57 PMVampire
09/05/2024, 4:57 PMVampire
09/05/2024, 4:58 PMCaleb Cushing
09/05/2024, 4:58 PMVampire
09/05/2024, 4:59 PMCaleb Cushing
09/05/2024, 5:38 PMCaleb Cushing
09/05/2024, 5:40 PMCaleb Cushing
09/05/2024, 5:42 PMCaleb Cushing
09/05/2024, 5:42 PMCaleb Cushing
09/05/2024, 5:45 PMVampire
09/05/2024, 6:45 PMI then paste some stuff trying to do that,That was exclusively for aggregating within one project and without the aggregation plugin
because I tried the 2nd way that you said was betterSame here, you said you only want to aggregate within one project, not across multiple projects
I don't see where you responded to why this didn't workWell, you also seemed to have superseded yourself with the next messages iirc. And also, I'm not your interactive debugging service or personal AI. I can only guide you but you have to put effort in it yourself or debug problems you might hit, especially as I don't have your project at hand to look myself, besides that I have not time for that.
also, so far there's no explanation for the aggregate thing that I saw other than "I did it before" (paraphrase)Not in this thread, that's correct, because you clearly stated:
yeah, I don't (currently) need/want to do multi-project tasksAnd for that use-case it is not necessary to do it. I did not say I explained it in this thread, I just said I explained it before. To someone else, so you could search for that conversation. But as a quick recap you need to: • define a consumable configuration on all projects like the aggregation plugin does it for each test suite, with ◦ category attribute set to verification, ◦ verification type attribute set to jacoco results and ◦ test suite type attribute set to
"all"
• react to the jvm-test-suite plugin being applied `configureEach`ing all JvmTestSuite suites, adding test test tasks jacoco destination file with type attribute set to binary data type as outgoing artifact to the configuration added above like the aggregation plugin does it for the specific test suite types
• define a JacocoCoverageReport report with test type "all" to the project where you want to have the aggregate task
• add the projects that should be aggregated (or just all if that is what you want) as dependencies to the jacocoAggregation configuration on the project where you want to have the aggregation taskCaleb Cushing
09/06/2024, 3:36 PM