Skip to content

Commit

Permalink
Migrate to Kotlin 1.3 - serialization-runtime update
Browse files Browse the repository at this point in the history
- This migration is more focused on the coroutines stable APIs requiring Kotlin > 1.3

#78
  • Loading branch information
JoaquimLey committed Nov 19, 2018
1 parent 0b2f3b4 commit 1bcf435
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 15 deletions.
7 changes: 4 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<img alt="Icon" src="art/readme_logo.png?raw=true" align="left" hspace="1" vspace="1">

<a alt='Watch the Stream' href='https://twitch.tv/joaquimley' target='_blank' align='left'><img align='right' height='50' style='border:0px;height:50px;' src='art/follow_me_twitch_badge.png?v=0' border='0' /></a>
<a alt='Watch the Stream' href='https://discordapp.com/invite/yJuJ6mB' target='_blank' align='left'><img align='right' height='50' style='border:0px;height:50px;' src='art/follow_me_twitch_badge.png?v=0' border='0' /></a>

<a alt='Watch the Stream' href='https://twitch.tv/joaquimley' target='_blank' align='left'><img align='right' height='50' style='border:0px;height:50px;' src='art/join_discord.png?v=0' border='0' /></a>

<a alt='Available soon' align='left'><img align='right' height='36' style='border:0px;height:36px;' src='art/googleplay_soon.png?v=0' border='0' /></a>

# Transport ETA

![production version](https://img.shields.io/badge/playstore-unreleased-lightgrey.svg?style=true)
![minSdkVersion 19](https://img.shields.io/badge/minSdkVersion-19-yellow.svg?style=true)
![latest release](https://img.shields.io/badge/playstore-unreleased-lightgrey.svg?style=true)
![compileSdkVersion 28](https://img.shields.io/badge/compileSdkVersion-28-green.svg?style=true)
[![Build Status](https://app.bitrise.io/app/f75916759d698e6e/status.svg?token=nCaNQBZcMNPMckWWwn8Gxg&branch=develop)](https://app.bitrise.io/app/f75916759d698e6e)
[![codecov](https://codecov.io/gh/JoaquimLey/transport-eta/branch/develop/graph/badge.svg)](https://codecov.io/gh/JoaquimLey/transport-eta)
Expand Down
Binary file added art/join_discord.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion transport-eta-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
apply from: './dependencies.gradle'
addRepos(repositories)
dependencies {
classpath deps.kotlin.plugin
classpath deps.kotlin.gradle_plugin
classpath deps.kotlin.serialization_plugin
classpath deps.navigation.safe_args
classpath deps.android_gradle_plugin
Expand Down
4 changes: 2 additions & 2 deletions transport-eta-android/data-sharedpreferences/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlinx-serialization'
apply plugin: 'kotlin-android'
apply plugin: 'kotlinx-serialization'
apply plugin: 'kotlin-android-extensions'

android {
Expand Down Expand Up @@ -97,8 +97,8 @@ dependencies {
implementation deps.rx.android
// Kotlin
implementation deps.kotlin.rx
implementation deps.kotlin.serialization
implementation deps.kotlin.stdlib
implementation deps.kotlin.serialization_runtime

/***********
* Testing *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile


# kotlinx.serialization
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.SerializationKt
-keep,includedescriptorclasses class com.yourcompany.yourpackage.**$$serializer { *; } # <-- change package name to your app's
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import kotlinx.serialization.json.JSON
class SharedPrefTransportMapper {

fun toCacheString(from: SharedPrefTransport): String {
return JSON.stringify(from)
return JSON.stringify(SharedPrefTransport.serializer(), from)
}

fun fromCacheString(from: String): SharedPrefTransport {
return JSON.parse(from)
return JSON.parse(SharedPrefTransport.serializer(), from)
}

fun toSharedPref(from: List<TransportEntity>): List<SharedPrefTransport> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.joaquimley.transporteta.sharedpreferences.model

import com.joaquimley.transporteta.sharedpreferences.FrameworkLocalStorageImpl
import kotlinx.serialization.Serializable

@kotlinx.serialization.Serializable
@Serializable
data class SharedPrefTransport(val id: String, val name: String, val code: Int, val latestEta: String,
val isFavorite: Boolean = false, val type: String, val lastUpdated: String,
val slot: FrameworkLocalStorageImpl.Slot? = null)
10 changes: 5 additions & 5 deletions transport-eta-android/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ ext.deps = [:]
def versions = [:]

// Plugins
versions.kotlin = "1.2.60"
versions.kotlin_serialization = "0.6.1"
versions.kotlin = "1.3.10"
versions.android_gradle_plugin = '3.3.0-alpha03'

// Javax
Expand All @@ -23,6 +22,7 @@ versions.rx_android = "2.0.1"

// Kotlin
versions.kotlin_rx = "2.1.0"
versions.kotlin_serialization_runtime = "0.9.0"

// AndroidX
versions.slice = "1.0.0-alpha2"
Expand Down Expand Up @@ -163,9 +163,9 @@ kotlin.rx = "io.reactivex.rxjava2:rxkotlin:$versions.kotlin_rx"
kotlin.test = "org.jetbrains.kotlin:kotlin-test:$versions.kotlin"
kotlin.stdlib = "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlin"
kotlin.junit = "org.jetbrains.kotlin:kotlin-test-junit:$versions.kotlin"
kotlin.plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
kotlin.serialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$versions.kotlin_serialization"
kotlin.serialization_plugin = "org.jetbrains.kotlinx:kotlinx-gradle-serialization-plugin:$versions.kotlin_serialization"
kotlin.gradle_plugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin"
kotlin.serialization_runtime = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$versions.kotlin_serialization_runtime"
kotlin.serialization_plugin = "org.jetbrains.kotlin:kotlin-serialization:$versions.kotlin"
deps.kotlin = kotlin

def rx = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ abstract class SmsBroadcastReceiver(val serviceNumber: String, protected val ser
fun observeServiceSms(): Observable<String> {
return broadcastServiceSms
}
}
}


0 comments on commit 1bcf435

Please sign in to comment.