Fix publication setup. Update changelog plugin

This commit is contained in:
Alexander Nozik 2021-03-24 13:28:09 +03:00
parent 6eda59f413
commit a15399b9f9
5 changed files with 32 additions and 30 deletions

View File

@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- `publication.platform` changed to `publishing.platform` - `publication.platform` changed to `publishing.platform`
- Dokka version to `1.4.30`
- `useDateTime` in extension
### Deprecated ### Deprecated

View File

@ -8,7 +8,7 @@ plugins {
} }
group = "ru.mipt.npm" group = "ru.mipt.npm"
version = "0.9.2" version = "0.9.3"
description = "Build tools for DataForge and kscience projects" description = "Build tools for DataForge and kscience projects"
@ -17,11 +17,10 @@ repositories {
jcenter() jcenter()
maven("https://repo.kotlin.link") maven("https://repo.kotlin.link")
maven("https://kotlin.bintray.com/kotlinx") maven("https://kotlin.bintray.com/kotlinx")
maven("https://dl.bintray.com/kotlin/kotlin-eap")
maven("https://dl.bintray.com/kotlin/kotlin-dev") maven("https://dl.bintray.com/kotlin/kotlin-dev")
} }
val kotlinVersion = "1.4.31" val kotlinVersion = "1.4.32"
java { java {
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
@ -51,12 +50,6 @@ project.extensions.findByType<GradlePluginDevelopmentExtension>()?.apply {
implementationClass = "ru.mipt.npm.gradle.KScienceProjectPlugin" implementationClass = "ru.mipt.npm.gradle.KScienceProjectPlugin"
} }
create("publishing") {
id = "ru.mipt.npm.gradle.publish"
description = "The publication plugin for bintray and github"
implementationClass = "ru.mipt.npm.gradle.KSciencePublishingPlugin"
}
create("mpp") { create("mpp") {
id = "ru.mipt.npm.gradle.mpp" id = "ru.mipt.npm.gradle.mpp"
description = "Pre-configured multiplatform project" description = "Pre-configured multiplatform project"

View File

@ -42,6 +42,9 @@ enum class DependencySourceSet(val setName: String, val suffix: String) {
class KScienceExtension(val project: Project) { class KScienceExtension(val project: Project) {
/**
* Use coroutines-core with default version or [version]
*/
fun useCoroutines( fun useCoroutines(
version: String = KScienceVersions.coroutinesVersion, version: String = KScienceVersions.coroutinesVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN, sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
@ -52,13 +55,25 @@ class KScienceExtension(val project: Project) {
dependencyConfiguration = configuration dependencyConfiguration = configuration
) )
fun useAtomic(version: String = KScienceVersions.atomicVersion): Unit = project.run { /**
* Use kotlinx-atmicfu plugin and library
*/
fun useAtomic(
version: String = KScienceVersions.atomicVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
configuration: DependencyConfiguration = DependencyConfiguration.IMPLEMENTATION
): Unit = project.run {
plugins.apply("kotlinx-atomicfu") plugins.apply("kotlinx-atomicfu")
useCommonDependency( useCommonDependency(
"org.jetbrains.kotlinx:atomicfu:$version" "org.jetbrains.kotlinx:atomicfu:$version",
dependencySourceSet = sourceSet,
dependencyConfiguration = configuration
) )
} }
/**
* Use core serialization library and configure targets
*/
fun useSerialization( fun useSerialization(
version: String = KScienceVersions.serializationVersion, version: String = KScienceVersions.serializationVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN, sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
@ -79,26 +94,20 @@ class KScienceExtension(val project: Project) {
SerializationTargets(sourceSet, configuration).apply(block) SerializationTargets(sourceSet, configuration).apply(block)
} }
fun useAtomic(
version: String = KScienceVersions.atomicVersion,
sourceSet: DependencySourceSet = DependencySourceSet.MAIN,
configuration: DependencyConfiguration = DependencyConfiguration.IMPLEMENTATION
): Unit = project.run {
plugins.apply("kotlinx-atomicfu")
useCommonDependency(
"org.jetbrains.kotlinx:atomicfu-common:$version",
dependencySourceSet = sourceSet,
dependencyConfiguration = configuration
)
}
fun useFx( fun useFx(
vararg modules: FXModule, vararg modules: FXModule,
configuration: DependencyConfiguration = DependencyConfiguration.COMPILE_ONLY, configuration: DependencyConfiguration = DependencyConfiguration.COMPILE_ONLY,
version: String = "14", version: String = "11",
platform: FXPlatform = defaultPlatform platform: FXPlatform = defaultPlatform
) = project.useFx(modules.toList(), configuration, version, platform) ) = project.useFx(modules.toList(), configuration, version, platform)
/**
* Use kotlinx-datetime library with default version or [version]
*/
fun useDateTime(version: String = KScienceVersions.dateTimeVersion){
project.useCommonDependency("org.jetbrains.kotlinx:kotlinx-datetime:$version")
}
/** /**
* Mark this module as an application module. JVM application should be enabled separately * Mark this module as an application module. JVM application should be enabled separately
*/ */

View File

@ -6,13 +6,14 @@ import org.gradle.api.JavaVersion
* Build constants * Build constants
*/ */
object KScienceVersions { object KScienceVersions {
const val kotlinVersion = "1.4.31" const val kotlinVersion = "1.4.32"
const val kotlinxNodeVersion = "0.0.7" const val kotlinxNodeVersion = "0.0.7"
const val coroutinesVersion = "1.4.3" const val coroutinesVersion = "1.4.3"
const val serializationVersion = "1.1.0" const val serializationVersion = "1.1.0"
const val atomicVersion = "0.15.1" const val atomicVersion = "0.15.1"
const val ktorVersion = "1.5.2" const val ktorVersion = "1.5.2"
const val htmlVersion = "0.7.2" const val htmlVersion = "0.7.2"
const val dateTimeVersion = "0.1.1"
val JVM_TARGET = JavaVersion.VERSION_11 val JVM_TARGET = JavaVersion.VERSION_11

View File

@ -22,10 +22,7 @@ internal fun LanguageSettingsBuilder.applySettings(): Unit {
internal fun RepositoryHandler.applyRepos(): Unit { internal fun RepositoryHandler.applyRepos(): Unit {
mavenCentral() mavenCentral()
maven("https://repo.kotlin.link") maven("https://repo.kotlin.link")
maven("https://dl.bintray.com/kotlin/kotlin-eap") maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-js-wrappers")
maven("https://dl.bintray.com/kotlin/kotlin-dev")
maven("https://kotlin.bintray.com/kotlinx")
maven("https://kotlin.bintray.com/kotlin-js-wrappers/")
} }
internal fun Copy.fromJsDependencies(configurationName: String) = project.afterEvaluate { internal fun Copy.fromJsDependencies(configurationName: String) = project.afterEvaluate {