Dominaezzz / kgl

Thin multiplatform wrappers for graphics.
Apache License 2.0
106 stars 14 forks source link

Port KGL to Kotlin 1.8.21 #39

Open Laxystem opened 1 year ago

Laxystem commented 1 year ago

Originally, I encountered the following error:

Caused by: java.lang.IllegalStateException: Artifacts of dependency io.ktor:ktor-io-metadata:1.4.0 is built by old Kotlin Gradle Plugin and can't be consumed in this way

It happened because KGL uses an absolutely ancient version of Kotlin (1.3.10 iirc)

Here's the exact place where the error was caused:

// build.gradle.kts:21
val ktorIoVersion: String by extra("1.4.0")

Temporary solution: Override the KGL dependency using your own (doesn't work for JS):

dependencies {
    api("io.ktor:ktor-io:2.3.0")
}

One problem with the above: The Kotlin Version. Really, this solution isn't possible to be PRed into KGL - it uses too ancient of a Kotlin version. Porting KGL to Kotlin 1.8.21 (or an older version; really, anything newer could be nice) will also give KGL the ability to use new features, for example, the following feature was implemented:

Platform specific extensions have not been implemented yet. Mostly because of this.

Using a non-ktor class could solve the issue - and a PR exists for this - but more and more issues like this will arrive.

I see no reason to stay on an ancient version of Kotlin - and if there is one, please, let me know. I'm going to heavily use KGL soon - in fact, I'm currently implementing a math library (definitely not because the one I've found calls its vectors Float3). If KGL isn't maintained anymore, I would like to help.