Skip to content

Commit

Permalink
Upgrade to Kotlin 1.6.20 and Ktor v2 (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrewCarlson authored Apr 10, 2022
1 parent 70ea1b1 commit b827c6f
Show file tree
Hide file tree
Showing 18 changed files with 145 additions and 197 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Publish

on:
create:
branches: [ main ]
push:
tags: [ 'v*' ]
branches: [ main ]

env:
Expand All @@ -13,11 +12,8 @@ env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}

jobs:
gradle:
strategy:
matrix:
os: [ macos-latest ]
runs-on: ${{ matrix.os }}
oublish:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ name: Js

on:
push:
branches: [ main ]
branches: [ main, 'release/**' ]
pull_request:
branches: [ main ]
branches: [ main, 'release/**' ]

jobs:
gradle:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
test-js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/jvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ name: Jvm

on:
push:
branches: [ main ]
branches: [ main, 'release/**' ]
pull_request:
branches: [ main ]
branches: [ main, 'release/**' ]

jobs:
gradle:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
test-jvm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Native

on:
push:
branches: [ main ]
branches: [ main, 'release/**' ]
pull_request:
branches: [ main ]
branches: [ main, 'release/**' ]

jobs:
gradle:
test-native:
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
os: [ macos-latest, ubuntu-latest ] # windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dependencies {
implementation("io.ktor:ktor-client-okhttp:$ktor_version")
implementation("io.ktor:ktor-client-android:$ktor_version")
// iOS
implementation("io.ktor:ktor-client-ios:$ktor_version")
implementation("io.ktor:ktor-client-darwin:$ktor_version")
// macOS/Windows/Linux
implementation("io.ktor:ktor-client-curl:$ktor_version")
// Javascript/NodeJS
Expand Down
9 changes: 5 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,21 @@ kotlin {
sourceSets {
all {
languageSettings.optIn("kotlin.RequiresOptIn")
languageSettings.optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
}
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation(libs.coroutines.core)
implementation(libs.serialization.json)
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.serialization.core)
implementation(libs.ktor.client.serialization.json)
implementation(libs.ktor.client.contentNegotiation)
implementation(libs.ktor.serialization)
}
}
val commonTest by getting {
dependencies {
implementation(libs.coroutines.test)
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
Expand Down Expand Up @@ -114,10 +116,9 @@ kotlin {
dependsOn(commonMain)
}
val iosTest by creating {
dependsOn(nativeCommonTest)
dependencies {
implementation(libs.coroutines.core)
implementation(libs.ktor.client.ios)
implementation(libs.ktor.client.darwin)
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.stability.nowarn=true
kotlin.native.ignoreDisabledTargets=true
kotlin.native.binary.memoryModel=experimental
# Publishing
group=org.drewcarlson
version=0.3.4-SNAPSHOT
version=0.4.1-SNAPSHOT
mavenUrl=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
mavenSnapshotUrl=https://s01.oss.sonatype.org/content/repositories/snapshots/
systemProp.org.gradle.internal.publish.checksums.insecure=true
43 changes: 28 additions & 15 deletions gradle/kotlin-js-store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

async-limiter@~1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd"
integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==

balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
Expand Down Expand Up @@ -393,10 +388,12 @@ [email protected]:
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.25.tgz#09ca32747c0e543f0e1814b7d3793477f9c8e152"
integrity sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==

[email protected]:
version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
[email protected]:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"

normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -525,11 +522,29 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=

[email protected]:
version "3.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36"
integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"

[email protected]:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
Expand All @@ -556,12 +571,10 @@ wrappy@1:
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=

[email protected]:
version "6.2.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb"
integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==
dependencies:
async-limiter "~1.0.0"
[email protected]:
version "8.5.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f"
integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==

y18n@^5.0.5:
version "5.0.8"
Expand Down
13 changes: 7 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
kotlin = "1.6.10"
coroutines = "1.5.2-native-mt"
kotlin = "1.6.20"
coroutines = "1.6.1"
serialization = "1.3.2"
ktorio = "1.6.7"
ktorio = "2.0.0"
dokka = "1.6.10"

[plugins]
Expand All @@ -15,11 +15,12 @@ coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", ve
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }

ktor-client-serialization-core = { module = "io.ktor:ktor-client-serialization", version.ref = "ktorio" }
ktor-client-serialization-json = { module = "io.ktor:ktor-client-json", version.ref = "ktorio" }
ktor-serialization = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktorio" }

ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktorio" }
ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktorio" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktorio" }
ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktorio" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktorio" }
ktor-client-ios = { module = "io.ktor:ktor-client-ios", version.ref = "ktorio" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktorio" }
ktor-client-contentNegotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktorio" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Fri May 29 16:14:03 PDT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Loading

0 comments on commit b827c6f

Please sign in to comment.