Publish a version catalog #26

Merged
CommanderTvis merged 2 commits from commandertvis/version-catalog into dev 2021-09-12 11:12:38 +03:00
5 changed files with 184 additions and 26 deletions
Showing only changes of commit dc2ff2efb3 - Show all commits

View File

@ -1,15 +1,15 @@
plugins { plugins {
alias(libs.plugins.changelog)
alias(libs.plugins.dokka)
`java-gradle-plugin` `java-gradle-plugin`
`kotlin-dsl` `kotlin-dsl`
`maven-publish` `maven-publish`
signing signing
alias(libs.plugins.changelog) `version-catalog`
alias(libs.plugins.dokka)
} }
group = "ru.mipt.npm" group = "ru.mipt.npm"
version = "0.10.2" version = libs.versions.tools.get()
description = "Build tools for DataForge and kscience projects" description = "Build tools for DataForge and kscience projects"
changelog.version.set(project.version.toString()) changelog.version.set(project.version.toString())
@ -78,29 +78,41 @@ gradlePlugin {
} }
} }
afterEvaluate {
publishing {
val vcs = "https://github.com/mipt-npm/gradle-tools"
val sourcesJar by tasks.creating(Jar::class) { val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources") archiveClassifier.set("sources")
from(sourceSets.named("main").get().allSource) from(sourceSets.named("main").get().allSource)
} }
val javadocsJar by tasks.creating(Jar::class) { val javadocsJar by tasks.creating(Jar::class) {
group = "documentation" group = JavaBasePlugin.DOCUMENTATION_GROUP
archiveClassifier.set("javadoc") archiveClassifier.set("javadoc")
from(tasks.dokkaHtml) from(tasks.dokkaHtml)
} }
catalog.versionCatalog {
from(files("gradle/libs.versions.toml"))
}
afterEvaluate {
publishing {
val vcs = "https://github.com/mipt-npm/gradle-tools"
// Process each publication we have in this project // Process each publication we have in this project
publications.filterIsInstance<MavenPublication>().forEach { publication -> publications {
publication.apply { create<MavenPublication>("catalog") {
from(components["versionCatalog"])
this.artifactId = "version-catalog"
pom {
name.set("version-catalog")
}
}
withType<MavenPublication> {
artifact(sourcesJar) artifact(sourcesJar)
artifact(javadocsJar) artifact(javadocsJar)
pom { pom {
name.set(project.name)
description.set(project.description) description.set(project.description)
url.set(vcs) url.set(vcs)

View File

@ -4,23 +4,163 @@ binary-compatibility-validator = "0.6.0"
changelog = "1.2.1" changelog = "1.2.1"
dokka = "1.5.0" dokka = "1.5.0"
kotlin = "1.5.21" kotlin = "1.5.21"
kotlin-jupyter = "0.10.0-173" kotlin-jupyter = "0.10.0-184"
kotlinx-benchmark = "0.3.1"
kotlinx-cli = "0.3.2"
kotlinx-collections-immutable = "0.3.4"
kotlinx-coroutines = "1.5.1"
kotlinx-datetime = "0.2.1"
kotlinx-html = "0.7.3"
kotlinx-knit = "0.2.3"
kotlinx-nodejs = "0.0.7"
kotlinx-serialization = "1.2.2"
ktor = "1.6.2"
tools = "0.10.2"
xmlutil = "0.82.0"
yamlkt = "0.10.0"
[libraries] [libraries]
atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" } atomicfu-gradle = { module = "org.jetbrains.kotlinx:atomicfu-gradle-plugin", version.ref = "atomicfu" }
atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "atomicfu" }
binary-compatibility-validator = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version.ref = "binary-compatibility-validator" }
changelog-gradle = { module = "org.jetbrains.intellij.plugins:gradle-changelog-plugin", version.ref = "changelog" } changelog-gradle = { module = "org.jetbrains.intellij.plugins:gradle-changelog-plugin", version.ref = "changelog" }
dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
[libraries.kotlin-jupyter-gradle] kotlin-jupyter-gradle = { module = "org.jetbrains.kotlin:kotlin-jupyter-api-gradle-plugin", version.ref = "kotlin-jupyter" }
module = "org.jetbrains.kotlin:kotlin-jupyter-api-gradle-plugin"
version.ref = "kotlin-jupyter"
[libraries.binary-compatibility-validator] kotlinx-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlinx-benchmark" }
module = "org.jetbrains.kotlinx:binary-compatibility-validator"
version.ref = "binary-compatibility-validator" kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinx-collections-immutable" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-debug = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-debug", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-reactive = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactive", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-reactor = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactor", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-rx2 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx2", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-rx3 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-rx3", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-javafx = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-javafx", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-guava = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-guava", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-slf4j = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "kotlinx-coroutines" }
kotlinx-cli = { module = "org.jetbrains.kotlinx:kotlinx-cli", version.ref = "kotlinx-cli" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
kotlinx-html = { module = "org.jetbrains.kotlinx:kotlinx-html", version.ref = "kotlinx-html" }
kotlinx-knit = { module = "org.jetbrains.kotlinx:kotlinx-knit", version.ref = "kotlinx-knit" }
kotlinx-nodejs = { module = "org.jetbrains.kotlinx:kotlinx-nodejs", version.ref = "kotlinx-nodejs" }
kotlinx-serialization-cbor = { module = "org.jetbrains.kotlinx:kotlinx-serialization-cbor", version.ref = "kotlinx-serialization" }
kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" }
kotlinx-serialization-hocon = { module = "org.jetbrains.kotlinx:kotlinx-serialization-hocon", version.ref = "kotlinx-serialization" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
kotlinx-serialization-protobuf = { module = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf", version.ref = "kotlinx-serialization" }
kotlinx-serialization-properties = { module = "org.jetbrains.kotlinx:kotlinx-serialization-properties", version.ref = "kotlinx-serialization" }
ktor-bom = { module = "io.ktor:ktor-bom", version.ref = "ktor" }
ktor-client-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor" }
ktor-client-apache = { module = "io.ktor:ktor-client-apache", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-auth-basic = { module = "io.ktor:ktor-client-auth-basic", version.ref = "ktor" }
ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" }
ktor-client-encoding = { module = "io.ktor:ktor-client-encoding", version.ref = "ktor" }
ktor-client-json = { module = "io.ktor:ktor-client-json", version.ref = "ktor" }
ktor-client-gson = { module = "io.ktor:ktor-client-gson", version.ref = "ktor" }
ktor-client-jackson = { module = "io.ktor:ktor-client-jackson", version.ref = "ktor" }
ktor-client-serialization = { module = "io.ktor:ktor-client-serialization", version.ref = "ktor" }
ktor-client-logging = { module = "io.ktor:ktor-client-loggin", version.ref = "ktor" }
ktor-client-tracing = { module = "io.ktor:ktor-client-tracing", version.ref = "ktor" }
ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
ktor-client-jetty = { module = "io.ktor:ktor-client-jetty", version.ref = "ktor" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-auth-jwt = { module = "io.ktor:ktor-auth-jwt", version.ref = "ktor" }
ktor-auth-ldap = { module = "io.ktor:ktor-auth-ldap", version.ref = "ktor" }
ktor-auth = { module = "io.ktor:ktor-auth", version.ref = "ktor" }
ktor-freemaker = { module = "io.ktor:ktor-freemaker", version.ref = "ktor" }
ktor-gson = { module = "io.ktor:ktor-gson", version.ref = "ktor" }
ktor-html-builder = { module = "io.ktor:ktor-html-builder", version.ref = "ktor" }
ktor-jackson = { module = "io.ktor:ktor-jackson", version.ref = "ktor" }
ktor-locations = { module = "io.ktor:ktor-locations", version.ref = "ktor" }
ktor-metrics-micrometer = { module = "io.ktor:ktor-metrics-micrometer", version.ref = "ktor" }
ktor-metrics = { module = "io.ktor:ktor-metrics", version.ref = "ktor" }
ktor-mustache = { module = "io.ktor:ktor-mustache", version.ref = "ktor" }
ktor-pebble = { module = "io.ktor:ktor-pebble", version.ref = "ktor" }
ktor-serialization = { module = "io.ktor:ktor-serialization", version.ref = "ktor" }
ktor-server-sessions = { module = "io.ktor:ktor-server-sessions", version.ref = "ktor" }
ktor-thymeleaf = { module = "io.ktor:ktor-thymeleaf", version.ref = "ktor" }
ktor-velocity = { module = "io.ktor:ktor-velocity", version.ref = "ktor" }
ktor-webjars = { module = "io.ktor:ktor-webjars", version.ref = "ktor" }
ktor-websockets = { module = "io.ktor:ktor-websockets", version.ref = "ktor" }
ktor-http = { module = "io.ktor:ktor-http", version.ref = "ktor" }
ktor-http-cio = { module = "io.ktor:ktor-http-cio", version.ref = "ktor" }
ktor-io = { module = "io.ktor:ktor-io", version.ref = "ktor" }
ktor-network = { module = "io.ktor:ktor-network", version.ref = "ktor" }
ktor-network-tls = { module = "io.ktor:ktor-network-tls", version.ref = "ktor" }
ktor-network-tls-certificates = { module = "io.ktor:ktor-network-tls-certificates", version.ref = "ktor" }
ktor-server-cio = { module = "io.ktor:ktor-server-cio", version.ref = "ktor" }
ktor-server-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor" }
ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.ref = "ktor" }
ktor-server-jetty = { module = "io.ktor:ktor-server-jetty", version.ref = "ktor" }
ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" }
ktor-server-servlet = { module = "io.ktor:ktor-server-servlet", version.ref = "ktor" }
ktor-server-test-host = { module = "io.ktor:ktor-server-test-host", version.ref = "ktor" }
ktor-server-tomcat = { module = "io.ktor:ktor-server-tomcat", version.ref = "ktor" }
ktor-test-dispatcher = { module = "io.ktor:ktor-test-dispatcher", version.ref = "ktor" }
ktor-utils = { module = "io.ktor:ktor-utils", version.ref = "ktor" }
xmlutil-core = { module = "io.github.pdvrieze.xmlutil:core", version.ref = "xmlutil" }
xmlutil-ktor = { module = "io.github.pdvrieze.xmlutil:ktor", version.ref = "xmlutil" }
xmlutil-serialization = { module = "io.github.pdvrieze.xmlutil:serialization", version.ref = "xmlutil" }
yamlkt = { module = "net.mamoe.yamlkt:yamlkt", version.ref = "yamlkt" }
[plugins] [plugins]
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
gradle-common = { id = "ru.mipt.npm.gradle.common", version.ref = "tools" }
gradle-project = { id = "ru.mipt.npm.gradle.project", version.ref = "tools" }
gradle-mpp = { id = "ru.mipt.npm.gradle.mpp", version.ref = "tools" }
gradle-jvm = { id = "ru.mipt.npm.gradle.jvm", version.ref = "tools" }
gradle-js = { id = "ru.mipt.npm.gradle.js", version.ref = "tools" }
gradle-native = { id = "ru.mipt.npm.gradle.native", version.ref = "tools" }
gradle-node = { id = "ru.mipt.npm.gradle.node", version.ref = "tools" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-android-extensions = { id = "org.jetbrains.kotlin.android.extensions", version.ref = "kotlin" }
kotlin-js = { id = "org.jetbrains.kotlin.js", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-native-cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
kotlin-plugin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" }
kotlin-plugin-jpa = { id = "org.jetbrains.kotlin.plugin.jpa", version.ref = "kotlin" }
kotlin-plugin-lombok = { id = "org.jetbrains.kotlin.plugin.lombok", version.ref = "kotlin" }
kotlin-plugin-noarg = { id = "org.jetbrains.kotlin.plugin.noarg", version.ref = "kotlin" }
kotlin-plugin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kotlin-plugin-scripting = { id = "org.jetbrains.kotlin.plugin.scripting", version.ref = "kotlin" }
kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-plugin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
kotlin-jupyter-api = { id = "org.jetbrains.kotlin.jupyter.api", version.ref = "kotlin-jupyter" }
kotlinx-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlinx-benchmark" }

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-rc-2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -44,6 +44,7 @@ class KScienceExtension(val project: Project) {
/** /**
* Use coroutines-core with default version or [version] * Use coroutines-core with default version or [version]
*/ */
@Deprecated("Use version catalog.")
fun useCoroutines( fun useCoroutines(
version: String = KScienceVersions.coroutinesVersion, version: String = KScienceVersions.coroutinesVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN, sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
@ -57,6 +58,7 @@ class KScienceExtension(val project: Project) {
/** /**
* Use kotlinx-atmicfu plugin and library * Use kotlinx-atmicfu plugin and library
*/ */
@Deprecated("Use version catalog.")
fun useAtomic( fun useAtomic(
version: String = KScienceVersions.atomicVersion, version: String = KScienceVersions.atomicVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN, sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
@ -73,6 +75,7 @@ class KScienceExtension(val project: Project) {
/** /**
* Use core serialization library and configure targets * Use core serialization library and configure targets
*/ */
@Deprecated("Use version catalog.")
fun useSerialization( fun useSerialization(
version: String = KScienceVersions.serializationVersion, version: String = KScienceVersions.serializationVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN, sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
@ -106,6 +109,7 @@ class KScienceExtension(val project: Project) {
/** /**
* Add dependency on kotlinx-html library * Add dependency on kotlinx-html library
*/ */
@Deprecated("Use version catalog.")
fun useHtml( fun useHtml(
version: String = KScienceVersions.htmlVersion, version: String = KScienceVersions.htmlVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN, sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
@ -119,6 +123,7 @@ class KScienceExtension(val project: Project) {
/** /**
* Use kotlinx-datetime library with default version or [version] * Use kotlinx-datetime library with default version or [version]
*/ */
@Deprecated("Use version catalog.")
fun useDateTime( fun useDateTime(
version: String = KScienceVersions.dateTimeVersion, version: String = KScienceVersions.dateTimeVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN, sourceSet: DependencySourceSet = DependencySourceSet.MAIN,

View File

@ -5,6 +5,7 @@ import org.gradle.api.JavaVersion
/** /**
* Build constants * Build constants
*/ */
@Deprecated("Use version catalog.")
object KScienceVersions { object KScienceVersions {
const val kotlinVersion = "1.5.21" const val kotlinVersion = "1.5.21"
const val kotlinxNodeVersion = "0.0.7" const val kotlinxNodeVersion = "0.0.7"