scijava / scripting-kotlin

[EXPERIMENTAL] JSR-223-compliant Kotlin scripting plugin
http://imagej.net/Kotlin_Scripting
Other
10 stars 2 forks source link

Trove dependency #5

Closed hanslovsky closed 3 years ago

hanslovsky commented 3 years ago

The JetBrains trove4j fork is a transitive dependency:

org.jetbrains.intellij.deps:trove4j:jar:1.0.20181211:runtime

This complicates installation of the Kotlin scripting engine into Fiji.app/jars as the existing trove4j jar has a higher major version and takes precedence. Deleting the existing trove4j jar breaks Fiji in other places. I decided to rename the JetBrains trove4j jar and copy it into the Fiji.app/jars directory manually. There may be unintended side effects but it works for my use case of getting Kotlin scripting to work in IntelliJ.

hanslovsky commented 3 years ago

We can shade the kotlin-compiler-embeddable and JetBrains' trove4j jar into the scripting-kotlin jar when we deploy to Fiji.app/jars. The resulting jar is 46MB, but so is kotlin-compiler-embeddable jar, which would be deployed otherwise. I think this is a good solution and I will integrate this into #6 or create a separate PR.

For reference, dependency tree for #6:

--- maven-dependency-plugin:3.1.2:tree (default-cli) @ scripting-kotlin ---
org.scijava:scripting-kotlin:jar:0.1.2-SNAPSHOT
+- org.scijava:scijava-common:jar:2.83.3:compile
|  +- org.scijava:parsington:jar:2.0.0:compile
|  \- org.bushe:eventbus:jar:1.4:compile
+- org.jetbrains.kotlin:kotlin-compiler-embeddable:jar:1.4.30:compile
|  +- org.jetbrains.kotlin:kotlin-script-runtime:jar:1.4.30:runtime
|  +- org.jetbrains.kotlin:kotlin-reflect:jar:1.4.30:runtime
|  +- org.jetbrains.kotlin:kotlin-daemon-embeddable:jar:1.4.30:runtime
|  \- org.jetbrains.intellij.deps:trove4j:jar:1.0.20181211:runtime
+- org.jetbrains.kotlin:kotlin-stdlib:jar:1.4.30:compile
|  +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.4.30:compile
|  \- org.jetbrains:annotations:jar:13.0:compile
+- org.jetbrains.kotlin:kotlin-scripting-jsr223:jar:1.4.30:compile
|  +- org.jetbrains.kotlin:kotlin-scripting-common:jar:1.4.30:runtime
|  |  \- org.jetbrains.kotlinx:kotlinx-coroutines-core:jar:1.3.8:runtime
|  +- org.jetbrains.kotlin:kotlin-scripting-jvm:jar:1.4.30:runtime
|  +- org.jetbrains.kotlin:kotlin-scripting-jvm-host:jar:1.4.30:runtime
|  \- org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:jar:1.4.30:runtime
|     \- org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:jar:1.4.30:runtime
+- junit:junit:jar:4.13:test
|  \- org.hamcrest:hamcrest-core:jar:1.3:test
+- org.scijava:scijava-common:jar:tests:2.83.3:test
\- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.4.30:compile
   \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.4.30:compile