diff --git a/build-logic/src/main/kotlin/io/openfeedback/extensions/ProjectExt.kt b/build-logic/src/main/kotlin/io/openfeedback/extensions/ProjectExt.kt index 7b61f24..6cf71a1 100644 --- a/build-logic/src/main/kotlin/io/openfeedback/extensions/ProjectExt.kt +++ b/build-logic/src/main/kotlin/io/openfeedback/extensions/ProjectExt.kt @@ -83,13 +83,16 @@ private val nexusStagingClient by lazy { ) } -fun Project.getOrCreateOssStagingUrl(): Provider { +fun Project.getOrCreateRepoId(): Provider { return getOrCreateRepoIdTask().map { - val repoId = it.outputs.files.singleFile.readText() - "${baseUrl}staging/deployByRepositoryId/$repoId/" + it.outputs.files.singleFile.readText() } } +fun Project.getOrCreateRepoUrl(): Provider { + return getOrCreateRepoId().map { "${baseUrl}staging/deployByRepositoryId/$it/" } +} + @OptIn(ExperimentalTime::class) fun Task.closeAndReleaseStagingRepository(repoId: String) { runBlocking { @@ -108,7 +111,7 @@ private fun Project.registerReleaseTask(name: String): TaskProvider { val task = try { rootProject.tasks.named(name) } catch (e: UnknownDomainObjectException) { - val repoId = getOrCreateOssStagingUrl() + val repoId = getOrCreateRepoId() rootProject.tasks.register(name) { inputs.property( "repoId", diff --git a/build-logic/src/main/kotlin/io/openfeedback/extensions/RepositoryHandlerExt.kt b/build-logic/src/main/kotlin/io/openfeedback/extensions/RepositoryHandlerExt.kt index 0e8311f..61353cf 100644 --- a/build-logic/src/main/kotlin/io/openfeedback/extensions/RepositoryHandlerExt.kt +++ b/build-logic/src/main/kotlin/io/openfeedback/extensions/RepositoryHandlerExt.kt @@ -16,7 +16,7 @@ fun RepositoryHandler.mavenSonatypeSnapshot(project: Project) = maven { fun RepositoryHandler.mavenSonatypeStaging(project: Project) = maven { name = "ossStaging" setUrl { - project.uri(project.getOrCreateOssStagingUrl()) + project.uri(project.getOrCreateRepoUrl()) } credentials { username = System.getenv(EnvVarKeys.Nexus.username)