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

Prepare 1.5.1 release #2297

Merged
merged 2 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@

1.5.1 / 2023-05-11
==================
This release contains an important Native targets overhaul, as well as numerous enhancements and bugfixes.
Kotlin 1.8.21 is used by default.

### New set of Native targets

The official [Kotlin target support policy](https://kotlinlang.org/docs/native-target-support.html) has recently been published
describing new target policy: each target belongs to a certain _tier_, and different tiers have different stability guarantees.
The official recommendation for library authors is to support targets up to Tier 3,
and kotlinx.serialization now follows it.
It means that in this release, there are a lot of new targets added from this tier,
such as `androidNativeX86` or `watchosDeviceArm64`.
Note that since they belong to Tier 3, they're not auto-tested on CI.

kotlinx.serialization also ships some deprecated Kotlin/Native targets that do not belong to any tier (e.g. `iosArm32`, `mingwX86`).
We'll continue to release them, but we do not provide support for them, nor do we plan to add new targets from the deprecated list.

### Improvements in Json elements

There are two new function sets that should make creating raw Json elements easier.
[First one](https://github.com/Kotlin/kotlinx.serialization/pull/2160) contains overloads for `JsonPrimitive` constructor-like function
that accept unsigned types: `JsonPrimitive(1u)`.
[Second one](https://github.com/Kotlin/kotlinx.serialization/pull/2156) adds new `addAll` functions to `JsonArrayBuilder` to be used with collections
of numbers, booleans or strings: `buildJsonArray { addAll(listOf(1, 2, 3)) }`
Both were contributed to us by [aSemy](https://github.com/aSemy).

### Other enhancements

* **Potential source-breaking change**: Rename json-okio `target` variables to `sink` (#2226)
* Function to retrieve KSerializer by KClass and type arguments serializers (#2291)
* Added FormatLanguage annotation to Json methods (#2234)
* Properties Format: Support sealed/polymorphic classes as class properties (#2255)

### Bugfixes

* KeyValueSerializer: Fix missing call to endStructure() (#2272)
* ObjectSerializer: Respect sequential decoding (#2273)
* Fix value class encoding in various corner cases (#2242)
* Fix incorrect json decoding iterator's .hasNext() behavior on array-wrapped inputs (#2268)
* Fix memory leak caused by invalid KTypeWrapper's equals method (#2274)
* Fixed NoSuchMethodError when parsing a JSON stream on Java 8 (#2219)
* Fix MissingFieldException duplication (#2213)


1.5.0 / 2023-02-27
==================

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[![JetBrains official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![TeamCity build](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/KotlinTools_KotlinxSerialization_Ko.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=KotlinTools_KotlinxSerialization_Ko&guest=1)
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.10-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-serialization-core/1.5.0)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-serialization-core/1.5.0)
[![Kotlin](https://img.shields.io/badge/kotlin-1.8.21-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlinx/kotlinx-serialization-core/1.5.1)](https://central.sonatype.com/artifact/org.jetbrains.kotlinx/kotlinx-serialization-core/1.5.1)
[![KDoc link](https://img.shields.io/badge/API_reference-KDoc-blue)](https://kotlinlang.org/api/kotlinx.serialization/)
[![Slack channel](https://img.shields.io/badge/chat-slack-blue.svg?logo=slack)](https://kotlinlang.slack.com/messages/serialization/)

Expand Down Expand Up @@ -92,17 +92,17 @@ Kotlin DSL:

```kotlin
plugins {
kotlin("jvm") version "1.8.10" // or kotlin("multiplatform") or any other kotlin plugin
kotlin("plugin.serialization") version "1.8.10"
kotlin("jvm") version "1.8.21" // or kotlin("multiplatform") or any other kotlin plugin
kotlin("plugin.serialization") version "1.8.21"
}
```

Groovy DSL:

```gradle
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.8.10'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.10'
id 'org.jetbrains.kotlin.multiplatform' version '1.8.21'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.21'
}
```

Expand All @@ -119,7 +119,7 @@ buildscript {
repositories { mavenCentral() }

dependencies {
val kotlinVersion = "1.8.10"
val kotlinVersion = "1.8.21"
classpath(kotlin("gradle-plugin", version = kotlinVersion))
classpath(kotlin("serialization", version = kotlinVersion))
}
Expand All @@ -130,7 +130,7 @@ Groovy DSL:

```gradle
buildscript {
ext.kotlin_version = '1.8.10'
ext.kotlin_version = '1.8.21'
repositories { mavenCentral() }
dependencies {
Expand Down Expand Up @@ -159,7 +159,7 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
}
```

Expand All @@ -171,7 +171,7 @@ repositories {
}
dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
}
```

Expand Down Expand Up @@ -261,8 +261,8 @@ Ensure the proper version of Kotlin and serialization version:

```xml
<properties>
<kotlin.version>1.8.10</kotlin.version>
<serialization.version>1.5.0</serialization.version>
<kotlin.version>1.8.21</kotlin.version>
<serialization.version>1.5.1</serialization.version>
</properties>
```

Expand Down
12 changes: 4 additions & 8 deletions core/commonTest/src/kotlinx/serialization/EnumDescriptorsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ class EnumDescriptorsTest {
}

private fun assertFullyAnnotated(descriptor: SerialDescriptor) {
// plugin changes are expected, delete and uncomment when this condition will fail
assertEquals(0, descriptor.annotations.size)
// assertEquals(1, descriptor.annotations.size)
// assertEquals("On Class", (descriptor.annotations.first() as SerialAnnotation).text)
assertEquals(1, descriptor.annotations.size)
assertEquals("On Class", (descriptor.annotations.first() as SerialAnnotation).text)

assertEquals(1, descriptor.getElementAnnotations(0).size)
assertEquals("On A", (descriptor.getElementAnnotations(0).first() as SerialAnnotation).text)
Expand All @@ -96,10 +94,8 @@ class EnumDescriptorsTest {
}

private fun assertClassAnnotated(descriptor: SerialDescriptor) {
// plugin changes are expected, delete and uncomment when this condition will fail
assertEquals(0, descriptor.annotations.size)
// assertEquals(1, descriptor.annotations.size)
// assertEquals("On Class", (descriptor.annotations.first() as SerialAnnotation).text)
assertEquals(1, descriptor.annotations.size)
assertEquals("On Class", (descriptor.annotations.first() as SerialAnnotation).text)
}

}
2 changes: 1 addition & 1 deletion formats/cbor/api/kotlinx-serialization-cbor.api
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
public abstract interface annotation class kotlinx/serialization/cbor/ByteString : java/lang/annotation/Annotation {
}

public final class kotlinx/serialization/cbor/ByteString$Impl : kotlinx/serialization/cbor/ByteString {
public synthetic class kotlinx/serialization/cbor/ByteString$Impl : kotlinx/serialization/cbor/ByteString {
public fun <init> ()V
}

Expand Down
4 changes: 2 additions & 2 deletions formats/json/api/kotlinx-serialization-json.api
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public abstract interface annotation class kotlinx/serialization/json/JsonClassD
public abstract fun discriminator ()Ljava/lang/String;
}

public final class kotlinx/serialization/json/JsonClassDiscriminator$Impl : kotlinx/serialization/json/JsonClassDiscriminator {
public synthetic class kotlinx/serialization/json/JsonClassDiscriminator$Impl : kotlinx/serialization/json/JsonClassDiscriminator {
public fun <init> (Ljava/lang/String;)V
public final synthetic fun discriminator ()Ljava/lang/String;
}
Expand Down Expand Up @@ -248,7 +248,7 @@ public abstract interface annotation class kotlinx/serialization/json/JsonNames
public abstract fun names ()[Ljava/lang/String;
}

public final class kotlinx/serialization/json/JsonNames$Impl : kotlinx/serialization/json/JsonNames {
public synthetic class kotlinx/serialization/json/JsonNames$Impl : kotlinx/serialization/json/JsonNames {
public fun <init> ([Ljava/lang/String;)V
public final synthetic fun names ()[Ljava/lang/String;
}
Expand Down
6 changes: 3 additions & 3 deletions formats/protobuf/api/kotlinx-serialization-protobuf.api
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ public abstract interface annotation class kotlinx/serialization/protobuf/ProtoN
public abstract fun number ()I
}

public final class kotlinx/serialization/protobuf/ProtoNumber$Impl : kotlinx/serialization/protobuf/ProtoNumber {
public synthetic class kotlinx/serialization/protobuf/ProtoNumber$Impl : kotlinx/serialization/protobuf/ProtoNumber {
public fun <init> (I)V
public final synthetic fun number ()I
}

public abstract interface annotation class kotlinx/serialization/protobuf/ProtoPacked : java/lang/annotation/Annotation {
}

public final class kotlinx/serialization/protobuf/ProtoPacked$Impl : kotlinx/serialization/protobuf/ProtoPacked {
public synthetic class kotlinx/serialization/protobuf/ProtoPacked$Impl : kotlinx/serialization/protobuf/ProtoPacked {
public fun <init> ()V
}

public abstract interface annotation class kotlinx/serialization/protobuf/ProtoType : java/lang/annotation/Annotation {
public abstract fun type ()Lkotlinx/serialization/protobuf/ProtoIntegerType;
}

public final class kotlinx/serialization/protobuf/ProtoType$Impl : kotlinx/serialization/protobuf/ProtoType {
public synthetic class kotlinx/serialization/protobuf/ProtoType$Impl : kotlinx/serialization/protobuf/ProtoType {
public fun <init> (Lkotlinx/serialization/protobuf/ProtoIntegerType;)V
public final synthetic fun type ()Lkotlinx/serialization/protobuf/ProtoIntegerType;
}
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#

group=org.jetbrains.kotlinx
version=1.5.1-SNAPSHOT
version=1.5.2-SNAPSHOT

kotlin.version=1.8.10
kotlin.version=1.8.21

# This version takes precedence if 'bootstrap' property passed to project
kotlin.version.snapshot=1.9.255-SNAPSHOT
Expand Down
4 changes: 2 additions & 2 deletions integration-test/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
#

mainKotlinVersion=1.8.10
mainLibVersion=1.5.1-SNAPSHOT
mainKotlinVersion=1.8.21
mainLibVersion=1.5.2-SNAPSHOT

kotlin.code.style=official
kotlin.js.compiler=ir
Expand Down
2 changes: 1 addition & 1 deletion integration-test/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading