I’m using KMP to generate a java and js library I ...
# multiplatform
f
I’m using KMP to generate a java and js library I later use in a java application and js application. the js code I need to copy to another directory of a different project. so I created a copy task in the gradle build file and let it depend on the task
jsBrowserProductionLibraryDistribution
but the tasks
copyJsCode
does not get executed. Due to the print statements I added I can see that the task gets configured. the vars
inPath
and
outPath
look correct in the logs (for testing I just copy to a test directory, the real path I will add later). But the print statement in the filter path does never get executed. I also don’t see the task being called in the logs after
> Task :ys-kcart:jsBrowserProductionLibraryDistribution
got called. is my task depending on the wrong task?
Copy code
tasks.register<Copy>("copyJsCode", Copy::class) {
    val inPath = "$projectDir/output"
    println("copyJsCode: $inPath")
    from(inPath)
    {
        filter {
            println("copied")
            it
        }
    }

    val outPath = "$projectDir/output2"
    println("copyJsCode: $outPath")
    into(outPath)
}

tasks.getByName("copyJsCode")
    .dependsOn(tasks.getByName("jsBrowserProductionLibraryDistribution"))