Skip to content

Commit 4525c4a

Browse files
committed
kotlin, nexus staging, dokka, ktor version bumps (fixes js serialization issue)
Signed-off-by: Adam Ratzman <[email protected]>
1 parent 01c49d5 commit 4525c4a

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

build.gradle.kts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackOutput.Target
44
plugins {
55
`maven-publish`
66
signing
7-
id("io.codearte.nexus-staging") version "0.21.2"
8-
kotlin("multiplatform") version "1.4.0"
9-
kotlin("plugin.serialization") version "1.4.0"
7+
id("io.codearte.nexus-staging") version "0.22.0"
8+
kotlin("multiplatform") version "1.4.21"
9+
kotlin("plugin.serialization") version "1.4.10"
1010
id("com.diffplug.gradle.spotless") version "4.4.0"
1111
id("com.moowork.node") version "1.3.1"
12-
id("org.jetbrains.dokka") version "0.10.1"
12+
id("org.jetbrains.dokka") version "1.4.20"
1313
id("com.android.library")
1414
id("kotlin-android-extensions")
1515
}
@@ -26,7 +26,7 @@ buildscript {
2626
}
2727
dependencies {
2828
classpath("com.android.tools.build:gradle:3.5.4")
29-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10")
29+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
3030
}
3131
}
3232

@@ -132,16 +132,16 @@ kotlin {
132132

133133
targets {
134134
sourceSets {
135-
val coroutineVersion = "1.3.9"
136-
val serializationVersion = "1.0.0"
137-
val spekVersion = "2.0.11"
138-
val ktorVersion = "1.4.0"
135+
val coroutineVersion = "1.4.2"
136+
val serializationVersion = "1.0.1"
137+
val spekVersion = "2.0.15"
138+
val ktorVersion = "1.4.1"
139139

140140
val commonMain by getting {
141141
dependencies {
142-
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
143-
api("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
144-
api("io.ktor:ktor-client-core:$ktorVersion")
142+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion")
143+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
144+
implementation("io.ktor:ktor-client-core:$ktorVersion")
145145
}
146146
}
147147
val commonTest by getting {
@@ -159,7 +159,7 @@ kotlin {
159159
}
160160

161161
dependencies {
162-
api("io.ktor:ktor-client-cio:$ktorVersion")
162+
implementation("io.ktor:ktor-client-cio:$ktorVersion")
163163
}
164164
}
165165

@@ -168,7 +168,7 @@ kotlin {
168168
implementation(kotlin("test"))
169169
implementation(kotlin("test-junit"))
170170
implementation("org.junit.jupiter:junit-jupiter:5.6.2")
171-
implementation("com.sparkjava:spark-core:2.9.1")
171+
implementation("com.sparkjava:spark-core:2.9.3")
172172
implementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion")
173173
runtimeOnly("org.spekframework.spek2:spek-runner-junit5:$spekVersion")
174174
runtimeOnly(kotlin("reflect"))
@@ -177,10 +177,10 @@ kotlin {
177177

178178
val jsMain by getting {
179179
dependencies {
180-
api(npm("text-encoding", "0.7.0"))
181-
api("io.ktor:ktor-client-js:$ktorVersion")
182-
api(npm("abort-controller", "3.0.0"))
183-
api(npm("node-fetch", "2.6.0"))
180+
implementation(npm("text-encoding", "0.7.0"))
181+
implementation("io.ktor:ktor-client-js:$ktorVersion")
182+
implementation(npm("abort-controller", "3.0.0"))
183+
implementation(npm("node-fetch", "2.6.0"))
184184
}
185185
}
186186

@@ -198,9 +198,9 @@ kotlin {
198198
}
199199

200200
dependencies {
201-
api("net.sourceforge.streamsupport:android-retrofuture:1.7.2")
202-
api("io.ktor:ktor-client-okhttp:$ktorVersion")
203-
api("io.coil-kt:coil:0.11.0")
201+
implementation("net.sourceforge.streamsupport:android-retrofuture:1.7.2")
202+
implementation("io.ktor:ktor-client-okhttp:$ktorVersion")
203+
implementation("io.coil-kt:coil:1.1.0")
204204
}
205205
}
206206

src/commonMain/kotlin/com.adamratzman.spotify/SpotifyExceptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public sealed class SpotifyException(message: String, cause: Throwable? = null)
3131
public constructor(responseException: ResponseException) :
3232
this(
3333
responseException.message ?: "Bad Request",
34-
responseException.response?.status?.value,
34+
responseException.response.status.value,
3535
null,
3636
responseException
3737
)

src/commonMain/kotlin/com.adamratzman.spotify/http/HttpConnection.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ public class HttpConnection constructor(
145145
} catch (e: CancellationException) {
146146
throw e
147147
} catch (e: ResponseException) {
148-
val errorBody = e.response?.readText()
148+
val errorBody = e.response.readText()
149149
try {
150-
val error = errorBody?.toObject(ErrorResponse.serializer(), api, api?.json ?: nonstrictJson)?.error
151-
throw BadRequestException(error?.copy(reason = (error.reason ?: "") + " URL: $url"))
150+
val error = errorBody.toObject(ErrorResponse.serializer(), api, api?.json ?: nonstrictJson).error
151+
throw BadRequestException(error.copy(reason = (error.reason ?: "") + " URL: $url"))
152152
} catch (ignored: ParseException) {
153-
val error = errorBody?.toObject(AuthenticationError.serializer(), api, api?.json ?: nonstrictJson)
153+
val error = errorBody.toObject(AuthenticationError.serializer(), api, api?.json ?: nonstrictJson)
154154
throw AuthenticationException(error)
155155
}
156156
}

0 commit comments

Comments
 (0)