Remove JVM ir

This commit is contained in:
Alexander Nozik 2020-08-31 12:40:13 +03:00
parent 6464d9d926
commit 02cd531800
8 changed files with 38 additions and 16 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Added
- Migrate to kotlin 1.4.0
- Separate Native (current platform) and nodeJs plugins
## [0.5.2] ## [0.5.2]
### Added ### Added

View File

@ -4,7 +4,7 @@ plugins {
`kotlin-dsl` `kotlin-dsl`
`maven-publish` `maven-publish`
id("com.jfrog.bintray") version "1.8.5" id("com.jfrog.bintray") version "1.8.5"
id("org.jetbrains.changelog") version "0.3.2" id("org.jetbrains.changelog") version "0.4.0"
} }
group = "ru.mipt.npm" group = "ru.mipt.npm"

View File

@ -32,8 +32,13 @@ class KScienceExtension(val project: Project) {
block: SerializationTargets.() -> Unit = {} block: SerializationTargets.() -> Unit = {}
): Unit = project.run { ): Unit = project.run {
plugins.apply("org.jetbrains.kotlin.plugin.serialization") plugins.apply("org.jetbrains.kotlin.plugin.serialization")
val artifactName = if(version.startsWith("0")){
"kotlinx-serialization-runtime"
} else {
"kotlinx-serialization-core"
}
useCommonDependency( useCommonDependency(
"org.jetbrains.kotlinx:kotlinx-serialization-core:$version", "org.jetbrains.kotlinx:$artifactName:$version",
dependencySourceSet = sourceSet, dependencySourceSet = sourceSet,
dependencyConfiguration = configuration dependencyConfiguration = configuration
) )

View File

@ -26,7 +26,7 @@ open class KScienceJVMPlugin : Plugin<Project> {
tasks.withType<KotlinCompile> { tasks.withType<KotlinCompile> {
kotlinOptions { kotlinOptions {
useIR = true // useIR = true
jvmTarget = KScienceVersions.JVM_TARGET.toString() jvmTarget = KScienceVersions.JVM_TARGET.toString()
} }
} }

View File

@ -22,7 +22,7 @@ open class KScienceMPPlugin : Plugin<Project> {
jvm { jvm {
compilations.all { compilations.all {
kotlinOptions { kotlinOptions {
useIR = true // useIR = true
jvmTarget = KScienceVersions.JVM_TARGET.toString() jvmTarget = KScienceVersions.JVM_TARGET.toString()
} }
} }
@ -62,9 +62,11 @@ open class KScienceMPPlugin : Plugin<Project> {
} }
} }
targets.all { afterEvaluate {
sourceSets.all { targets.all {
languageSettings.applySettings() sourceSets.all {
languageSettings.applySettings()
}
} }
} }
@ -73,6 +75,18 @@ open class KScienceMPPlugin : Plugin<Project> {
val dokkaHtml by tasks.getting(DokkaTask::class) { val dokkaHtml by tasks.getting(DokkaTask::class) {
dokkaSourceSets { dokkaSourceSets {
register("commonMain") {
displayName = "common"
platform = "common"
}
register("jvmMain") {
displayName = "jvm"
platform = "jvm"
}
register("jsMain") {
displayName = "js"
platform = "js"
}
configureEach { configureEach {
jdkVersion = 11 jdkVersion = 11
} }

View File

@ -3,9 +3,7 @@ package ru.mipt.npm.gradle
import org.gradle.api.GradleException import org.gradle.api.GradleException
import org.gradle.api.Plugin import org.gradle.api.Plugin
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply import org.gradle.kotlin.dsl.*
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.findPlugin
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
class KScienceNativePlugin : Plugin<Project> { class KScienceNativePlugin : Plugin<Project> {
@ -23,11 +21,11 @@ class KScienceNativePlugin : Plugin<Project> {
isMingwX64 -> mingwX64("native") isMingwX64 -> mingwX64("native")
else -> throw GradleException("Host OS is not supported in Kotlin/Native.") else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
} }
//
// sourceSets { sourceSets.invoke {
// val nativeMain by getting val nativeMain by getting
// val nativeTest by getting val nativeTest by getting
// } }
} }
} }
} }

View File

@ -13,7 +13,7 @@ object KScienceVersions {
val JVM_TARGET = JavaVersion.VERSION_11 val JVM_TARGET = JavaVersion.VERSION_11
object Serialization{ object Serialization{
const val xmlVersion = "0.20.0.1" const val xmlVersion = "0.20.0.10"//to be fixed
const val yamlVersion = "0.16.1" const val yamlVersion = "0.16.1"
const val bsonVersion = "0.2.1" const val bsonVersion = "0.2.1"
} }

View File

@ -16,6 +16,7 @@ internal fun LanguageSettingsBuilder.applySettings(): Unit {
useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes") useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
useExperimentalAnnotation("kotlin.ExperimentalStdlibApi") useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")
useExperimentalAnnotation("kotlin.time.ExperimentalTime") useExperimentalAnnotation("kotlin.time.ExperimentalTime")
useExperimentalAnnotation("kotlin.contracts.ExperimentalContracts")
} }
internal fun RepositoryHandler.applyRepos(): Unit { internal fun RepositoryHandler.applyRepos(): Unit {