handstandsam / kmp4free

A Gradle Plugin that allows seamless switching between Kotlin JVM and the Kotlin Multiplatform Plugins
Apache License 2.0
62 stars 1 forks source link

Should we use withJava() for the jvm {} multiplatform target? #3

Closed handstandsam closed 2 years ago

handstandsam commented 2 years ago

Do we need withJava() since we are already mapping sourcesets? Not sure. Creating this issue to track this thought.

https://kotlinlang.org/docs/multiplatform-configure-compilations.html#use-java-sources-in-jvm-compilations

val multiplatformExtension =
    target.extensions.getByType(KotlinMultiplatformExtension::class.java)
multiplatformExtension.apply {
    // Always enable JVM
    jvm {
        // Do we really need withJava()?
        // https://kotlinlang.org/docs/multiplatform-configure-compilations.html#use-java-sources-in-jvm-compilations
        //withJava()
    }
}

For now, we'll go with just jvm() unless we can see why we'd need withJava()

handstandsam commented 2 years ago

Working as is, so leaving what we have now.