diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 4ad61a8c3..a7c88377b 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -8,7 +8,7 @@ plugins { } dependencies { - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0-rc") implementation("org.jetbrains.dokka:dokka-gradle-plugin:0.10.1") implementation("com.android.tools.build:gradle:4.0.1") } diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 9e2899dcd..f469d673e 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -1,7 +1,7 @@ object Versions { - const val kotlin = "1.3.72" - const val serialization = "0.20.0" - const val atomicfu = "0.14.2" + const val kotlin = "1.4.0-rc" + const val serialization = "1.0-M1-1.4.0-rc" + const val atomicfu = "0.14.3-1.4.0-rc" const val androidxTest = "1.2.0" const val googleTruth = "1.0.1" const val kotlinpoet = "1.6.0" @@ -10,14 +10,12 @@ object Versions { object Libs { object Serialization { - const val common = "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:${Versions.serialization}" - const val jvm = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:${Versions.serialization}" - const val native = "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:${Versions.serialization}" + const val runtime = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:${Versions.serialization}" } object AtomicFU { const val gradlePlugin = "org.jetbrains.kotlinx:atomicfu-gradle-plugin:${Versions.atomicfu}" - const val native = "org.jetbrains.kotlinx:atomicfu-native:${Versions.atomicfu}" + const val runtime = "org.jetbrains.kotlinx:atomicfu:${Versions.atomicfu}" } object AndroidxTest { diff --git a/buildSrc/src/main/kotlin/multiplatform-library.gradle.kts b/buildSrc/src/main/kotlin/multiplatform-library.gradle.kts index 8a88c62e4..c172b4bc8 100644 --- a/buildSrc/src/main/kotlin/multiplatform-library.gradle.kts +++ b/buildSrc/src/main/kotlin/multiplatform-library.gradle.kts @@ -45,12 +45,6 @@ kotlin { } } } - - // Workaround for https://youtrack.jetbrains.com/issue/KT-36721 - targets.withType().configureEach { - val moduleName = "${project.group}.${project.name}" - compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-module-name", moduleName) - } } val emptySourcesJar by tasks.registering(Jar::class) { diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 60c4f4e8a..a20b4fd78 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -14,10 +14,6 @@ kotlin { sourceSets { val commonMain by getting { kotlin.srcDirs("src/commonMain/generated") - - dependencies { - implementation(kotlin("stdlib-common")) - } } val commonTest by getting { @@ -27,12 +23,6 @@ kotlin { } } - val jvmMain by getting { - dependencies { - implementation(kotlin("stdlib-jdk8")) - } - } - val jvmTest by getting { dependencies { implementation(kotlin("test")) @@ -43,7 +33,7 @@ kotlin { val darwinMain by getting { dependencies { - implementation(Libs.AtomicFU.native) + implementation(Libs.AtomicFU.runtime) } } } diff --git a/core/src/darwinMain/kotlin/io/islandtime/zone/TimeZoneRules.kt b/core/src/darwinMain/kotlin/io/islandtime/zone/TimeZoneRules.kt index 684036454..d53ee8318 100644 --- a/core/src/darwinMain/kotlin/io/islandtime/zone/TimeZoneRules.kt +++ b/core/src/darwinMain/kotlin/io/islandtime/zone/TimeZoneRules.kt @@ -124,7 +124,7 @@ private class DarwinTimeZoneRules(timeZone: NSTimeZone) : TimeZoneRules { val offsetAfter = offsetAt(nextTransition) val dateTimeBefore = nextTransition.toIslandDateTimeAt(offsetBefore) - this += DarwinTimeZoneOffsetTransition(dateTimeBefore, offsetBefore, offsetAfter) + add(DarwinTimeZoneOffsetTransition(dateTimeBefore, offsetBefore, offsetAfter)) currentDate = nextTransition nextTransition = timeZone.nextDaylightSavingTimeTransitionAfterDate(currentDate) diff --git a/extensions/parcelize/build.gradle.kts b/extensions/parcelize/build.gradle.kts index 2b1eb1b15..adb587c45 100644 --- a/extensions/parcelize/build.gradle.kts +++ b/extensions/parcelize/build.gradle.kts @@ -27,7 +27,6 @@ dependencies { coreLibraryDesugaring(Libs.androidDesugarJdkLibs) implementation(project(":core")) - implementation(kotlin("stdlib-jdk8")) androidTestImplementation(Libs.AndroidxTest.runner) androidTestImplementation(Libs.googleTruth) diff --git a/extensions/serialization/build.gradle.kts b/extensions/serialization/build.gradle.kts index 6c822cf15..4f50dd4ae 100644 --- a/extensions/serialization/build.gradle.kts +++ b/extensions/serialization/build.gradle.kts @@ -8,8 +8,7 @@ kotlin { val commonMain by getting { dependencies { implementation(project(":core")) - implementation(kotlin("stdlib-common")) - implementation(Libs.Serialization.common) + implementation(Libs.Serialization.runtime) } } @@ -20,24 +19,11 @@ kotlin { } } - val jvmMain by getting { - dependencies { - implementation(kotlin("stdlib-jdk8")) - implementation(Libs.Serialization.jvm) - } - } - val jvmTest by getting { dependencies { implementation(kotlin("test")) implementation(kotlin("test-junit")) } } - - val darwinMain by getting { - dependencies { - implementation(Libs.Serialization.native) - } - } } } \ No newline at end of file diff --git a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Date.kt b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Date.kt index 0b554f5bf..e976bf4b4 100644 --- a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Date.kt +++ b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Date.kt @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization import io.islandtime.Date import io.islandtime.toDate -import kotlinx.serialization.* +import kotlinx.serialization.KSerializer +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder object DateSerializer : KSerializer { override val descriptor: SerialDescriptor = - PrimitiveDescriptor("io.islandtime.DateSerializer", PrimitiveKind.STRING) + PrimitiveSerialDescriptor("io.islandtime.DateSerializer", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, value: Date) { encoder.encodeString(value.toString()) diff --git a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/DateTime.kt b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/DateTime.kt index 7e4a93cc5..ffc732505 100644 --- a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/DateTime.kt +++ b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/DateTime.kt @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization import io.islandtime.DateTime import io.islandtime.toDateTime -import kotlinx.serialization.* +import kotlinx.serialization.KSerializer +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder object DateTimeSerializer : KSerializer { override val descriptor: SerialDescriptor = - PrimitiveDescriptor("io.islandtime.DateTimeSerializer", PrimitiveKind.STRING) + PrimitiveSerialDescriptor("io.islandtime.DateTimeSerializer", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, value: DateTime) { encoder.encodeString(value.toString()) diff --git a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Instant.kt b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Instant.kt index 490343bc2..28cbb9192 100644 --- a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Instant.kt +++ b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Instant.kt @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization import io.islandtime.Instant import io.islandtime.toInstant -import kotlinx.serialization.* +import kotlinx.serialization.KSerializer +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder object InstantSerializer : KSerializer { override val descriptor: SerialDescriptor = - PrimitiveDescriptor("io.islandtime.InstantSerializer", PrimitiveKind.STRING) + PrimitiveSerialDescriptor("io.islandtime.InstantSerializer", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, value: Instant) { encoder.encodeString(value.toString()) diff --git a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetDateTime.kt b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetDateTime.kt index 66ed35560..858b17b13 100644 --- a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetDateTime.kt +++ b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetDateTime.kt @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization import io.islandtime.OffsetDateTime import io.islandtime.toOffsetDateTime -import kotlinx.serialization.* +import kotlinx.serialization.KSerializer +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder object OffsetDateTimeSerializer : KSerializer { override val descriptor: SerialDescriptor = - PrimitiveDescriptor("io.islandtime.OffsetDateTimeSerializer", PrimitiveKind.STRING) + PrimitiveSerialDescriptor("io.islandtime.OffsetDateTimeSerializer", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, value: OffsetDateTime) { encoder.encodeString(value.toString()) diff --git a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetTime.kt b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetTime.kt index a98bff1bd..0053b2445 100644 --- a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetTime.kt +++ b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/OffsetTime.kt @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization import io.islandtime.OffsetTime import io.islandtime.toOffsetTime -import kotlinx.serialization.* +import kotlinx.serialization.KSerializer +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder object OffsetTimeSerializer : KSerializer { override val descriptor: SerialDescriptor = - PrimitiveDescriptor("io.islandtime.OffsetTimeSerializer", PrimitiveKind.STRING) + PrimitiveSerialDescriptor("io.islandtime.OffsetTimeSerializer", PrimitiveKind.STRING) override fun serialize(encoder: Encoder, value: OffsetTime) { encoder.encodeString(value.toString()) diff --git a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Time.kt b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Time.kt index 8b312f9ab..54a1a6dd9 100644 --- a/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Time.kt +++ b/extensions/serialization/src/commonMain/kotlin/io/islandtime/extensions/serialization/Time.kt @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization import io.islandtime.Time import io.islandtime.toTime -import kotlinx.serialization.* +import kotlinx.serialization.KSerializer +import kotlinx.serialization.descriptors.PrimitiveKind +import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.encoding.Decoder +import kotlinx.serialization.encoding.Encoder object TimeSerializer : KSerializer