Publishing flag

This commit is contained in:
Alexander Nozik 2021-03-07 15:18:37 +03:00
parent 4b90233286
commit 757b609d26
3 changed files with 19 additions and 6 deletions

View File

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
### Changed ### Changed
- `publication.platform` changed to `publishing.platform`
### Deprecated ### Deprecated

View File

@ -8,7 +8,7 @@ plugins {
} }
group = "ru.mipt.npm" group = "ru.mipt.npm"
version = "0.9.0" version = "0.9.1"
description = "Build tools for DataForge and kscience projects" description = "Build tools for DataForge and kscience projects"

View File

@ -98,7 +98,7 @@ internal fun Project.isSnapshot() = version.toString().contains("dev") || versio
internal val Project.publicationTarget: String internal val Project.publicationTarget: String
get() { get() {
val publicationPlatform = project.findProperty("publication.platform") as? String val publicationPlatform = project.findProperty("publishing.platform") as? String
return if (publicationPlatform == null) { return if (publicationPlatform == null) {
"AllPublications" "AllPublications"
} else { } else {
@ -110,8 +110,12 @@ internal fun Project.addGithubPublishing(
githubOrg: String, githubOrg: String,
githubProject: String githubProject: String
) { ) {
if (requestPropertyOrNull("publishing.enabled") != "true") {
logger.info("Skipping github publishing because publishing is disabled")
return
}
if (requestPropertyOrNull("publishing.github") == "false") { if (requestPropertyOrNull("publishing.github") == "false") {
logger.info("Skipping github publishing based on flag value") logger.info("Skipping github publishing because `publishing.github == false`")
return return
} }
@ -140,8 +144,12 @@ internal fun Project.addGithubPublishing(
} }
internal fun Project.addSpacePublishing(spaceRepo: String) { internal fun Project.addSpacePublishing(spaceRepo: String) {
if (requestPropertyOrNull("publishing.enabled") != "true") {
logger.info("Skipping github publishing because publishing is disabled")
return
}
if (requestPropertyOrNull("publishing.space") == "false") { if (requestPropertyOrNull("publishing.space") == "false") {
logger.info("Skipping space publishing based on flag value") logger.info("Skipping space publishing because `publishing.space == false`")
return return
} }
@ -171,12 +179,16 @@ internal fun Project.addSpacePublishing(spaceRepo: String) {
} }
internal fun Project.addSonatypePublishing() { internal fun Project.addSonatypePublishing() {
if(requestPropertyOrNull("publishing.enabled")!="true"){
logger.info("Skipping github publishing because publishing is disabled")
return
}
if (isSnapshot()) { if (isSnapshot()) {
logger.info("Sonatype publishing skipped for dev version") logger.info("Sonatype publishing skipped for dev version")
return return
} }
if (requestPropertyOrNull("publishing.sonatype") == "false") { if (requestPropertyOrNull("publishing.sonatype") == "false") {
logger.info("Skipping sonatype publishing based on flag value") logger.info("Skipping sonatype publishing because `publishing.sonatype == false`")
return return
} }