Fix publication setup. Update changelog plugin

This commit is contained in:
Alexander Nozik 2021-03-08 22:00:06 +03:00
parent 757b609d26
commit 5d58767aa8
3 changed files with 41 additions and 37 deletions

View File

@ -3,12 +3,12 @@ plugins {
`kotlin-dsl`
`maven-publish`
signing
id("org.jetbrains.changelog") version "1.0.0"
id("org.jetbrains.changelog") version "1.1.2"
id("org.jetbrains.dokka") version "1.4.20"
}
group = "ru.mipt.npm"
version = "0.9.1"
version = "0.9.2"
description = "Build tools for DataForge and kscience projects"
@ -34,7 +34,7 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
implementation("org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.15.1")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.20")
implementation("org.jetbrains.intellij.plugins:gradle-changelog-plugin:1.0.0")
implementation("org.jetbrains.intellij.plugins:gradle-changelog-plugin:1.1.2")
implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.4.0")
}

View File

@ -17,10 +17,12 @@ import ru.mipt.npm.gradle.internal.setupPublication
class KSciencePublishingExtension(val project: Project) {
private var initializedFlag = false
fun setup(vcsUrl: String){
fun configurePublications(vcsUrl: String){
if(!initializedFlag) {
project.setupPublication(vcsUrl)
initializedFlag = true
}
}
/**
* github publishing
@ -28,7 +30,7 @@ class KSciencePublishingExtension(val project: Project) {
fun github(githubProject: String, githubOrg: String = "mipt-npm") {
//automatically initialize vcs using github
if(!initializedFlag){
setup("https://github.com/$githubOrg/$githubProject")
configurePublications("https://github.com/$githubOrg/$githubProject")
}
project.addGithubPublishing(githubOrg, githubProject)
}
@ -37,7 +39,7 @@ class KSciencePublishingExtension(val project: Project) {
* Space publishing
*/
fun space(spaceRepo: String = "https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven") {
require(initializedFlag){"The publishing is not set up use 'setup' method to do so"}
require(initializedFlag){"The publishing is not set up use 'configurePublications' method to do so"}
project.addSpacePublishing(spaceRepo)
}
@ -48,10 +50,10 @@ class KSciencePublishingExtension(val project: Project) {
// var bintrayRepo: String? by project.extra
/**
* Sonatype publising
* Sonatype publishing
*/
fun sonatype(){
require(initializedFlag){"The publishing is not set up use 'setup' method to do so"}
require(initializedFlag){"The publishing is not set up use 'configurePublications' method to do so"}
project.addSonatypePublishing()
}
}

View File

@ -59,6 +59,7 @@ internal fun Project.setupPublication(vcs: String) = allprojects {
}
// Process each publication we have in this project
afterEvaluate {
publications.withType<MavenPublication>().forEach { publication ->
publication.artifact(dokkaJar)
publication.pom {
@ -93,6 +94,7 @@ internal fun Project.setupPublication(vcs: String) = allprojects {
}
}
}
}
internal fun Project.isSnapshot() = version.toString().contains("dev") || version.toString().endsWith("SNAPSHOT")