[Gradle, JS] Use node_modules dir existence as marker of up-to-date

^KT-34014 fixed
^KT-49505 fixed
This commit is contained in:
Ilya Goncharov
2021-10-28 13:34:20 +03:00
committed by Space
parent 21249a1dcb
commit 4bf6e6d722
2 changed files with 13 additions and 1 deletions
@@ -31,6 +31,19 @@ open class KotlinNpmInstallTask : DefaultTask() {
@Input
val args: MutableList<String> = mutableListOf()
@get:Internal
val nodeModulesDir: File by lazy {
(nodeJs ?: unavailableValueError("nodeJs"))
.rootPackageDir
.resolve("node_modules")
}
init {
outputs.upToDateWhen {
nodeModulesDir.isDirectory
}
}
@Suppress("unused")
@get:PathSensitive(PathSensitivity.ABSOLUTE)
@get:IgnoreEmptyDirectories