Skip to content

Commit

Permalink
Upgrade some Kotlin related dependencies (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
iNoles authored Jul 21, 2023
1 parent 4245b87 commit 102c366
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 43 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fuel

[![Kotlin](https://img.shields.io/badge/Kotlin-1.8.21-blue.svg)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.0-blue.svg)](http://kotlinlang.org)
[![MavenCentral](https://maven-badges.herokuapp.com/maven-central/com.github.kittinunf.fuel/fuel-jvm/badge.svg)](https://search.maven.org/search?q=com.github.kittinunf.fuel)
[![ktlint](https://img.shields.io/badge/code%20style-%E2%9D%A4-FF4081.svg)](https://ktlint.github.io)
![Run Gradle](https://github.com/kittinunf/fuel/workflows/Run%20Gradle/badge.svg?branch=main)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
kotlin("multiplatform") version "1.8.21" apply false
id("org.jetbrains.kotlinx.kover") version "0.7.0" apply false
kotlin("multiplatform") version "1.9.0" apply false
id("org.jetbrains.kotlinx.kover") version "0.7.2" apply false
}

val isReleaseBuild: Boolean
Expand Down
11 changes: 2 additions & 9 deletions fuel-kotlinx-serialization/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization") version "1.8.21"
kotlin("plugin.serialization") version "1.9.0"
id("publication")
id("org.jetbrains.kotlinx.kover")
}
Expand All @@ -15,15 +15,8 @@ kotlin {
}
}
js(IR) {
browser()
binaries.executable()
browser {
commonWebpackConfig {
cssSupport {
enabled.set(true)
}
}
}
// nodejs()
}
ios {
binaries {
Expand Down
4 changes: 2 additions & 2 deletions fuel-moshi-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
kotlin("jvm")
kotlin("kapt")
id("publication")
id("org.jetbrains.kotlinx.kover")
id("com.google.devtools.ksp") version "1.9.0-1.0.11"
}

kotlin {
Expand All @@ -25,7 +25,7 @@ dependencies {
api(libs.moshi)
api(libs.result.jvm)

kaptTest(libs.moshi.kotlin.codegen)
kspTest(libs.moshi.kotlin.codegen)

testImplementation(libs.junit)
testImplementation(libs.mockwebserver)
Expand Down
22 changes: 1 addition & 21 deletions fuel/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack

plugins {
kotlin("multiplatform")
id("publication")
Expand All @@ -17,15 +14,8 @@ kotlin {
}
}
js(IR) {
browser()
binaries.executable()
browser {
commonWebpackConfig {
cssSupport {
enabled.set(true)
}
}
}
// nodejs()
}
ios {
binaries {
Expand Down Expand Up @@ -110,12 +100,6 @@ kotlin {
}
val iosTest by getting
}

kotlin.targets.withType(KotlinNativeTarget::class.java) {
binaries.all {
binaryOptions["memoryModel"] = "experimental"
}
}
}

dependencies {
Expand All @@ -124,7 +108,3 @@ dependencies {
kover(project(":fuel-kotlinx-serialization"))
kover(project(":fuel-moshi-jvm"))
}

tasks.getByName<KotlinWebpack>("jsBrowserProductionWebpack") {
outputFileName = "js.js"
}
7 changes: 4 additions & 3 deletions fuel/src/appleMain/kotlin/fuel/HttpUrlFetcher.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package fuel

import kotlinx.cinterop.BetaInteropApi
import kotlinx.coroutines.suspendCancellableCoroutine
import okio.toByteString
import okio.ByteString.Companion.toByteString
import platform.Foundation.NSData
import platform.Foundation.NSError
import platform.Foundation.NSHTTPURLResponse
Expand All @@ -22,10 +23,9 @@ import platform.Foundation.setValue
import kotlin.coroutines.resume

internal class HttpUrlFetcher(private val sessionConfiguration: NSURLSessionConfiguration) {
@OptIn(BetaInteropApi::class)
suspend fun fetch(method: String, request: Request): HttpResponse = suspendCancellableCoroutine { continuation ->
val delegate = { httpData: NSData?, nsUrlResponse: NSURLResponse?, error: NSError? ->
initRuntimeIfNeeded()

continuation.resume(
buildHttpResponse(
data = httpData,
Expand Down Expand Up @@ -88,5 +88,6 @@ internal class HttpUrlFetcher(private val sessionConfiguration: NSURLSessionConf
}
}

@BetaInteropApi
private fun String.encode(): NSData = NSString.create(string = this).dataUsingEncoding(NSWindowsCP1251StringEncoding)!!
}
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
coroutines = "1.7.0"
jackson = "2.15.0"
coroutines = "1.7.2"
jackson = "2.15.2"
junit = "4.13.2"
moshi = "1.14.0"
moshi = "1.15.0"
okhttp = "5.0.0-alpha.11"
okio = "3.2.0"
okio = "3.4.0"
forge = "1.0.0-alpha3"
result = "5.4.0"
serialization = "1.4.0"
serialization = "1.5.1"

[libraries]
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
Expand Down

0 comments on commit 102c366

Please sign in to comment.