From ea7c3740fe36d2f4bceb3a9e6685940649216c1d Mon Sep 17 00:00:00 2001 From: Serhii Prodan <22973227+serpro69@users.noreply.github.com> Date: Sun, 8 Sep 2024 19:15:09 +0200 Subject: [PATCH] Try to fix tag task dependency, ensure group is set for published artifacts --- build.gradle.kts | 11 +++++++++-- .../main/kotlin/faker-kotlin-conventions.gradle.kts | 3 +-- .../src/main/kotlin/faker-pub-conventions.gradle.kts | 9 +-------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 91bc67806..e19901431 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask +import io.github.serpro69.semverkt.gradle.plugin.tasks.TagTask import utils.configureGradleDaemonJvm plugins { @@ -10,8 +11,6 @@ plugins { group = "io.github.serpro69" subprojects { - group = rootProject.group - apply { plugin("com.github.ben-manes.versions") } @@ -41,6 +40,14 @@ nexusPublishing { } } +// Run :tag only after we've published artifacts to sonatype +tasks.withType().configureEach { + // don't apply when "dryRun" + findProperty("dryRun") ?: run { + dependsOn("closeSonatypeStagingRepository") + } +} + apiValidation { ignoredProjects += listOf("bom", "cli-bot", /*"docs",*/ "test") } diff --git a/buildSrc/src/main/kotlin/faker-kotlin-conventions.gradle.kts b/buildSrc/src/main/kotlin/faker-kotlin-conventions.gradle.kts index 5e4d1e703..cfa85e7df 100644 --- a/buildSrc/src/main/kotlin/faker-kotlin-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/faker-kotlin-conventions.gradle.kts @@ -25,7 +25,6 @@ plugins { id("org.jetbrains.dokka") } -group = rootProject.group.toString() val lib = project.libs dependencies { @@ -55,7 +54,7 @@ tasks.withType { } tasks.withType { - @Suppress("SimpleRedundantLet", "UNNECESSARY_SAFE_CALL") + @Suppress("SimpleRedundantLet") jvmArgs?.let { it.plus("-ea") } useJUnitPlatform() diff --git a/buildSrc/src/main/kotlin/faker-pub-conventions.gradle.kts b/buildSrc/src/main/kotlin/faker-pub-conventions.gradle.kts index 1f680ea3d..faae9cd68 100644 --- a/buildSrc/src/main/kotlin/faker-pub-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/faker-pub-conventions.gradle.kts @@ -7,6 +7,7 @@ import io.github.serpro69.semverkt.gradle.plugin.tasks.TagTask plugins { `maven-publish` signing + id("faker-base-conventions") } publishing { @@ -86,11 +87,3 @@ tasks.withType().configureEach { onlyIf { !isDev.get() && !isSnapshot.get() } onlyIf { isRelease.get() } } - -//// Run :tag only after we've published artifacts to sonatype -//tasks.withType().configureEach { -// // don't apply when "dryRun" -// findProperty("dryRun") ?: run { -// dependsOn(rootProject.tasks.getByName("closeSonatypeStagingRepository")) -// } -//}