Skip to content

Commit

Permalink
IJI-1751 Parametrise Maven publication Space URL
Browse files Browse the repository at this point in the history
  • Loading branch information
shchuko committed May 8, 2024
1 parent 54b926f commit e53add8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions buildSrc/src/main/kotlin/Publishing.kt
Expand Up @@ -50,9 +50,10 @@ fun MavenPom.configureMavenCentralMetadata(project: Project) {
*/
private val spacePublicationEnabled = System.getenv("libs.space.pub")?.equals("true") ?: false

fun mavenRepositoryUri(): URI {
fun Project.mavenRepositoryUri(): URI {
if (spacePublicationEnabled) {
return URI("https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven")
val spaceRepoUrl = getSensitiveProperty("libs.space.url")
return URI(spaceRepoUrl ?: "https://maven.pkg.jetbrains.space/public/p/kotlinx-coroutines/maven")
}

val repositoryId: String? = System.getenv("libs.repository.id")
Expand All @@ -65,7 +66,7 @@ fun mavenRepositoryUri(): URI {

fun configureMavenPublication(rh: RepositoryHandler, project: Project) {
rh.maven {
url = mavenRepositoryUri()
url = project.mavenRepositoryUri()
credentials {
if (spacePublicationEnabled) {
// Configure space credentials
Expand Down

0 comments on commit e53add8

Please sign in to comment.