From fd046394a452e66f94d1ef76f01c236e32edc1e0 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 7 Mar 2021 09:16:21 +0300 Subject: [PATCH] Add system properties to avoid publishing --- src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt b/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt index 9e3c310..983ef1f 100644 --- a/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt +++ b/src/main/kotlin/ru/mipt/npm/gradle/internal/publishing.kt @@ -110,6 +110,8 @@ internal fun Project.addGithubPublishing( githubOrg: String, githubProject: String ) { + if (requestPropertyOrNull("publishing.github") == "false") return + val githubUser: String = requestProperty("publishing.github.user") val githubToken: String = requestProperty("publishing.github.token") @@ -135,6 +137,8 @@ internal fun Project.addGithubPublishing( } internal fun Project.addSpacePublishing(spaceRepo: String) { + if (requestPropertyOrNull("publishing.space") == "false") return + val spaceUser: String = requestProperty("publishing.space.user") val spaceToken: String = requestProperty("publishing.space.token") @@ -161,11 +165,12 @@ internal fun Project.addSpacePublishing(spaceRepo: String) { } internal fun Project.addSonatypePublishing() { + if (requestPropertyOrNull("publishing.sonatype") == "false") return + val sonatypeUser: String = requestProperty("publishing.sonatype.user") val sonatypePassword: String = requestProperty("publishing.sonatype.password") val signingId: String? = requestPropertyOrNull("publishing.signing.id") - allprojects { plugins.withId("maven-publish") { configure {