From ba4e037f64d051e6c998b138cf13b8c3c6c79c17 Mon Sep 17 00:00:00 2001 From: Loes Immens Date: Mon, 23 Sep 2024 11:02:59 +0200 Subject: [PATCH] FDP-2607: add jacoco Signed-off-by: Loes Immens --- application/build.gradle.kts | 3 +++ build.gradle.kts | 18 ++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/application/build.gradle.kts b/application/build.gradle.kts index a479be1..94ce5ef 100644 --- a/application/build.gradle.kts +++ b/application/build.gradle.kts @@ -16,6 +16,9 @@ dependencies { implementation("org.springframework:spring-aspects") runtimeOnly("io.micrometer:micrometer-registry-prometheus") + + // Generate test and integration test reports + jacocoAggregation(project(":application")) } tasks.withType { diff --git a/build.gradle.kts b/build.gradle.kts index f73ab59..736206b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 import io.spring.gradle.dependencymanagement.internal.dsl.StandardDependencyManagementExtension -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension plugins { id("org.springframework.boot") version "3.3.4" apply false @@ -32,6 +32,8 @@ subprojects { apply(plugin = "io.spring.dependency-management") apply(plugin = "org.jetbrains.kotlin.plugin.jpa") apply(plugin = "eclipse") + apply(plugin = "jacoco") + apply(plugin = "jacoco-report-aggregation") group = "org.gxf.template" version = rootProject.version @@ -48,22 +50,18 @@ subprojects { } } - extensions.configure { - toolchain { - languageVersion.set(JavaLanguageVersion.of(21)) - } - } - extensions.configure { imports { mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES) } } - tasks.withType { - kotlinOptions { + extensions.configure { + jvmToolchain { + languageVersion = JavaLanguageVersion.of(21) + } + compilerOptions { freeCompilerArgs = listOf("-Xjsr305=strict") - jvmTarget = "21" } }