[Gradle, JS] Do not force dukat in separate dukat task

^KT-34014 fixed
^KT-49505 fixed
This commit is contained in:
Ilya Goncharov
2021-11-02 12:57:49 +03:00
committed by Space
parent 9c4aa8fe84
commit 540419a5d7
3 changed files with 13 additions and 18 deletions
@@ -20,7 +20,7 @@ constructor(
override val considerGeneratingFlag: Boolean = false
override val requiredNpmDependencies: Set<RequiredKotlinJsDependency> by lazy {
setOf(nodeJs.versions.dukat)
emptySet()
}
@get:OutputDirectory
@@ -462,7 +462,7 @@ internal class KotlinCompilationNpmResolver(
val toolsNpmDependencies = compilationResolver.rootResolver.taskRequirements
.getCompilationNpmRequirements(projectPath, compilationResolver.compilationDisambiguatedName)
val dukatIfNecessary = if (externalNpmDependencies.any { it.generateExternals }) {
val dukatIfNecessary = if (externalNpmDependencies.isNotEmpty()) {
setOf(
NpmDependencyDeclaration(
scope = NpmDependency.Scope.DEV,
@@ -54,8 +54,17 @@ open class YarnPlugin : Plugin<Project> {
// https://youtrack.jetbrains.com/issue/KT-48241
project.allprojects
.forEach {
it.tasks.implementing(RequiresNpmDependencies::class)
.forEach {}
val fn: (Project) -> Unit = {
it.tasks.implementing(RequiresNpmDependencies::class)
.forEach {}
}
if (it.state.executed) {
fn(it)
} else {
it.afterEvaluate {
fn(it)
}
}
}
}
@@ -77,20 +86,6 @@ open class YarnPlugin : Plugin<Project> {
it.dependsOn(packageJsonUmbrella)
}
// project.allprojects
// .forEach {
// val fn: (Project) -> Unit = {
// it.tasks.implementing(RequiresNpmDependencies::class).all {}
// }
// if (it.state.executed) {
// fn(it)
// } else {
// it.afterEvaluate {
// fn(it)
// }
// }
// }
val storeYarnLock = tasks.register("kotlinStoreYarnLock", YarnLockCopyTask::class.java) {
it.dependsOn(kotlinNpmInstall)
it.inputFile.set(nodeJs.rootPackageDir.resolve("yarn.lock"))