[Build] Bump gradle-node-plugin version to 3.0.1 to support conf cache
:kotlin-test:kotlin-test-js:kotlin-test-js-it will still have old version as integration test run logic cannot be fully refactored to the new version (approximately till 3.1) Relates to #KT-44611
This commit is contained in:
@@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsages
|
||||
|
||||
plugins {
|
||||
// TODO: update gradle-node-plugin to support configuration cache
|
||||
id "com.github.node-gradle.node" version "2.2.0"
|
||||
}
|
||||
|
||||
@@ -26,13 +27,16 @@ dependencies {
|
||||
// package.json contains direct links to the builddir
|
||||
buildDir = "$projectDir/build"
|
||||
|
||||
[compileKotlin2Js, compileTestKotlin2Js]*.configure {
|
||||
kotlinOptions.moduleKind = "commonjs"
|
||||
["compileKotlin2Js", "compileTestKotlin2Js"].forEach {
|
||||
tasks.named(it).configure {
|
||||
kotlinOptions.moduleKind = "commonjs"
|
||||
}
|
||||
}
|
||||
|
||||
task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) {
|
||||
from compileKotlin2Js.destinationDir
|
||||
tasks.register("populateNodeModules", Copy) {
|
||||
dependsOn(compileKotlin2Js)
|
||||
dependsOn(configurations.nodeModules)
|
||||
from compileKotlin2Js.destinationDir
|
||||
|
||||
from {
|
||||
configurations.nodeModules.collect {
|
||||
@@ -53,7 +57,7 @@ node {
|
||||
}
|
||||
|
||||
def createFrameworkTest(def name) {
|
||||
return tasks.create("test$name", NpmTask) {
|
||||
return tasks.register("test$name", NpmTask) {
|
||||
dependsOn(compileTestKotlin2Js, populateNodeModules, npmInstall)
|
||||
def lowerName = name.toLowerCase()
|
||||
def tcOutput = "$buildDir/tc-${lowerName}.log"
|
||||
@@ -80,6 +84,8 @@ def createFrameworkTest(def name) {
|
||||
}
|
||||
}
|
||||
|
||||
['Jest', 'Jasmine', 'Mocha', 'Qunit', 'Tape'].each {
|
||||
check.dependsOn createFrameworkTest(it)
|
||||
tasks.check {
|
||||
['Jest', 'Jasmine', 'Mocha', 'Qunit', 'Tape'].each {
|
||||
dependsOn createFrameworkTest(it)
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.github.node-gradle.node" version "2.2.0"
|
||||
id "com.github.node-gradle.node" version "3.0.1"
|
||||
}
|
||||
|
||||
description = 'Kotlin Standard Library for JS'
|
||||
@@ -325,7 +325,7 @@ artifacts {
|
||||
node {
|
||||
download = true
|
||||
version = '12.18.0'
|
||||
nodeModulesDir = buildDir
|
||||
nodeProjectDir = buildDir
|
||||
}
|
||||
|
||||
// Otherwise Node ignores nodeModulesDir
|
||||
@@ -352,8 +352,8 @@ task runMocha(type: NodeTask, dependsOn: [testClasses, installMocha, ':kotlin-te
|
||||
args = ['--reporter', 'min']
|
||||
}
|
||||
|
||||
args += ['--timeout', '10s']
|
||||
args += [jsTestOutputFile, kotlinTestJsTestOutputFile]
|
||||
args = args.get() + ['--timeout', '10s']
|
||||
args = args.get() + [jsTestOutputFile, kotlinTestJsTestOutputFile]
|
||||
|
||||
execOverrides {
|
||||
it.ignoreExitValue = rootProject.ignoreTestFailures
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import com.moowork.gradle.node.yarn.YarnTask
|
||||
import com.github.gradle.node.yarn.task.YarnTask
|
||||
|
||||
description = "Simple Kotlin/JS tests runner with TeamCity reporter"
|
||||
|
||||
plugins {
|
||||
id("base")
|
||||
id("com.github.node-gradle.node") version "2.2.0"
|
||||
id("com.github.node-gradle.node") version "3.0.1"
|
||||
}
|
||||
|
||||
publish()
|
||||
@@ -19,19 +19,20 @@ dependencies {
|
||||
}
|
||||
|
||||
node {
|
||||
version = "11.9.0"
|
||||
download = true
|
||||
nodeModulesDir = projectDir
|
||||
version.set("11.9.0")
|
||||
download.set(true)
|
||||
nodeProjectDir.set(projectDir)
|
||||
}
|
||||
|
||||
tasks {
|
||||
named("yarn") {
|
||||
val nodeModulesDir = projectDir.resolve("node_modules")
|
||||
outputs.upToDateWhen {
|
||||
projectDir.resolve("node_modules").isDirectory
|
||||
nodeModulesDir.isDirectory
|
||||
}
|
||||
// Without it several yarns can works incorrectly
|
||||
(this as YarnTask).apply {
|
||||
args = args + "--network-concurrency" + "1" + "--mutex" + "network"
|
||||
args.set(args.get() + "--network-concurrency" + "1" + "--mutex" + "network")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +40,8 @@ tasks {
|
||||
group = "build"
|
||||
|
||||
dependsOn("yarn")
|
||||
setWorkingDir(projectDir)
|
||||
args = listOf("build")
|
||||
workingDir.set(projectDir)
|
||||
args.set(listOf("build"))
|
||||
|
||||
inputs.dir("src")
|
||||
inputs.files(
|
||||
|
||||
Reference in New Issue
Block a user