Yan Pujante
06/23/2019, 4:43 PMproject.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:
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...Roman Artemev [JB]
06/24/2019, 12:01 PMYan Pujante
06/24/2019, 2:26 PM