0.9.0 #11

Merged
altavir merged 18 commits from dev into master 2021-03-07 09:59:51 +03:00
4 changed files with 40 additions and 42 deletions
Showing only changes of commit bef27d1f6a - Show all commits

View File

@ -8,7 +8,7 @@ plugins {
}
group = "ru.mipt.npm"
version = "0.8.3"
version = "0.8.4"
description = "Build tools for DataForge and kscience projects"
@ -22,7 +22,7 @@ repositories {
}
val kotlinVersion = "1.4.30"
val kotlinVersion = "1.4.31"
java {
targetCompatibility = JavaVersion.VERSION_1_8

View File

@ -8,8 +8,6 @@ import org.gradle.kotlin.dsl.*
import org.jetbrains.changelog.ChangelogPlugin
import org.jetbrains.dokka.gradle.DokkaPlugin
import org.jetbrains.dokka.gradle.DokkaTask
import kotlin.collections.component1
import kotlin.collections.component2
@Suppress("unused")
class KSciencePublishingExtension(val project: Project) {
@ -104,20 +102,24 @@ open class KScienceProjectPlugin : Plugin<Project> {
outputs.file(readmeFile)
doLast {
val projects = subprojects.associate {
it.name to it.extensions.findByType<KScienceReadmeExtension>()
}
// val projects = subprojects.associate {
// val normalizedPath = it.path.replaceFirst(":","").replace(":","/")
// it.path.replace(":","/") to it.extensions.findByType<KScienceReadmeExtension>()
// }
if (rootReadmeExtension.readmeTemplate.exists()) {
val modulesString = buildString {
projects.entries.forEach { (name, ext) ->
subprojects.forEach { subproject->
val name = subproject.name
val path = subproject.path.replaceFirst(":","").replace(":","/")
val ext = subproject.extensions.findByType<KScienceReadmeExtension>()
appendln("<hr/>")
appendln("\n* ### [$name]($name)")
appendln("\n* ### [$name]($path)")
if (ext != null) {
appendln("> ${ext.description}")
appendln(">\n> **Maturity**: ${ext.maturity}")
val featureString = ext.featuresString(itemPrefix = "> - ", pathPrefix = "$name/")
val featureString = ext.featuresString(itemPrefix = "> - ", pathPrefix = "$path/")
if (featureString.isNotBlank()) {
appendln(">\n> **Features:**")
appendln(featureString)
@ -145,28 +147,10 @@ open class KScienceProjectPlugin : Plugin<Project> {
val patchChangelog by tasks.getting
afterEvaluate {
val release by tasks.creating {
group = RELEASE_GROUP
description = "Publish development or production release based on version suffix"
dependsOn(generateReadme)
val publicationPlatform = project.findProperty("ci.publication.platform") as? String
val publicationName = if (publicationPlatform == null) {
"AllPublications"
} else {
publicationPlatform.capitalize() + "Publication"
}
tasks.findByName("publish${publicationName}ToSonatypeRepository")?.let {
dependsOn(it)
}
tasks.findByName("publish${publicationName}ToBintrayRepository")?.let {
dependsOn(it)
}
tasks.findByName("publish${publicationName}ToSpaceRepository")?.let {
dependsOn(it)
}
}
val release by tasks.creating {
group = RELEASE_GROUP
description = "Publish development or production release based on version suffix"
dependsOn(generateReadme)
}
}

View File

@ -60,6 +60,8 @@ open class KSciencePublishingPlugin : Plugin<Project> {
//configure publications after everything is set in the root project
project.rootProject.afterEvaluate {
//root project release task
val release by tasks.getting
project.run {
val githubOrg: String = project.findProperty("githubOrg") as? String ?: "mipt-npm"
val githubProject: String? by project
@ -182,12 +184,8 @@ open class KSciencePublishingPlugin : Plugin<Project> {
project.findProperty("signingKey") as? String ?: System.getenv("signingKey")
val signingKeyPassphrase: String? by project
if (sonatypePublish == "true" && sonatypeUser != null && sonatypePassword != null) {
val sonatypeRepo: String = if (isSnapshot()) {
"https://oss.sonatype.org/content/repositories/snapshots"
} else {
"https://oss.sonatype.org/service/local/staging/deploy/maven2"
}
if (sonatypePublish == "true" && sonatypeUser != null && sonatypePassword != null && !isSnapshot()) {
val sonatypeRepo: String = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
if (plugins.findPlugin("signing") == null) {
plugins.apply("signing")
@ -214,6 +212,22 @@ open class KSciencePublishingPlugin : Plugin<Project> {
}
}
}
val publicationPlatform = project.findProperty("publication.platform") as? String
val publicationName = if (publicationPlatform == null) {
"AllPublications"
} else {
publicationPlatform.capitalize() + "Publication"
}
tasks.findByName("publish${publicationName}ToSonatypeRepository")?.let {
release.dependsOn(it)
}
tasks.findByName("publish${publicationName}ToSpaceRepository")?.let {
release.dependsOn(it)
}
}
}
}

View File

@ -6,18 +6,18 @@ import org.gradle.api.JavaVersion
* Build constants
*/
object KScienceVersions {
const val kotlinVersion = "1.4.30"
const val kotlinVersion = "1.4.31"
const val kotlinxNodeVersion = "0.0.7"
const val coroutinesVersion = "1.4.2"
const val coroutinesVersion = "1.4.3"
const val serializationVersion = "1.1.0"
const val atomicVersion = "0.15.1"
const val ktorVersion = "1.5.1"
const val ktorVersion = "1.5.2"
const val htmlVersion = "0.7.2"
val JVM_TARGET = JavaVersion.VERSION_11
object Serialization{
const val xmlVersion = "0.81.0"
const val xmlVersion = "0.81.1"
const val bsonVersion = "0.4.4"
const val yamlKtVersion = "0.9.0"
}