Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Kotlin 1.4 #92

Merged
merged 25 commits into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
100bc5d
Build with Kotlin 1.4-M2
erikc5000 Jun 30, 2020
83dd027
Merge remote-tracking branch 'origin/master' into kotlin-1.4
erikc5000 Jun 30, 2020
34817f7
Remove workarounds that should no longer be needed
erikc5000 Jun 30, 2020
0264432
Update to Kotlin 1.4-M3
erikc5000 Jul 11, 2020
b5fab2e
Merge remote-tracking branch 'origin/master' into kotlin-1.4
erikc5000 Jul 11, 2020
bdf3c42
Revert removal of IDEA hack
erikc5000 Jul 12, 2020
7be64ea
Enable MPP compatibility mode
erikc5000 Jul 12, 2020
f74a9ca
Merge remote-tracking branch 'origin/master' into kotlin-1.4
erikc5000 Jul 12, 2020
64358f8
Merge remote-tracking branch 'origin/master' into kotlin-1.4
erikc5000 Jul 12, 2020
e2e3a80
Merge remote-tracking branch 'origin/master' into kotlin-1.4
erikc5000 Jul 12, 2020
3eaf4c8
Prepare for 0.2.3-1.4-M3 release
erikc5000 Jul 12, 2020
61e4271
Restore AtomicFU runtime dependency
erikc5000 Jul 12, 2020
9f0d42a
Merge remote-tracking branch 'remotes/origin/master' into kotlin-1.4
erikc5000 Jul 26, 2020
0eb5914
Merge remote-tracking branch 'remotes/origin/master' into kotlin-1.4
erikc5000 Jul 26, 2020
68bf43d
Work around Kotlin 1.4 compiler error
erikc5000 Jul 26, 2020
095afd2
Merge remote-tracking branch 'remotes/origin/master' into kotlin-1.4
erikc5000 Jul 26, 2020
d832923
Prepare for 0.2.4-1.4-M3 release
erikc5000 Jul 26, 2020
20fb13b
Merge branch 'master' into kotlin-1.4
erikc5000 Jul 26, 2020
0d9b540
Prepare for next release
erikc5000 Jul 26, 2020
a524d36
Merge remote-tracking branch 'remotes/origin/master' into kotlin-1.4
erikc5000 Jul 26, 2020
92fa0d5
Bump Kotlin to 1.4.0-rc
erikc5000 Jul 27, 2020
3f081e9
Prepare for 0.2.4-1.4-rc release
erikc5000 Jul 27, 2020
a8a9bc7
Prepare for next release
erikc5000 Jul 27, 2020
0126ef1
Merge remote-tracking branch 'remotes/origin/master' into kotlin-1.4
erikc5000 Aug 5, 2020
e4f2e65
Remove "-1.4-rc" from SNAPSHOT version
erikc5000 Aug 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
12 changes: 5 additions & 7 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 {
Expand Down
6 changes: 0 additions & 6 deletions buildSrc/src/main/kotlin/multiplatform-library.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ kotlin {
}
}
}

// Workaround for https://youtrack.jetbrains.com/issue/KT-36721
targets.withType<KotlinNativeTarget>().configureEach {
val moduleName = "${project.group}.${project.name}"
compilations["main"].kotlinOptions.freeCompilerArgs += listOf("-module-name", moduleName)
}
}

val emptySourcesJar by tasks.registering(Jar::class) {
Expand Down
12 changes: 1 addition & 11 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ kotlin {
sourceSets {
val commonMain by getting {
kotlin.srcDirs("src/commonMain/generated")

dependencies {
implementation(kotlin("stdlib-common"))
}
}

val commonTest by getting {
Expand All @@ -27,12 +23,6 @@ kotlin {
}
}

val jvmMain by getting {
dependencies {
implementation(kotlin("stdlib-jdk8"))
}
}

val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
Expand All @@ -43,7 +33,7 @@ kotlin {

val darwinMain by getting {
dependencies {
implementation(Libs.AtomicFU.native)
implementation(Libs.AtomicFU.runtime)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion extensions/parcelize/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies {
coreLibraryDesugaring(Libs.androidDesugarJdkLibs)

implementation(project(":core"))
implementation(kotlin("stdlib-jdk8"))

androidTestImplementation(Libs.AndroidxTest.runner)
androidTestImplementation(Libs.googleTruth)
Expand Down
16 changes: 1 addition & 15 deletions extensions/serialization/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Date> {
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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<DateTime> {
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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Instant> {
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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<OffsetDateTime> {
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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<OffsetTime> {
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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Time> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.TimeSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.TimeSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: Time) {
encoder.encodeString(value.toString())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package io.islandtime.extensions.serialization

import io.islandtime.TimeZone
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 TimeZoneSerializer : KSerializer<TimeZone> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.TimeZoneSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.TimeZoneSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: TimeZone) {
encoder.encodeString(value.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization

import io.islandtime.YearMonth
import io.islandtime.toYearMonth
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 YearMonthSerializer : KSerializer<YearMonth> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.YearMonthSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.YearMonthSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: YearMonth) {
encoder.encodeString(value.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization

import io.islandtime.ZonedDateTime
import io.islandtime.toZonedDateTime
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 ZonedDateTimeSerializer : KSerializer<ZonedDateTime> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.ZonedDateTimeSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.ZonedDateTimeSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: ZonedDateTime) {
encoder.encodeString(value.toString())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package io.islandtime.extensions.serialization.measures

import io.islandtime.measures.*
import kotlinx.serialization.*
import io.islandtime.measures.Duration
import io.islandtime.measures.toDuration
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 DurationSerializer : KSerializer<Duration> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.measures.DurationSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.measures.DurationSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: Duration) {
encoder.encodeString(value.toString())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package io.islandtime.extensions.serialization.measures

import io.islandtime.measures.*
import kotlinx.serialization.*
import io.islandtime.measures.Period
import io.islandtime.measures.toPeriod
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 PeriodSerializer : KSerializer<Period> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.measures.PeriodSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.measures.PeriodSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: Period) {
encoder.encodeString(value.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization.ranges

import io.islandtime.ranges.DateRange
import io.islandtime.ranges.toDateRange
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 DateRangeSerializer : KSerializer<DateRange> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.ranges.DateRangeSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.ranges.DateRangeSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: DateRange) {
encoder.encodeString(value.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ package io.islandtime.extensions.serialization.ranges

import io.islandtime.ranges.DateTimeInterval
import io.islandtime.ranges.toDateTimeInterval
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 DateTimeIntervalSerializer : KSerializer<DateTimeInterval> {
override val descriptor: SerialDescriptor =
PrimitiveDescriptor("io.islandtime.ranges.DateTimeIntervalSerializer", PrimitiveKind.STRING)
PrimitiveSerialDescriptor("io.islandtime.ranges.DateTimeIntervalSerializer", PrimitiveKind.STRING)

override fun serialize(encoder: Encoder, value: DateTimeInterval) {
encoder.encodeString(value.toString())
Expand Down
Loading