Hi friends! In Kotlin 1.3.30, I had a setup as fol...
# javascript
a
Hi friends! In Kotlin 1.3.30, I had a setup as follows: -
libA
was a MPP that depended on
stdlib
using
implementation
-
libB
was a MPP which depended on
libA
and
stdlib
using
implementation
-
libC
was a Kotlin/JS project, depending on
libA
,
libB
, and
stdlib
using
compile
I was able to build
libC
with
kotlin-dce-js
. I got a version of
stdlib
that contained the overlap that was used by all three libraries. I could also use
runDceKotlinJs.keep
to expose specific methods from
libA
,
libB
and
libC
to be called from pure JS. After bumping to Kotlin 1.3.41 however (still using
kotlin2js
plugin), when I try to run
:libC:runDceKotlinJs
, I get error messages complaining that
error: duplicate target file will be created for '/opt/projects/my-repo/libA/build/libs/libA-js-0.1.4.jar!lib/kotlin.js' and '/Users/amgupt01/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.41/55b92e441b0ea9cbf079c6452b41687f95571524/kotlin-stdlib-js-1.3.41.jar!kotlin.js'
Any ideas? EDIT: I've tried using the newer
org.jetbrains.kotlin.js
plugin, as well as changing `libC`'s dependencies to be
implementation
instead of
compile
. Still no luck 😕
b
kotlin2js was renamed to org.jetbrains.kotlin.js for that kotlin version
try with kotlin("js")
a
I updated to use
org.jetbrains.kotlin.js
(and had to rename tasks involving
compileKotlin2Js
to
compileKotlinJs
,
runDceKotlinJs
to
runDceKotlin
). When I run
:libC:runDceKotlin
, I still get the above error though. Is it because I have things as
compile
dependencies in
libC
? Should KotlinJs be able to tell that it's the same version of the same library?
b
Try changing your compile to implementation
a
Still getting the same issue about the duplicate file for the JS stdlib when using
implementation
😕
b
Are you able to paste your gradlefile for inspection?
a
I was trying to create a sample project with a simplified version of my gradlefile, but then I didn't run into the issue anymore! I'll see if I can use the process of elimination in my real project to see what might be causing the real issue. Thanks for your help!