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
|
||||
|
||||
open class KotlinJsTest : KotlinTest(), RequiresNpmDependencies {
|
||||
@Internal
|
||||
@SkipWhenEmpty
|
||||
@get:Internal
|
||||
internal var testFramework: KotlinJsTestFramework? = null
|
||||
|
||||
val testFrameworkSettings: String
|
||||
@@ -52,7 +51,7 @@ open class KotlinJsTest : KotlinTest(), RequiresNpmDependencies {
|
||||
@Internal get() = listOf("./" + compilation.npmProject.main)
|
||||
|
||||
override val requiredNpmDependencies: Collection<RequiredKotlinJsDependency>
|
||||
get() = testFramework!!.requiredNpmDependencies
|
||||
@Internal get() = testFramework!!.requiredNpmDependencies
|
||||
|
||||
fun useNodeJs(body: KotlinNodeJsTestRunner.() -> Unit) = use(KotlinNodeJsTestRunner(compilation), body)
|
||||
fun useNodeJs(fn: Closure<*>) {
|
||||
|
||||
+20
-20
@@ -45,7 +45,7 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
||||
}
|
||||
|
||||
val entry: File
|
||||
get() = compilation.compileKotlinTask.outputFile
|
||||
@InputFile get() = compilation.compileKotlinTask.outputFile
|
||||
|
||||
open val configFile: File
|
||||
@OutputFile get() = compilation.npmProject.dir.resolve("webpack.config.js")
|
||||
@@ -78,25 +78,6 @@ open class KotlinWebpack : DefaultTask(), RequiresNpmDependencies {
|
||||
@Optional
|
||||
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(
|
||||
compilation.npmProject,
|
||||
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
|
||||
fun execute() {
|
||||
NpmResolver.checkRequiredDependencies(project, this)
|
||||
|
||||
Reference in New Issue
Block a user