Well, <@U77TZDSSW>, that seems to solve my case to...
# javascript
h
Well, @tarek, that seems to solve my case too, thanks. But the new 1.3 based gradle stuff explicitly demands that I tell IntelliJ to leave compilation and building to gradle, so I now have to find those «corresponding tutorials» mentioned in the last sentence you pasted. Until now, I haven't found any that explains how to get the kotlin.js into my jar files or anything ...
t
Yeah we have the same problem I guess. I’m looking into it, as of now, I found a gradle task that’s used to copy the files on some
kotlinJs
projects but it’s not clear how to use it from a multiplatform project
h
Nice. I wanted to peek into the sources to find out what were the secret keywords to put into the build file, but I didn't even find the sources, so I gave up ... Keep us posted if you find anything!
👍 1
t
Here’s a first version of a gradle task that works
Copy code
task linkJs {
    dependsOn "compileKotlinJs"

    doLast {
        def jsMain = kotlin.targets.js.compilations.main
        jsMain.runtimeDependencyFiles.each { File file ->
            copy {
                from(zipTree(file.absolutePath), {
                    includeEmptyDirs = false
                    include { fileTreeElement ->
                        def path = fileTreeElement.path
                        path.endsWith(".js") && (path.startsWith("META-INF/resources/") ||
                                !path.startsWith("META-INF/"))
                    }
                })
                into jsMain.output.classesDir.absolutePath + "/lib"
            }
        }
    }
}

jsMainClasses.dependsOn("linkJs")