Gradle, js: fix task input annotations
This commit is contained in:
+2
-3
@@ -26,8 +26,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinTest
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
open class KotlinJsTest : KotlinTest(), RequiresNpmDependencies {
|
open class KotlinJsTest : KotlinTest(), RequiresNpmDependencies {
|
||||||
@Internal
|
@get:Internal
|
||||||
@SkipWhenEmpty
|
|
||||||
internal var testFramework: KotlinJsTestFramework? = null
|
internal var testFramework: KotlinJsTestFramework? = null
|
||||||
|
|
||||||
val testFrameworkSettings: String
|
val testFrameworkSettings: String
|
||||||
@@ -52,7 +51,7 @@ open class KotlinJsTest : KotlinTest(), RequiresNpmDependencies {
|
|||||||
@Internal get() = listOf("./" + compilation.npmProject.main)
|
@Internal get() = listOf("./" + compilation.npmProject.main)
|
||||||
|
|
||||||
override val requiredNpmDependencies: Collection<RequiredKotlinJsDependency>
|
override val requiredNpmDependencies: Collection<RequiredKotlinJsDependency>
|
||||||
get() = testFramework!!.requiredNpmDependencies
|
@Internal get() = testFramework!!.requiredNpmDependencies
|
||||||
|
|
||||||
fun useNodeJs(body: KotlinNodeJsTestRunner.() -> Unit) = use(KotlinNodeJsTestRunner(compilation), body)
|
fun useNodeJs(body: KotlinNodeJsTestRunner.() -> Unit) = use(KotlinNodeJsTestRunner(compilation), body)
|
||||||
fun useNodeJs(fn: Closure<*>) {
|
fun useNodeJs(fn: Closure<*>) {
|
||||||
|
|||||||
+20
-20
@@ -45,7 +45,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val entry: File
|
val entry: File
|
||||||
get() = compilation.compileKotlinTask.outputFile
|
@InputFile get() = compilation.compileKotlinTask.outputFile
|
||||||
|
|
||||||
open val configFile: File
|
open val configFile: File
|
||||||
@OutputFile get() = compilation.npmProject.dir.resolve("webpack.config.js")
|
@OutputFile get() = compilation.npmProject.dir.resolve("webpack.config.js")
|
||||||
@@ -78,25 +78,6 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
@Optional
|
@Optional
|
||||||
var devServer: KotlinWebpackConfigWriter.DevServer? = null
|
var devServer: KotlinWebpackConfigWriter.DevServer? = null
|
||||||
|
|
||||||
override val requiredNpmDependencies: Collection<NpmPackageVersion>
|
|
||||||
get() = mutableListOf<NpmPackageVersion>().also {
|
|
||||||
it.add(versions.webpack)
|
|
||||||
it.add(versions.webpackCli)
|
|
||||||
|
|
||||||
if (report) {
|
|
||||||
it.add(versions.webpackBundleAnalyzer)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sourceMaps) {
|
|
||||||
it.add(versions.sourceMapLoader)
|
|
||||||
it.add(versions.sourceMapSupport)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (devServer != null) {
|
|
||||||
it.add(versions.webpackDevServer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createRunner() = KotlinWebpackRunner(
|
private fun createRunner() = KotlinWebpackRunner(
|
||||||
compilation.npmProject,
|
compilation.npmProject,
|
||||||
configFile,
|
configFile,
|
||||||
@@ -114,6 +95,25 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
override val requiredNpmDependencies: Collection<NpmPackageVersion>
|
||||||
|
@Internal get() = mutableListOf<NpmPackageVersion>().also {
|
||||||
|
it.add(versions.webpack)
|
||||||
|
it.add(versions.webpackCli)
|
||||||
|
|
||||||
|
if (report) {
|
||||||
|
it.add(versions.webpackBundleAnalyzer)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sourceMaps) {
|
||||||
|
it.add(versions.sourceMapLoader)
|
||||||
|
it.add(versions.sourceMapSupport)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (devServer != null) {
|
||||||
|
it.add(versions.webpackDevServer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
fun execute() {
|
fun execute() {
|
||||||
NpmResolver.checkRequiredDependencies(project, this)
|
NpmResolver.checkRequiredDependencies(project, this)
|
||||||
|
|||||||
Reference in New Issue
Block a user