I'm having trouble with transitive runtime dependencies from a multiplatform library project.
My library has runtime dependencies that need to be used by the consumer.
Example:
Copy code
// My library
kotlin.sourcesets.named("jvmMain") {
dependencies {
runtimeOnly("$lwjglGroup:$lwjglName:$lwjglVersion:natives-$os")
}
}
However, the consumer can't see this dependency unless it also specifies the runtimeOnly. Is there a way to make this apply without the consumer of my library needing to specify it explicitly?
d
Dominaezzz
11/25/2019, 10:27 PM
api(...)
I think.
n
Nicholas Bilyk
11/25/2019, 11:00 PM
api doesn't work. It's my understanding that api is if you expose types from the dependent library in your library's API, which I don't.
Nicholas Bilyk
11/25/2019, 11:06 PM
It feels to me like a bug, because if I look at the POM when I use runtimeOnly from my library, I see:
Which is about what I'd expect. However, the consumer of my library doesn't have the native jars in the classpath
Nicholas Bilyk
11/25/2019, 11:07 PM
It only does if I list them from the consumer, but the problem with that is that the consumer then needs to know the correct natives version to use, which I'd rather be automatic for them.