Force usage of passed deploy url for sonatype publication (KTI-552)

This commit is contained in:
Nikolay Krasko
2021-04-28 20:44:36 +03:00
parent 2eda82f178
commit 624740a80a
2 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -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")
}
+5 -6
View File
@@ -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")
}