Skip to content

Commit

Permalink
WIP 314 Fix weird Gradle deps and publications
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ascheman committed Nov 25, 2024
1 parent 74d1e07 commit ab5055e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 13 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
}

Expand Down Expand Up @@ -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',
)

/*
Expand Down
2 changes: 1 addition & 1 deletion src/docs/development/publishing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down

0 comments on commit ab5055e

Please sign in to comment.