[Gradle, JS] Add nodeArgs
This commit is contained in:
+7
-2
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -39,7 +39,12 @@ class DukatExecutor(
|
|||||||
|
|
||||||
args.addAll(dTsFiles.map { it.absolutePath })
|
args.addAll(dTsFiles.map { it.absolutePath })
|
||||||
|
|
||||||
compilation.npmProject.useTool(exec, "dukat/bin/dukat-cli.js", *args.toTypedArray())
|
compilation.npmProject.useTool(
|
||||||
|
exec,
|
||||||
|
"dukat/bin/dukat-cli.js",
|
||||||
|
listOf(),
|
||||||
|
args
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+7
-2
@@ -78,10 +78,15 @@ open class NpmProject(val compilation: KotlinJsCompilation) {
|
|||||||
private val rootNodeModules: NpmProjectModules?
|
private val rootNodeModules: NpmProjectModules?
|
||||||
get() = NpmProjectModules(nodeJs.rootPackageDir)
|
get() = NpmProjectModules(nodeJs.rootPackageDir)
|
||||||
|
|
||||||
fun useTool(exec: ExecSpec, tool: String, vararg args: String) {
|
fun useTool(
|
||||||
|
exec: ExecSpec,
|
||||||
|
tool: String,
|
||||||
|
nodeArgs: List<String> = listOf(),
|
||||||
|
args: List<String>
|
||||||
|
) {
|
||||||
exec.workingDir = dir
|
exec.workingDir = dir
|
||||||
exec.executable = nodeJs.requireConfigured().nodeExecutable
|
exec.executable = nodeJs.requireConfigured().nodeExecutable
|
||||||
exec.args = listOf(require(tool)) + args
|
exec.args = nodeArgs + require(tool) + args
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+4
@@ -126,6 +126,9 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
@Input
|
@Input
|
||||||
var args: MutableList<String> = mutableListOf()
|
var args: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
|
@Input
|
||||||
|
var nodeArgs: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
@Input
|
@Input
|
||||||
var sourceMaps: Boolean = true
|
var sourceMaps: Boolean = true
|
||||||
|
|
||||||
@@ -149,6 +152,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
execHandleFactory,
|
execHandleFactory,
|
||||||
bin,
|
bin,
|
||||||
args,
|
args,
|
||||||
|
nodeArgs,
|
||||||
KotlinWebpackConfig(
|
KotlinWebpackConfig(
|
||||||
mode = mode,
|
mode = mode,
|
||||||
entry = entry,
|
entry = entry,
|
||||||
|
|||||||
+7
-1
@@ -18,6 +18,7 @@ internal data class KotlinWebpackRunner(
|
|||||||
val execHandleFactory: ExecHandleFactory,
|
val execHandleFactory: ExecHandleFactory,
|
||||||
val tool: String,
|
val tool: String,
|
||||||
val args: List<String>,
|
val args: List<String>,
|
||||||
|
val nodeArgs: List<String>,
|
||||||
val config: KotlinWebpackConfig
|
val config: KotlinWebpackConfig
|
||||||
) {
|
) {
|
||||||
fun execute() = npmProject.project.execWithErrorLogger("webpack") {
|
fun execute() = npmProject.project.execWithErrorLogger("webpack") {
|
||||||
@@ -46,6 +47,11 @@ internal data class KotlinWebpackRunner(
|
|||||||
|
|
||||||
args.addAll(this.args)
|
args.addAll(this.args)
|
||||||
|
|
||||||
npmProject.useTool(execFactory, tool, *args.toTypedArray())
|
npmProject.useTool(
|
||||||
|
execFactory,
|
||||||
|
tool,
|
||||||
|
nodeArgs,
|
||||||
|
args
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user