Skip to content
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
14 changes: 7 additions & 7 deletions auth/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 stanwood GmbH
* Copyright (c) 2019 stanwood GmbH, 2020 whisp Internet GmbH
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,11 +24,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"

Expand All @@ -53,16 +53,16 @@ dependencies {
api project(":core")

implementation 'com.android.support:support-annotations:28.0.0'
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13'

compileOnly 'com.squareup.retrofit2:retrofit:2.5.0'
compileOnly 'com.squareup.retrofit2:retrofit:2.9.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

def retrofit_version = '2.5.0'
def retrofit_version = '2.9.0'
testImplementation "com.squareup.retrofit2:retrofit:$retrofit_version"
testImplementation "com.squareup.retrofit2:converter-gson:$retrofit_version"

testImplementation 'com.google.code.gson:gson:2.8.5'
testImplementation 'com.google.code.gson:gson:2.8.6'

testImplementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ open class Authenticator(
private val tokenReaderWriter: TokenReaderWriter,
private val onAuthenticationFailedListener: OnAuthenticationFailedListener?
) : okhttp3.Authenticator {
override fun authenticate(route: Route?, response: Response): Request? = response.request().let { request ->
override fun authenticate(route: Route?, response: Response): Request? = response.request.let { request ->
tokenReaderWriter.read(request)?.let { oldToken ->
synchronized(authenticationProvider.lock) {
if (request.header(AuthHeaderKeys.RETRY_WITH_REFRESH_HEADER_KEY) != null) {
Expand Down Expand Up @@ -98,7 +98,7 @@ open class Authenticator(
all tokens
*/
response.newBuilder().request(
response.request().newBuilder()
response.request.newBuilder()
.header(AuthHeaderKeys.RETRY_WITH_REFRESH_HEADER_KEY, "true")
.build()
).build()
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 stanwood GmbH
* Copyright (c) 2018 stanwood GmbH, 2020 whisp Internet GmbH
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -23,8 +23,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.31'
ext.okhttp_version = '3.13.1'
ext.kotlin_version = '1.4.0'
ext.okhttp_version = '4.8.1'
repositories {
google()
jcenter()
Expand All @@ -33,9 +33,9 @@ buildscript {
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0-rc03'
classpath 'com.android.tools.build:gradle:4.2.0-alpha07'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:7.3.0"
classpath "org.jlleitschuh.gradle:ktlint-gradle:9.3.0"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
6 changes: 3 additions & 3 deletions cache/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 stanwood GmbH
* Copyright (c) 2019 stanwood GmbH, 2020 whisp Internet GmbH
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,11 +24,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"

Expand Down
12 changes: 6 additions & 6 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 stanwood GmbH
* Copyright (c) 2019 stanwood GmbH, 2020 whisp Internet GmbH
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -24,11 +24,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"

Expand All @@ -52,12 +52,12 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'com.android.support:support-annotations:28.0.0'
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13'

api "com.squareup.okhttp3:okhttp:$okhttp_version"
compileOnly 'com.squareup.retrofit2:retrofit:2.5.0'
compileOnly 'com.squareup.retrofit2:retrofit:2.9.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.11.0"
api 'org.jetbrains.kotlinx:kotlinx-serialization-core:1.0.0-RC'
api 'com.nytimes.android:store3:3.1.1'
api 'com.nytimes.android:filesystem3:3.1.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.3' // same version as defined within store
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@
package io.stanwood.framework.network.core.store

import com.nytimes.android.external.store3.base.Parser
import kotlinx.io.Reader
import kotlinx.serialization.KSerializer
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
import okio.BufferedSource
import java.io.Reader

object SerializationParserFactory {
private val stable = Json(JsonConfiguration.Stable)
private val stable = Json {
allowStructuredMapKeys = true
}
fun <T> createReaderParser(
deserializer: KSerializer<T>,
json: Json = stable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ package io.stanwood.framework.network.core.store

import com.nytimes.android.external.store3.base.Parser
import com.nytimes.android.external.store3.util.ParserException
import kotlinx.io.Reader
import kotlinx.serialization.KSerializer
import kotlinx.serialization.json.Json
import java.io.Reader

class SerializationReaderParser<Parsed>(
private val deserializer: KSerializer<Parsed>,
val json: Json
private val json: Json
) : Parser<Reader, Parsed> {
@Throws(ParserException::class)
override fun apply(reader: Reader): Parsed =
json.parse(deserializer, reader.use { it.readText() })
json.decodeFromString(deserializer, reader.use { it.readText() })
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import kotlinx.serialization.json.Json
import okio.BufferedSource

class SerializationSourceParser<Parsed>(
private val deserializer: KSerializer<Parsed>,
val json: Json
private val deserializer: KSerializer<Parsed>,
private val json: Json
) : Parser<BufferedSource, Parsed> {
@Throws(ParserException::class)
override fun apply(bufferedSource: BufferedSource): Parsed =
json.parse(deserializer, bufferedSource.use { it.readUtf8() })
json.decodeFromString(deserializer, bufferedSource.use { it.readUtf8() })
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ class SerializationStringParser<Parsed>(
) : Parser<String, Parsed> {
@Throws(ParserException::class)
override fun apply(string: String): Parsed =
json.parse(deserializer, string)
json.decodeFromString(deserializer, string)
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 27
compileSdkVersion 29



defaultConfig {
applicationId "com.github.ubuntudroid.sample"
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -59,7 +59,7 @@ dependencies {

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Expand Down