I've written a Java library in Kotlin, and I'd like to compile it to a jar that is usable by Java and Kotlin applications.
The idea is that the jar should be able to work on Java projects, and Kotlin projects. Doing a simple ./gradlew clean assemble
generates a jar, and when I inspect the jar I can see several imports that aren't included in the jar that normal Java applications won't have access too:
import jet.runtime.typeinfo.JetValueParameter;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.KotlinClass;
import kotlin.jvm.internal.KotlinClass.Kind;
import kotlin.jvm.internal.KotlinSyntheticClass;
import kotlin.jvm.internal.KotlinSyntheticClass.Kind;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
How could I include the above dependencies in the jar? Right now the jar is only 30kb. I'd prefer to not have to include the entire Kotlin runtime either, but only compile in the used components.