[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:
@@ -1,5 +1,4 @@
|
||||
import com.moowork.gradle.node.NodeExtension
|
||||
import com.moowork.gradle.node.npm.NpmTask
|
||||
import com.github.gradle.node.npm.task.NpmTask
|
||||
import de.undercouch.gradle.tasks.download.Download
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
@@ -9,14 +8,15 @@ import org.jetbrains.kotlin.ideaExt.idea
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
id("com.github.node-gradle.node") version "2.2.0"
|
||||
id("com.github.node-gradle.node") version "3.0.1"
|
||||
id("de.undercouch.download")
|
||||
id("com.gradle.enterprise.test-distribution")
|
||||
}
|
||||
|
||||
node {
|
||||
download = true
|
||||
version = "10.16.2"
|
||||
download.set(true)
|
||||
version.set("10.16.2")
|
||||
nodeProjectDir.set(buildDir)
|
||||
}
|
||||
|
||||
val antLauncherJar by configurations.creating
|
||||
@@ -304,8 +304,6 @@ val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateJs
|
||||
dependsOn(":compiler:generateTestData")
|
||||
}
|
||||
|
||||
extensions.getByType(NodeExtension::class.java).nodeModulesDir = buildDir
|
||||
|
||||
val prepareMochaTestData by tasks.registering(Copy::class) {
|
||||
from(testDataDir) {
|
||||
include("package.json")
|
||||
@@ -316,30 +314,26 @@ val prepareMochaTestData by tasks.registering(Copy::class) {
|
||||
|
||||
val npmInstall by tasks.getting(NpmTask::class) {
|
||||
dependsOn(prepareMochaTestData)
|
||||
setWorkingDir(buildDir)
|
||||
workingDir.set(buildDir)
|
||||
}
|
||||
|
||||
val runMocha by task<NpmTask> {
|
||||
setWorkingDir(buildDir)
|
||||
workingDir.set(buildDir)
|
||||
|
||||
val target = if (project.hasProperty("teamcity")) "runOnTeamcity" else "test"
|
||||
setArgs(listOf("run", target))
|
||||
args.set(listOf("run", target))
|
||||
|
||||
setIgnoreExitValue(kotlinBuildProperties.ignoreTestFailures)
|
||||
ignoreExitValue.set(kotlinBuildProperties.ignoreTestFailures)
|
||||
|
||||
dependsOn(npmInstall, "test")
|
||||
|
||||
val check by tasks
|
||||
check.dependsOn(this)
|
||||
|
||||
doFirst {
|
||||
setEnvironment(
|
||||
mapOf(
|
||||
"KOTLIN_JS_LOCATION" to rootDir.resolve("dist/js/kotlin.js"),
|
||||
"KOTLIN_JS_TEST_LOCATION" to rootDir.resolve("dist/js/kotlin-test.js")
|
||||
)
|
||||
)
|
||||
}
|
||||
environment.set(mapOf(
|
||||
"KOTLIN_JS_LOCATION" to rootDir.resolve("dist/js/kotlin.js").toString(),
|
||||
"KOTLIN_JS_TEST_LOCATION" to rootDir.resolve("dist/js/kotlin-test.js").toString()
|
||||
))
|
||||
}
|
||||
|
||||
projectTest("wasmTest", true) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import com.moowork.gradle.node.npm.NpmTask
|
||||
import com.github.gradle.node.npm.task.NpmTask
|
||||
|
||||
plugins {
|
||||
id("com.github.node-gradle.node") version "2.2.0"
|
||||
id("com.github.node-gradle.node") version "3.0.1"
|
||||
base
|
||||
}
|
||||
|
||||
description = "Node utils"
|
||||
|
||||
node {
|
||||
download = true
|
||||
download.set(true)
|
||||
}
|
||||
|
||||
val deployDir = "$buildDir/deploy_to_npm"
|
||||
@@ -47,15 +47,15 @@ fun Project.createCopyLibraryFilesTask(libraryName: String, fromJar: String): Co
|
||||
fun Project.createPublishToNpmTask(templateName: String): NpmTask {
|
||||
return task<NpmTask>("publish-$templateName-to-npm") {
|
||||
val deployDir = File("$deployDir/$templateName")
|
||||
setWorkingDir(deployDir)
|
||||
workingDir.set(deployDir)
|
||||
|
||||
val deployArgs = listOf("publish", "--//registry.npmjs.org/:_authToken=$authToken", "--tag=$deployTag")
|
||||
if (dryRun == "true") {
|
||||
println("$deployDir \$ npm arguments: $deployArgs");
|
||||
setArgs(listOf("pack"))
|
||||
args.set(listOf("pack"))
|
||||
}
|
||||
else {
|
||||
setArgs(deployArgs)
|
||||
args.set(deployArgs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user