I’m facing a case where I can’t import a toplevel function from a jar file (bad.jar) while I can from another one (good.jar).
The function is defined in BuildScript.kt
:
@Directive public fun repos(vararg repos: kotlin.String): kotlin.Unit {...
When I compile with good.jar on the classpath, “import com.beust.kobalt.repos” compiles but not when I use bad.jar.
I verified that both jar files have this .class and function:
$ javap -classpath ~/t/bad.jar com.beust.kobalt.BuildScriptKt
Compiled from "BuildScript.kt"
public final class com.beust.kobalt.BuildScriptKt {
public static final void repos(java.lang.String...);
}
$ javap -classpath ~/t/good.jar com.beust.kobalt.BuildScriptKt
Compiled from "BuildScript.kt"
public final class com.beust.kobalt.BuildScriptKt {
public static final void repos(java.lang.String...);
}
BuildScriptKt.class
is actually identical in both jar files.
It seems there is some external factor that is not exposing this function in bad.jar. I thought main.kotlin_module
might have something to do with it so I copied that file from good.jar to bad.jar but that didn’t fix the problem.
What am I missing?