[Gradle, JS] Add check on run and dist task

- Check existence of compile output file to prevent fail in case of NO-SOURCE

#KT-31894 fixed
This commit is contained in:
Ilya Goncharov
2019-12-20 14:22:24 +03:00
parent fefdce0406
commit 24e3310393
2 changed files with 13 additions and 0 deletions
@@ -22,6 +22,13 @@ open class NodeJsExec : AbstractExecTask<NodeJsExec>(NodeJsExec::class.java), Re
@get:Internal
override lateinit var compilation: KotlinJsCompilation
init {
onlyIf {
compilation.compileKotlinTask.outputFile
.exists()
}
}
@Input
var sourceMapStackTraces = true
@@ -56,6 +56,12 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
var entry: File? = null
get() = field ?: compilation.compileKotlinTask.outputFile
init {
onlyIf {
entry!!.exists()
}
}
@get:Internal
internal var resolveFromModulesFirst: Boolean = false