From d24c2639441bb9d16f481a726a7dd8fdcd0a0182 Mon Sep 17 00:00:00 2001 From: Renee Vandervelde Date: Sun, 18 Jan 2026 08:18:42 -0600 Subject: [PATCH 1/2] Update to kotlin hierachy template for platform configuration --- buildSrc/src/main/kotlin/library.gradle.kts | 41 +----------- discover/build.gradle.kts | 58 +++++++---------- .../shade/discover/PlatformModule.kt | 0 .../shade/discover/PlatformModule.kt | 4 +- .../shade/discover/PlatformModule.kt | 0 gradle.properties | 1 - internals/build.gradle.kts | 62 +++++++------------ .../shade/internals/PlatformModule.kt | 0 .../shade/internals/PlatformModule.kt | 0 .../shade/internals/PlatformModule.kt | 0 10 files changed, 49 insertions(+), 117 deletions(-) rename discover/src/{iosMain => appleMain}/kotlin/inkapplications/shade/discover/PlatformModule.kt (100%) rename discover/src/{nativeMain => linuxMain}/kotlin/inkapplications/shade/discover/PlatformModule.kt (56%) rename discover/src/{windowsMain => mingwMain}/kotlin/inkapplications/shade/discover/PlatformModule.kt (100%) rename internals/src/{iosMain => appleMain}/kotlin/inkapplications/shade/internals/PlatformModule.kt (100%) rename internals/src/{nativeMain => linuxMain}/kotlin/inkapplications/shade/internals/PlatformModule.kt (100%) rename internals/src/{windowsMain => mingwMain}/kotlin/inkapplications/shade/internals/PlatformModule.kt (100%) diff --git a/buildSrc/src/main/kotlin/library.gradle.kts b/buildSrc/src/main/kotlin/library.gradle.kts index 10c34958..f7899810 100644 --- a/buildSrc/src/main/kotlin/library.gradle.kts +++ b/buildSrc/src/main/kotlin/library.gradle.kts @@ -3,6 +3,7 @@ plugins { } kotlin { + applyDefaultHierarchyTemplate() jvm() js { @@ -30,44 +31,4 @@ kotlin { linuxX64() mingwX64() - - sourceSets{ - val commonMain by sourceSets.getting - - val linuxX64Main by sourceSets.getting - val macosArm64Main by sourceSets.getting - val macosX64Main by sourceSets.getting - val mingwX64Main by sourceSets.getting - - val nativeMain by sourceSets.creating { - dependsOn(commonMain) - linuxX64Main.dependsOn(this) - macosArm64Main.dependsOn(this) - macosX64Main.dependsOn(this) - } - - val windowsMain by sourceSets.creating { - dependsOn(commonMain) - mingwX64Main.dependsOn(this) - } - - val iosArm64Main by sourceSets.getting - val iosX64Main by sourceSets.getting - val watchosArm32Main by sourceSets.getting - val watchosArm64Main by sourceSets.getting - val watchosX64Main by sourceSets.getting - val tvosArm64Main by sourceSets.getting - val tvosX64Main by sourceSets.getting - - val iosMain by sourceSets.creating { - dependsOn(commonMain) - iosArm64Main.dependsOn(this) - iosX64Main.dependsOn(this) - watchosArm32Main.dependsOn(this) - watchosArm64Main.dependsOn(this) - watchosX64Main.dependsOn(this) - tvosArm64Main.dependsOn(this) - tvosX64Main.dependsOn(this) - } - } } diff --git a/discover/build.gradle.kts b/discover/build.gradle.kts index edfaf2b7..5f85381d 100644 --- a/discover/build.gradle.kts +++ b/discover/build.gradle.kts @@ -6,54 +6,40 @@ plugins { kotlin { sourceSets { - val commonMain by getting { - dependencies { - implementation(libs.serialization.json) - api(libs.coroutines.core) - implementation(projects.serialization) - api(projects.structures) - - implementation(libs.ktor.client.core) - implementation(libs.ktor.client.contentnegotiation) - implementation(libs.ktor.serialization.json) - } + commonMain.dependencies { + implementation(libs.serialization.json) + api(libs.coroutines.core) + implementation(projects.serialization) + api(projects.structures) + + implementation(libs.ktor.client.core) + implementation(libs.ktor.client.contentnegotiation) + implementation(libs.ktor.serialization.json) } - val commonTest by getting { - dependencies { - implementation(libs.test.core) - implementation(libs.test.annotations) - } + commonTest.dependencies { + implementation(libs.test.core) + implementation(libs.test.annotations) } - val jvmMain by getting { - dependencies { - implementation(libs.ktor.client.okhttp) - } + jvmMain.dependencies { + implementation(libs.ktor.client.okhttp) } - val nativeMain by getting { - dependencies { - implementation(libs.ktor.client.cio) - } + linuxMain.dependencies { + implementation(libs.ktor.client.curl) } - val windowsMain by getting { - dependencies { - implementation(libs.ktor.client.winhttp) - } + mingwMain.dependencies { + implementation(libs.ktor.client.winhttp) } - val iosMain by getting { - dependencies { - implementation(libs.ktor.client.darwin) - } + appleMain.dependencies { + implementation(libs.ktor.client.darwin) } - val jsMain by getting { - dependencies { - implementation(libs.ktor.client.js) - } + jsMain.dependencies { + implementation(libs.ktor.client.js) } } } diff --git a/discover/src/iosMain/kotlin/inkapplications/shade/discover/PlatformModule.kt b/discover/src/appleMain/kotlin/inkapplications/shade/discover/PlatformModule.kt similarity index 100% rename from discover/src/iosMain/kotlin/inkapplications/shade/discover/PlatformModule.kt rename to discover/src/appleMain/kotlin/inkapplications/shade/discover/PlatformModule.kt diff --git a/discover/src/nativeMain/kotlin/inkapplications/shade/discover/PlatformModule.kt b/discover/src/linuxMain/kotlin/inkapplications/shade/discover/PlatformModule.kt similarity index 56% rename from discover/src/nativeMain/kotlin/inkapplications/shade/discover/PlatformModule.kt rename to discover/src/linuxMain/kotlin/inkapplications/shade/discover/PlatformModule.kt index 39fba780..b90e624f 100644 --- a/discover/src/nativeMain/kotlin/inkapplications/shade/discover/PlatformModule.kt +++ b/discover/src/linuxMain/kotlin/inkapplications/shade/discover/PlatformModule.kt @@ -1,8 +1,8 @@ package inkapplications.shade.discover import io.ktor.client.engine.* -import io.ktor.client.engine.cio.* +import io.ktor.client.engine.curl.Curl internal actual class PlatformModule actual constructor() { - actual fun createEngine(): HttpClientEngineFactory<*> = CIO + actual fun createEngine(): HttpClientEngineFactory<*> = Curl } diff --git a/discover/src/windowsMain/kotlin/inkapplications/shade/discover/PlatformModule.kt b/discover/src/mingwMain/kotlin/inkapplications/shade/discover/PlatformModule.kt similarity index 100% rename from discover/src/windowsMain/kotlin/inkapplications/shade/discover/PlatformModule.kt rename to discover/src/mingwMain/kotlin/inkapplications/shade/discover/PlatformModule.kt diff --git a/gradle.properties b/gradle.properties index 66a0669c..20c92e8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,3 @@ version=2.0-SNAPSHOT group=com.inkapplications.shade org.gradle.jvmargs=-Xmx4g -kotlin.mpp.applyDefaultHierarchyTemplate=false diff --git a/internals/build.gradle.kts b/internals/build.gradle.kts index 96f10afc..4cf87881 100644 --- a/internals/build.gradle.kts +++ b/internals/build.gradle.kts @@ -6,56 +6,42 @@ plugins { kotlin { sourceSets { - val commonMain by getting { - dependencies { - implementation(libs.serialization.json) - implementation(libs.ktor.client.core) - implementation(projects.serialization) - api(projects.structures) - api(libs.kimchi.logger) - - implementation(libs.ktor.client.contentnegotiation) - implementation(libs.ktor.serialization.json) - } + commonMain.dependencies { + implementation(libs.serialization.json) + implementation(libs.ktor.client.core) + implementation(projects.serialization) + api(projects.structures) + api(libs.kimchi.logger) + + implementation(libs.ktor.client.contentnegotiation) + implementation(libs.ktor.serialization.json) } - val jvmMain by getting { - dependencies { - implementation(libs.ktor.client.okhttp) - implementation(libs.okhttp.tls) - implementation(libs.okhttp.sse) - } + commonTest.dependencies { + implementation(libs.test.core) + implementation(libs.test.annotations) } - val jsMain by getting { - dependencies { - implementation(libs.ktor.client.js) - } + jvmMain.dependencies { + implementation(libs.ktor.client.okhttp) + implementation(libs.okhttp.tls) + implementation(libs.okhttp.sse) } - val nativeMain by getting { - dependencies { - implementation(libs.ktor.client.curl) - } + jsMain.dependencies { + implementation(libs.ktor.client.js) } - val windowsMain by getting { - dependencies { - implementation(libs.ktor.client.winhttp) - } + linuxMain.dependencies { + implementation(libs.ktor.client.curl) } - val iosMain by getting { - dependencies { - implementation(libs.ktor.client.darwin) - } + mingwMain.dependencies { + implementation(libs.ktor.client.winhttp) } - val commonTest by getting { - dependencies { - implementation(libs.test.core) - implementation(libs.test.annotations) - } + appleMain.dependencies { + implementation(libs.ktor.client.darwin) } } } diff --git a/internals/src/iosMain/kotlin/inkapplications/shade/internals/PlatformModule.kt b/internals/src/appleMain/kotlin/inkapplications/shade/internals/PlatformModule.kt similarity index 100% rename from internals/src/iosMain/kotlin/inkapplications/shade/internals/PlatformModule.kt rename to internals/src/appleMain/kotlin/inkapplications/shade/internals/PlatformModule.kt diff --git a/internals/src/nativeMain/kotlin/inkapplications/shade/internals/PlatformModule.kt b/internals/src/linuxMain/kotlin/inkapplications/shade/internals/PlatformModule.kt similarity index 100% rename from internals/src/nativeMain/kotlin/inkapplications/shade/internals/PlatformModule.kt rename to internals/src/linuxMain/kotlin/inkapplications/shade/internals/PlatformModule.kt diff --git a/internals/src/windowsMain/kotlin/inkapplications/shade/internals/PlatformModule.kt b/internals/src/mingwMain/kotlin/inkapplications/shade/internals/PlatformModule.kt similarity index 100% rename from internals/src/windowsMain/kotlin/inkapplications/shade/internals/PlatformModule.kt rename to internals/src/mingwMain/kotlin/inkapplications/shade/internals/PlatformModule.kt From e6ac16c46452a1b2e47cb71eb03f59f743fcb1c3 Mon Sep 17 00:00:00 2001 From: Renee Vandervelde Date: Sun, 18 Jan 2026 08:23:44 -0600 Subject: [PATCH 2/2] Update changelog entry --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index daffa893..76f751eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ Change Log ### Fixed: - - Native targets now use Curl based Http client, which should support HTTPS - connections now. + - Linux and MacOS now use the Curl and Darwin engines for HTTP requests, + allowing SSL requests on both platforms through platform trusted certificates. ### Changed: