https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
e

Elka

06/20/2021, 7:15 AM
Kotlin Native: Why are
implementation
dependencies specified in submodules are exported when
transitiveExport = true
? Shouldn’t it only export dependencies marked with
api
?
c

CLOVIS

06/20/2021, 7:24 AM
Note: not an expert, I could be wrong Java doesn't have a concept of ‘static libraries', it only has ‘shared libraries'. That means that your jar only contains ‘references' to whatever library's jar you're using. Therefore, if that jar is not available at runtime, then your program can't run. The difference between implementation and API is whether or not developers that use your library see your dependencies in their auto-complete, etc. Essentially: • implementation: your dependencies appear in their runtime classpath • API: your dependencies appear in their runtime and compile-time classpath
e

Elka

06/20/2021, 7:39 AM
I am talking about Kotlin Native not JVM. Edited the question*
c

CLOVIS

06/20/2021, 7:47 AM
Ah sorry, no idea then :/
l

Luigi Scarminio

02/18/2022, 11:24 AM
@Elka, did you find the answer for that? I'm facing the same problem. When I look at the .pom generated for jvm, it is exported as runtime.
<dependency>
<groupId>com.embraer</groupId> <artifactId>ScapJava</artifactId> <version>3.4.1</version> <scope>runtime</scope> </dependency>
e

Elka

03/13/2022, 8:35 AM
I had to disable transitiveExport and manually export the transitive ones, a bit ugly but works
9 Views