Hi,
I have created a Kotlin/Javascript library:
https://github.com/jean79/yested
It packages into a jar containing Kotlin source and META-INF/services/org.jetbrains.kotlin.js.librarySource file with list of classes.
Then I import this library into Idea (13,14) into another Kotlin JS project:
Project Structure - Libraries - Add New Project Library - Java - Select Jar - add as Classes and Sources.
Content assist works fine, I see no compilation issue when writing Kotlin code.
Also if I setup a maven project with this dependency then the compilation works fine.
But when I do build in Idea: Build - Make Project, compiler cannot find classes from my library: Unresolved reference: …
Try to use plugin/compiler version 0.9.1306 or higher or wait M10(ETA today).
Since 0.9.1306 You no more needs META-INF/services/org.jetbrains.kotlin.js.librarySource, but You should declare next fields in META-INF/MANIFEST.MF: Specification-Title: Kotlin JavaScript Lib Kotlin-JS-Module-Name: <your-modeule-name>
Idea editor still works fine, but compilation keeps crashing:
Error:(4, 8) Kotlin: Unresolved reference: net
(net is a package in my library).
I use kotlin: 0.9.223
I think I am doing something wrong when adding library to my second project. There is no error in Idea log files.
I Project view I see:
External Libraries:
1.7 (JDK)
Yested-1.0-snapshot
Sorry, didn't spotted that it is 4 digit minor number.
How can I update compiler in Idea? I have the latest plugin (0.9.233) installed.
Many thanks,
Jan
Thanks,
I have used the shared pom file. Just had to include an ant script that copies Kotlin source and generated JS file from target/classes and it works.https://github.com/jean79/yested/blob/master/pom.xml
J.