Having some issues with trying to apply ``` task a...
# javascript
j
Having some issues with trying to apply
Copy code
task assembleWeb(type: Sync) {
    println(configurations)
    configurations.commonMainCompileOnly.each { File file ->
        from(zipTree(file.absolutePath), {
            includeEmptyDirs = false
            include { fileTreeElement ->
                def path = fileTreeElement.path
                path.endsWith(".js") && (path.startsWith("META-INF/resources/") ||
                        !path.startsWith("META-INF/"))
            }
        })
    }
    from compileKotlin2Js.destinationDir
    into "${projectDir}/web"

    dependsOn classes
}

assemble.dependsOn assembleWeb
on a multiplatform project. Since im not using
kotlin2js
but the multiplatform plugin i'm receiving:
Could not get unknown property 'compileKotlin2Js' for task ':assembleWeb' of type org.gradle.api.tasks.Sync.
Anyone has any idea how to solve it?
Would seem the https://kotlinlang.org/docs/tutorials/javascript/getting-started-gradle/getting-started-with-gradle.html guide is outdated in more than one way. It is named
compileKotlinJs
in the multiplatform or currently
Still issues with that setup with 1.3.20 and multiplatform... IF anyone got this working please let me know 😄
r
You can look at this example: https://github.com/rjaros/kvision-examples/blob/master/simple-mpp-fullstack-ktor/build.gradle The build configuration is based on ktor official mpp example, but is working with current kotlin version.
👍 1
The original is here: https://github.com/ktorio/ktor-samples/blob/master/mpp/fullstack-mpp/build.gradle but a small fix is needed to get it working.
change "kotlin.targets.backend.compilations.main.output.files" to "kotlin.targets.backend.compilations.main.output"
j
Sweet! Thanks @Robert Jaros