According to the KotlinJsDcePlugin.kt source code:...
# javascript
y
According to the KotlinJsDcePlugin.kt source code:
Copy code
project.afterEvaluate {
            val outputDir = project.buildDir
                .resolve(DEFAULT_OUT_DIR)
                .resolve(kotlinCompilation.target.disambiguationClassifier?.let { "$it/" }.orEmpty() + kotlinCompilation.name)

            val configuration = project.configurations.getByName(kotlinCompilation.compileDependencyConfigurationName)

            with(dceTask) {
                classpath = configuration
                destinationDir = dceTask.dceOptions.outputDirectory?.let { File(it) } ?: outputDir
                source(kotlinTask.outputFile)
            }
        }
the
destinationDir
variable is not available until
afterEvaluate
. Is there a specific reason? In my build file I have this:
Copy code
task assembleWeb(type: Sync) {
  configurations.compile.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
    // from runDceKotlinJs.destinationDir
  into webDir.child("dynamic").child("js")
  
  dependsOn classes
}
and
compileKotlin2Js.destinationDir
is available... but if I uncomment
runDceKotlinJs.destinationDir
it is
null
unless I wrap the entire thing in
afterEvaluate{}
. That doesn't seem right...
r
Hi, seems like a bug, could you please file an issue in YT?
y
Sure I will
🙏 1