diff --git a/buildSrc/src/main/kotlin/shared.conventions.gradle.kts b/buildSrc/src/main/kotlin/shared.conventions.gradle.kts index 10462885..57f087fa 100644 --- a/buildSrc/src/main/kotlin/shared.conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/shared.conventions.gradle.kts @@ -80,28 +80,32 @@ tasks.withType().configureEach { // enabled = false //} -publishing { - repositories { - maven { - name = "Local" - url = uri("file://" + findProperty("local_maven")) - } - if (hasProperty("mavenUrl")) { +if (hasProperty("publisher")) { + publishing { + repositories { maven { - name = "Maven" - url = findProperty("mavenUrl")?.let { uri(it) }!! - credentials(PasswordCredentials::class) { - username = findProperty("mavenUsername")?.toString() - password = findProperty("mavenPassword")?.toString() + name = "Local" + url = uri("file://" + findProperty("local_maven")) + } + if (hasProperty("mavenUrl")) { + maven { + name = "Maven" + url = findProperty("mavenUrl")?.let { uri(it) }!! + credentials(PasswordCredentials::class) { + username = findProperty("mavenUsername")?.toString() + password = findProperty("mavenPassword")?.toString() + } } } - } - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/dhyces/trimmed") - credentials { - username = (project.findProperty("gpr.user") ?: System.getenv("USERNAME")) as String - password = (project.findProperty("gpr.key") ?: System.getenv("TOKEN")) as String + if (hasProperty("trimmedGithubPackages")) { + maven { + name = "GitHubPackages" + url = uri(findProperty("trimmedGithubPackages")?.let { uri(it) }!!) + credentials { + username = (project.findProperty("gpr.user") ?: System.getenv("USERNAME")) as String + password = (project.findProperty("gpr.key") ?: System.getenv("TOKEN")) as String + } + } } } }