From c0010bac6961bffd42de26b575d3d04d11ac0c14 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 13 Apr 2022 15:10:06 +0200 Subject: build(web/api): Update to Quarkus 2.8.1.Final This change updates the web API to use Quarkus 2.8.1.Final. This release fixes an issue we had with local extensions failing to build due to some build directories missing. --- opendc-web/opendc-web-api/build.gradle.kts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'opendc-web/opendc-web-api') diff --git a/opendc-web/opendc-web-api/build.gradle.kts b/opendc-web/opendc-web-api/build.gradle.kts index ca01e0c8..f6ae730d 100644 --- a/opendc-web/opendc-web-api/build.gradle.kts +++ b/opendc-web/opendc-web-api/build.gradle.kts @@ -36,6 +36,7 @@ dependencies { implementation(enforcedPlatform(libs.quarkus.bom)) implementation(projects.opendcWeb.opendcWebProto) + compileOnly(projects.opendcWeb.opendcWebUiQuarkus.deployment) /* Temporary fix for Quarkus/Gradle issues */ implementation(projects.opendcWeb.opendcWebUiQuarkus.runtime) implementation(libs.quarkus.kotlin) @@ -91,18 +92,3 @@ tasks.named("runKtlintCheckOverMainSourceSet") { tasks.named("runKtlintCheckOverTestSourceSet") { mustRunAfter(tasks.quarkusGenerateCodeTests) } - -/* Fix for Quarkus/Gradle issues */ -tasks.quarkusGenerateCode { - mustRunAfter(projects.opendcWeb.opendcWebUiQuarkus.deployment) - mustRunAfter(projects.opendcWeb.opendcWebUi) - - doFirst { - mkdir("${projects.opendcWeb.opendcWebUi.dependencyProject.buildDir}/classes/java/main") - } -} - -tasks.quarkusGenerateCodeTests { - mustRunAfter(projects.opendcWeb.opendcWebUiQuarkus.deployment) - mustRunAfter(projects.opendcWeb.opendcWebUi) -} -- cgit v1.2.3 From 6d7f683a2c1b1823c8cf99e304a1f569eaaff76a Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 21 Apr 2022 17:12:34 +0200 Subject: build: Include Quarkus tests in aggregated JaCoCo test report This change fixes an issue where the results of the Quarkus tests where not included in the aggregated JaCoCo test report, due to it not using the official Gradle JaCoCo plugin. This change defines a new configuration that exposes the execution data generated by Quarkus to the aggregation plugin. --- opendc-web/opendc-web-api/build.gradle.kts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'opendc-web/opendc-web-api') diff --git a/opendc-web/opendc-web-api/build.gradle.kts b/opendc-web/opendc-web-api/build.gradle.kts index f6ae730d..503e0a5b 100644 --- a/opendc-web/opendc-web-api/build.gradle.kts +++ b/opendc-web/opendc-web-api/build.gradle.kts @@ -28,7 +28,6 @@ plugins { kotlin("plugin.allopen") kotlin("plugin.jpa") `testing-conventions` - `jacoco-conventions` id("io.quarkus") } @@ -77,9 +76,26 @@ tasks.quarkusDev { workingDir = rootProject.projectDir.toString() } -tasks.test { - extensions.configure(JacocoTaskExtension::class) { - excludeClassLoaders = listOf("*QuarkusClassLoader") +/* Make sure the jacoco-report-aggregation plugin picks up the Quarkus coverage data */ +configurations.create("coverageDataElementsForQuarkus") { + isVisible = false + isCanBeResolved = false + isCanBeConsumed = true + + extendsFrom(configurations["implementation"], configurations["runtimeOnly"]) + + @Suppress("UnstableApiUsage") + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category::class.java, Category.VERIFICATION)) + attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType::class.java, VerificationType.JACOCO_RESULTS)) + } + + artifacts { + add("coverageDataElementsForQuarkus", layout.buildDirectory.file("jacoco-quarkus.exec")) { + @Suppress("UnstableApiUsage") + type = ArtifactTypeDefinition.BINARY_DATA_TYPE + builtBy(tasks.test) + } } } -- cgit v1.2.3 From f5d631b474567c87bcd41f8567ba66fda2a83050 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 22 Apr 2022 09:56:35 +0200 Subject: build(web/api): Move Quarkus build configuration into buildSrc This change moves most of the Quarkus build configuration into buildSrc so it can possibly be re-used for other modules. --- opendc-web/opendc-web-api/build.gradle.kts | 54 +----------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'opendc-web/opendc-web-api') diff --git a/opendc-web/opendc-web-api/build.gradle.kts b/opendc-web/opendc-web-api/build.gradle.kts index 503e0a5b..5ef6009f 100644 --- a/opendc-web/opendc-web-api/build.gradle.kts +++ b/opendc-web/opendc-web-api/build.gradle.kts @@ -24,11 +24,7 @@ description = "REST API for the OpenDC website" /* Build configuration */ plugins { - `kotlin-conventions` - kotlin("plugin.allopen") - kotlin("plugin.jpa") - `testing-conventions` - id("io.quarkus") + `quarkus-conventions` } dependencies { @@ -60,51 +56,3 @@ dependencies { testImplementation(libs.quarkus.test.security) testImplementation(libs.quarkus.jdbc.h2) } - -allOpen { - annotation("javax.ws.rs.Path") - annotation("javax.enterprise.context.ApplicationScoped") - annotation("io.quarkus.test.junit.QuarkusTest") - annotation("javax.persistence.Entity") -} - -tasks.withType { - kotlinOptions.javaParameters = true -} - -tasks.quarkusDev { - workingDir = rootProject.projectDir.toString() -} - -/* Make sure the jacoco-report-aggregation plugin picks up the Quarkus coverage data */ -configurations.create("coverageDataElementsForQuarkus") { - isVisible = false - isCanBeResolved = false - isCanBeConsumed = true - - extendsFrom(configurations["implementation"], configurations["runtimeOnly"]) - - @Suppress("UnstableApiUsage") - attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category::class.java, Category.VERIFICATION)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType::class.java, VerificationType.JACOCO_RESULTS)) - } - - artifacts { - add("coverageDataElementsForQuarkus", layout.buildDirectory.file("jacoco-quarkus.exec")) { - @Suppress("UnstableApiUsage") - type = ArtifactTypeDefinition.BINARY_DATA_TYPE - builtBy(tasks.test) - } - } -} - -/* Fix for Quarkus/ktlint-gradle incompatibilities */ -tasks.named("runKtlintCheckOverMainSourceSet") { - mustRunAfter(tasks.quarkusGenerateCode) - mustRunAfter(tasks.quarkusGenerateCodeDev) -} - -tasks.named("runKtlintCheckOverTestSourceSet") { - mustRunAfter(tasks.quarkusGenerateCodeTests) -} -- cgit v1.2.3