Skip to content

Commit

Permalink
fix: solve a problem where the task fail if the build folder is not p…
Browse files Browse the repository at this point in the history
…reviously created (#473)
  • Loading branch information
nicolasfara authored Jan 31, 2023
1 parent 5faaaf8 commit 8d8a9a3
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ private fun Project.configureNexusRepository(repoToConfigure: Repository, nexusU
val createStagingRepository = rootProject.registerTaskIfNeeded<DefaultTask>(
"createStagingRepositoryOn${repoToConfigure.name}"
) {
val stagingRepoIdsFileName = "staging-repo-ids.properties"
outputs.file(buildDir.resolve(stagingRepoIdsFileName))
dependsOn(nexusClient)
doLast {
rootProject.warnIfCredentialsAreMissing(repoToConfigure)
nexusClient.nexusClient.repoUrl // triggers the initialization of a repository
// Write the staging repository ID to build/staging-repo-ids.properties file
project.buildDir.resolve("staging-repo-ids.properties").appendText(
buildDir.resolve(stagingRepoIdsFileName).appendText(
"${repoToConfigure.name}=${nexusClient.nexusClient.repoId}" + System.lineSeparator()
)
}
Expand Down

0 comments on commit 8d8a9a3

Please sign in to comment.