From 4314e2988ce135a80e9ab1198e0ce2661cbecfe5 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Mon, 25 Nov 2024 08:33:47 +0100 Subject: [PATCH] WIP 314 Fix weird Gradle deps and publications It seems the respective publishing tasks are not completely executed though they have internal dependencies to each other. Additionally, when executed together with "clean", parts of the publications are missing, in particular the Gradle plugin marker POM. --- .github/workflows/build-artifacts.yml | 2 +- build.gradle | 20 +++++++++++++------- src/docs/development/publishing.adoc | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index a97e41d5..4580c92a 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -49,7 +49,7 @@ jobs: uses: gradle/actions/wrapper-validation@v4 - name: Execute Gradle build - run: ./gradlew clean check integrationTest --scan --stacktrace + run: ./gradlew clean && ./gradlew check integrationTest --scan --stacktrace - name: Cache SonarCloud packages uses: actions/cache@v4 diff --git a/build.gradle b/build.gradle index 906f91a8..8058f57b 100644 --- a/build.gradle +++ b/build.gradle @@ -300,12 +300,13 @@ sonar { tasks.register("publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository") { group("Publishing") - description("Publishes all publications to the local Maven repository") + description("Publishes all publications to the local Maven integration (test) repository") - dependsOn(":htmlSanityCheck-core:publishMavenJavaPublicationToMyLocalRepositoryForFullIntegrationTestsRepository", - ":htmlSanityCheck-gradle-plugin:publishPluginMavenPublicationToMyLocalRepositoryForFullIntegrationTestsRepository", + dependsOn(":htmlSanityCheck-core:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository", + ":htmlSanityCheck-gradle-plugin:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository", + // For some reason it is necessary to add this task explicitly though it should be part of the above "publishAllPubli..." task ":htmlSanityCheck-gradle-plugin:publishHtmlSanityCheckPluginMarkerMavenPublicationToMyLocalRepositoryForFullIntegrationTestsRepository", - ":htmlSanityCheck-maven-plugin:publishPluginMavenPublicationToMyLocalRepositoryForFullIntegrationTestsRepository", + ":htmlSanityCheck-maven-plugin:publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository", ) } @@ -347,12 +348,17 @@ clean.dependsOn(cleanIntegrationTest) tasks.register("integrationTest") { group("Verification") description("Run overall integration tests (and publish/install first)") + dependsOn( + ':publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository', + ':htmlSanityCheck-cli:installDist', + 'integrationTestOnly', + ) + mustRunAfter(':clean') } -integrationTest.dependsOn( - 'publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository', +integrationTestOnly.mustRunAfter( + ':publishAllPublicationsToMyLocalRepositoryForFullIntegrationTestsRepository', ':htmlSanityCheck-cli:installDist', - 'integrationTestOnly', ) /* diff --git a/src/docs/development/publishing.adoc b/src/docs/development/publishing.adoc index 28dc7044..8cdd1d1c 100644 --- a/src/docs/development/publishing.adoc +++ b/src/docs/development/publishing.adoc @@ -166,7 +166,7 @@ Clean, check (test), and perform integration tests: [source,shell] ---- -./gradlew clean check integrationTest +./gradlew clean && ./gradlew check integrationTest ---- [[sec:stage-to-maven-central]]