apache / logging-log4j-kotlin

A Kotlin-friendly interface to log against the Log4j API
https://logging.apache.org/log4j/kotlin
Apache License 2.0
45 stars 11 forks source link

Upgrade Kotlin to v1.4 #14

Closed mikaello closed 1 year ago

mikaello commented 3 years ago

I am using this library in my application, but it prevents me from upgrading to Kotlin v1.4 since this library includes Kotlin v1.3.72. I can force my application to use Kotlin stdlib 1.3, but then some of the point of upgrading will be gone.

This PR is not merge ready, since it may break all Kotlin v1.3 projects (not verified/checked), but it is not possible to create an issue, so this PR will serve as a placeholder for this issue I guess?!

mikaello commented 3 years ago

@rocketraman Thanks a lot for the thorough answer. And sorry for my comment on missing issue tracker, you even had a separate section about it in the Readme, my bad.

I think your summary indicating that this project should be on 1.3 and instead avoid distributing stdlib as a transitive dependency sounds like a reasonable solution.

rocketraman commented 3 years ago

I think your summary indicating that this project should be on 1.3 and instead avoid distributing stdlib as a transitive dependency sounds like a reasonable solution.

Care to submit a patch? :-)

solaristhesun commented 3 years ago

What ist the status on this? I am getting the following errors:

w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
    C:/Users/sts/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.4.30/aeecfab2e6acbcb80fc6628e8882c98cbbd819cf/kotlin-stdlib-jdk8-1.4.30.jar (version 1.4)
    C:/Users/sts/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.4.30/cd81ed90fd79e43f587bd384c2bc6d1aed0bfe31/kotlin-stdlib-jdk7-1.4.30.jar (version 1.4)
    C:/Users/sts/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.3.0/6fd129fd9ba8581f2cb9c58bfd431dda4ee0457e/kotlin-reflect-1.3.0.jar (version 1.3)
    C:/Users/sts/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.4.30/d10d1e10f47006ee08162dde039e38ac487de4ac/kotlin-stdlib-1.4.30.jar (version 1.4)
    C:/Users/sts/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.30/bb9a3173350f55732416ee27956ea8f9b81f4dbb/kotlin-stdlib-common-1.4.30.jar (version 1.4)
w: Consider providing an explicit dependency on kotlin-reflect 1.4 to prevent strange errors
w: Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath

So it looks to me as if it is not working in kotlin 1.4 despite someone saying it should. What steps are necessary to get it working in 1.4.

rocketraman commented 3 years ago

So it looks to me as if it is not working in kotlin 1.4 despite someone saying it should. What steps are necessary to get it working in 1.4.

See my last comment. You're having an issue since you are transitively pulling in kotlin-reflect 1.3. A temporary work-around is to depend explicitly on kotlin-reflect 1.4 in your project, until this (or another) pull can be updated with the changes in this project's POM to avoid sending the kotlin lib dependencies to downstream projects.

mikaello commented 3 years ago

Sorry for not replying! I tried to figure out how to avoid distributing the stdlib as a transitive dependency, but I struggled a bit, and after a while I surrendered and changed my project import to:

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api-kotlin</artifactId>
            <version>1.0.0</version>
+           <exclusions>
+               <exclusion>
+                   <groupId>org.jetbrains.kotlin</groupId>
+                   <artifactId>kotlin-stdlib</artifactId>
+               </exclusion>
+           </exclusions>
        </dependency>
rocketraman commented 3 years ago

Closing this in favor of https://github.com/apache/logging-log4j-kotlin/pull/17, to maintain compatibility with older versions of Kotlin for as long as possible.

rocketraman commented 2 years ago

Now that 1.6 is out, its time to resurrect this and move to 1.4.

jvz commented 1 year ago

I've opened #31 to track this. We can work on upgrading the minimum Kotlin version after I make a 1.3.x release.

rocketraman commented 1 year ago

Closing in favor of https://github.com/apache/logging-log4j-kotlin/pull/14 which also updates coroutines and rebases on latest master.

mikaello commented 1 year ago

👍🏻

Closing in favor of #14 which also updates coroutines and rebases on latest master.

34, not 14: https://github.com/apache/logging-log4j-kotlin/pull/34