From bd557c7f932e0cde4b278d100c5b5bcea1be2832 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 27 Apr 2023 04:08:56 -0700 Subject: [PATCH] Fix publishing tasks failing due to Gradle implicit dependency. Summary: Publishing failed due to a Gradle implicit dependency which is described here: https://youtrack.jetbrains.com/issue/KT-46466/ I'm applying one of the workaround, while we wait for a fix in Kotlin stable. Reviewed By: zielinskimz Differential Revision: D45336291 fbshipit-source-id: 7a0ae3653a24e29f21e52d88bb6578ca8efe7281 --- build-logic/src/main/kotlin/publish.gradle.kts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-logic/src/main/kotlin/publish.gradle.kts b/build-logic/src/main/kotlin/publish.gradle.kts index 6314b95..2068d56 100644 --- a/build-logic/src/main/kotlin/publish.gradle.kts +++ b/build-logic/src/main/kotlin/publish.gradle.kts @@ -73,5 +73,12 @@ signing { isRequired = !(signingKey.isNullOrBlank() || signingPwd.isNullOrBlank()) } +// Fix for https://youtrack.jetbrains.com/issue/KT-46466/ +// On Gradle 8+, the signing task is not correclty wired to the publishing tasks. +// This requires a fix on KGP that is currently pending. +val signingTasks = tasks.withType() + +tasks.withType().configureEach { dependsOn(signingTasks) } + val String.byProperty: String? get() = providers.gradleProperty(this).orNull