From a8588dda2dbef399ccb25c73d1d0c30ed2ed1390 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:41:09 +0000 Subject: [PATCH 1/4] Bump kotlin from 1.9.10 to 1.9.20 Bumps `kotlin` from 1.9.10 to 1.9.20. Updates `org.jetbrains.kotlin:kotlin-test` from 1.9.10 to 1.9.20 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.10...v1.9.20) Updates `org.jetbrains.kotlin.multiplatform` from 1.9.10 to 1.9.20 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.10...v1.9.20) Updates `org.jetbrains.kotlin.plugin.serialization` from 1.9.10 to 1.9.20 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.9.10...v1.9.20) --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-test dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin.multiplatform dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin.plugin.serialization dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ea4160e..199df5a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlin = "1.9.10" +kotlin = "1.9.20" ktor = "2.3.6" [libraries] From 05676df099cfcbd5eb2e5cd4d007e3e073655088 Mon Sep 17 00:00:00 2001 From: StefMa Date: Tue, 14 Nov 2023 08:44:28 +0100 Subject: [PATCH 2/4] Try K2 compiler --- gradle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle.properties b/gradle.properties index 7fc6f1f..ca06c0c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ kotlin.code.style=official +kotlin.experimental.tryK2=true From 4a0363ccd14d29b63db5a55be6c333c65dd02611 Mon Sep 17 00:00:00 2001 From: StefMa Date: Tue, 14 Nov 2023 08:56:32 +0100 Subject: [PATCH 3/4] Adjust for new hierarchy template --- .github/workflows/publish.yml | 6 ++-- .github/workflows/tests.yml | 6 ++-- build.gradle.kts | 67 +++++++++++++---------------------- 3 files changed, 31 insertions(+), 48 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a9d5644..3f55ffd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@v4 - name: Publish linux - run: ./gradlew publishNativePublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }} + run: ./gradlew publishLinuxX64PublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }} publish-darwin: runs-on: macos-latest @@ -42,7 +42,7 @@ jobs: uses: actions/checkout@v4 - name: Publish darwin - run: ./gradlew publishNativePublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }} + run: ./gradlew publishMacosX64PublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }} publish-mingw: runs-on: windows-latest @@ -51,4 +51,4 @@ jobs: uses: actions/checkout@v4 - name: Publish mingw - run: ./gradlew.bat publishNativePublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }} + run: ./gradlew.bat publishMingwX64PublicationToGitHubPackagesRepository -PgithubPackagesUser=$GITHUB_ACTOR -PgithubPackagesKey=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8ede9e8..dfb17e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: run: sudo apt-get install -y libcurl4-gnutls-dev - name: Run tests - run: ./gradlew nativeTest + run: ./gradlew linuxX64Test - name: Test Report uses: mikepenz/action-junit-report@v4 @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@v4 - name: Run tests - run: ./gradlew nativeTest + run: ./gradlew macosX64Test - name: Test Report uses: mikepenz/action-junit-report@v4 @@ -65,7 +65,7 @@ jobs: uses: actions/checkout@v4 - name: Run tests - run: ./gradlew.bat nativeTest + run: ./gradlew.bat mingwX64Test - name: Test Report uses: mikepenz/action-junit-report@v4 diff --git a/build.gradle.kts b/build.gradle.kts index 1b91565..1af3d32 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,9 +8,6 @@ repositories { mavenCentral() } -val hostOs = System.getProperty("os.name") -val isArm64 = System.getProperty("os.arch") == "aarch64" -val isMingwX64 = hostOs.startsWith("Windows") kotlin { jvm { jvmToolchain(8) @@ -22,48 +19,40 @@ kotlin { } } + val hostOs = System.getProperty("os.name") + val isArm64 = System.getProperty("os.arch") == "aarch64" + val isMingwX64 = hostOs.startsWith("Windows") when { - hostOs == "Mac OS X" && isArm64 -> macosArm64("native") - hostOs == "Mac OS X" && !isArm64 -> macosX64("native") - hostOs == "Linux" && !isArm64 -> linuxX64("native") - isMingwX64 -> mingwX64("native") + hostOs == "Mac OS X" && isArm64 -> macosArm64() + hostOs == "Mac OS X" && !isArm64 -> macosX64() + hostOs == "Linux" && !isArm64 -> linuxX64() + isMingwX64 -> mingwX64() else -> throw GradleException("Host OS is not supported in Kotlin/Native.") } sourceSets { - val commonMain by getting { - dependencies { - implementation(libs.common.ktor.core) - implementation(libs.common.ktor.contentNegotiation) - implementation(libs.common.ktor.serialization) - implementation(libs.common.ktor.logging) - } + commonMain.dependencies { + implementation(libs.common.ktor.core) + implementation(libs.common.ktor.contentNegotiation) + implementation(libs.common.ktor.serialization) + implementation(libs.common.ktor.logging) } - val commonTest by getting { - dependencies { - implementation(libs.common.test.kotlin) - implementation(libs.common.test.ktorMock) - } + commonTest.dependencies { + implementation(libs.common.test.kotlin) + implementation(libs.common.test.ktorMock) } - val jvmMain by getting { - dependencies { - implementation(libs.jvm.ktor.client) - implementation(libs.jvm.ktor.logging) - } + jvmMain.dependencies { + implementation(libs.jvm.ktor.client) + implementation(libs.jvm.ktor.logging) } - val jvmTest by getting - val nativeMain by getting { - dependencies { - when { - hostOs == "Mac OS X" -> implementation(libs.macos.ktor.client) - hostOs == "Linux" -> implementation(libs.linux.ktor.client) - isMingwX64 -> implementation(libs.mingw.ktor.client) - else -> throw GradleException("Host OS is not supported in Kotlin/Native.") - } - + nativeMain.dependencies { + when { + hostOs == "Mac OS X" -> implementation(libs.macos.ktor.client) + hostOs == "Linux" -> implementation(libs.linux.ktor.client) + isMingwX64 -> implementation(libs.mingw.ktor.client) + else -> throw GradleException("Host OS is not supported in Kotlin/Native.") } } - val nativeTest by getting } } @@ -72,13 +61,7 @@ version = "0.0.2-SNAPSHOT" publishing { publications { publications.withType { - artifactId = when { - hostOs == "Mac OS X" && isArm64 -> artifactId.replace("native", "macosarm64") - hostOs == "Mac OS X" && !isArm64 -> artifactId.replace("native", "macosx64") - hostOs == "Linux" && !isArm64 -> artifactId.replace("native", "linuxx64") - isMingwX64 -> artifactId.replace("native", "mingwx64") - else -> throw GradleException("Host OS is not supported in Kotlin/Native.") - }.run { replace("kmp-", "") } + artifactId = artifactId.replace("kmp-", "") pom { url.set("https://github.com/ioki-mobility/kmp-lokalise-api") licenses { From 3604b9d97db88dac28cfb66f7439ddb01f30ed24 Mon Sep 17 00:00:00 2001 From: StefMa Date: Tue, 14 Nov 2023 08:57:32 +0100 Subject: [PATCH 4/4] Speed up Gradle --- gradle.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gradle.properties b/gradle.properties index ca06c0c..4dcde08 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,5 @@ kotlin.code.style=official kotlin.experimental.tryK2=true +org.gradle.parallel=true +org.gradle.jvmargs=-Xmx6g +org.gradle.caching=true