From f1d00059d7899006513f4da9a1b95ef2b7e06fdf Mon Sep 17 00:00:00 2001 From: Mario Zorz Date: Mon, 16 Dec 2019 18:02:20 -0300 Subject: [PATCH] added kotlinx-serialization plugin and also bumped Kotlin version to 1.3.61 given the latest serialization needs it form 0.14.0 and on https://github.com/Kotlin/kotlinx.serialization#incompatible-changes --- app/build.gradle | 4 +++- .../main/java/com/automattic/portkey/compose/story/Story.kt | 3 +++ .../com/automattic/portkey/compose/story/StoryFrameItem.kt | 2 ++ build.gradle | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0d7d2897b..d2e29697b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,6 +2,7 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' +apply plugin: 'kotlinx-serialization' apply plugin: 'io.sentry.android.gradle' android { @@ -39,7 +40,8 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.14.0" implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core-ktx:1.1.0' diff --git a/app/src/main/java/com/automattic/portkey/compose/story/Story.kt b/app/src/main/java/com/automattic/portkey/compose/story/Story.kt index 93e5941fb..a01c0c74d 100644 --- a/app/src/main/java/com/automattic/portkey/compose/story/Story.kt +++ b/app/src/main/java/com/automattic/portkey/compose/story/Story.kt @@ -1,3 +1,6 @@ package com.automattic.portkey.compose.story +import kotlinx.serialization.Serializable + +@Serializable data class Story(val frames: ArrayList) diff --git a/app/src/main/java/com/automattic/portkey/compose/story/StoryFrameItem.kt b/app/src/main/java/com/automattic/portkey/compose/story/StoryFrameItem.kt index ae2202d1d..525178c5c 100644 --- a/app/src/main/java/com/automattic/portkey/compose/story/StoryFrameItem.kt +++ b/app/src/main/java/com/automattic/portkey/compose/story/StoryFrameItem.kt @@ -1,5 +1,7 @@ package com.automattic.portkey.compose.story import com.automattic.portkey.compose.story.StoryFrameItemType.IMAGE +import kotlinx.serialization.Serializable +@Serializable data class StoryFrameItem(val filePath: String, val frameItemType: StoryFrameItemType = IMAGE, val name: String? = null) diff --git a/build.gradle b/build.gradle index 75fc812a5..9bca89b05 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.3.61' repositories { google() jcenter() @@ -10,6 +10,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.5.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath 'com.automattic.android:fetchstyle:1.1' classpath 'io.sentry:sentry-android-gradle-plugin:1.7.27' // NOTE: Do not place your application dependencies here; they belong