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,9 +17,11 @@ import ru.mipt.npm.gradle.internal.setupPublication
class KSciencePublishingExtension(val project: Project) {
private var initializedFlag = false
fun setup(vcsUrl: String){
project.setupPublication(vcsUrl)
initializedFlag = true
fun configurePublications(vcsUrl: String){
if(!initializedFlag) {
project.setupPublication(vcsUrl)
initializedFlag = true
}
}
/**
@ -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,35 +59,37 @@ internal fun Project.setupPublication(vcs: String) = allprojects {
}
// Process each publication we have in this project
publications.withType<MavenPublication>().forEach { publication ->
publication.artifact(dokkaJar)
publication.pom {
name.set(project.name)
description.set(project.description ?: project.name)
url.set(vcs)
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("MIPT-NPM")
name.set("MIPT nuclear physics methods laboratory")
organization.set("MIPT")
organizationUrl.set("http://npm.mipt.ru")
}
}
scm {
afterEvaluate {
publications.withType<MavenPublication>().forEach { publication ->
publication.artifact(dokkaJar)
publication.pom {
name.set(project.name)
description.set(project.description ?: project.name)
url.set(vcs)
tag.set(project.version.toString())
//developerConnection = "scm:git:[fetch=]/*ВАША ССЫЛКА НА .git файл*/[push=]/*Повторить предыдущую ссылку*/"
}
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("MIPT-NPM")
name.set("MIPT nuclear physics methods laboratory")
organization.set("MIPT")
organizationUrl.set("http://npm.mipt.ru")
}
}
scm {
url.set(vcs)
tag.set(project.version.toString())
//developerConnection = "scm:git:[fetch=]/*ВАША ССЫЛКА НА .git файл*/[push=]/*Повторить предыдущую ссылку*/"
}
}
}
}
}