diff --git a/build.gradle.kts b/build.gradle.kts index 0f3313d1998..8e191312b9e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -381,7 +381,7 @@ apply { } apply { - if (extra["isSonatypeRelease"] as? Boolean == true) { + if (extra["isSonatypeRelease"] as? Boolean == true && (extra["deployRepoUrlCustom"] as? String) == null) { logger.info("Applying configuration for sonatype release") from("libraries/prepareSonatypeStaging.gradle") } diff --git a/libraries/commonConfiguration.gradle b/libraries/commonConfiguration.gradle index 9b1811d68a7..9b625788059 100644 --- a/libraries/commonConfiguration.gradle +++ b/libraries/commonConfiguration.gradle @@ -110,17 +110,16 @@ task preparePublication { project.ext.isSonatypePublish = repoProvider == 'sonatype' project.ext.isSonatypeRelease = isSonatypePublish && isRelease - project.ext['signing.keyId'] = project.properties['kotlin.key.name'] - project.ext['signing.password'] = project.properties['kotlin.key.passphrase'] - + project.ext.deployRepoUrlCustom = properties["deployRepoUrl"] ?: properties["deploy-url"] String sonatypeSnapshotsUrl = (isSonatypePublish && !isRelease) ? "https://oss.sonatype.org/content/repositories/snapshots/" : null String repoFolder = properties["deployRepoFolder"] ?: "repo" - ext.repoUrl = properties["deployRepoUrl"] ?: sonatypeSnapshotsUrl ?: properties["deploy-url"] ?: "file://${rootProject.buildDir}/${repoFolder}".toString() + + ext.repoUrl = project.ext.deployRepoUrlCustom ?: sonatypeSnapshotsUrl ?: "file://${rootProject.buildDir}/${repoFolder}" + logger.info("Deployment repository preliminary url: $repoUrl ($repoProvider)") + ext.username = properties["deployRepoUsername"] ?: properties["kotlin.${repoProvider}.user"] ext.password = properties["deployRepoPassword"] ?: properties["kotlin.${repoProvider}.password"] - logger.info("Deployment repository preliminary url: $repoUrl ($repoProvider)") - doLast { println("Deployment repository url: $repoUrl") }