[Gradle, JS] Remove redundant build variants for IR
This commit is contained in:
-16
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.gradle.targets.js.ir
|
package org.jetbrains.kotlin.gradle.targets.js.ir
|
||||||
|
|
||||||
import org.gradle.api.NamedDomainObjectContainer
|
|
||||||
import org.gradle.api.Task
|
import org.gradle.api.Task
|
||||||
import org.gradle.api.plugins.BasePluginConvention
|
import org.gradle.api.plugins.BasePluginConvention
|
||||||
import org.gradle.api.tasks.Copy
|
import org.gradle.api.tasks.Copy
|
||||||
@@ -30,8 +29,6 @@ open class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
|||||||
private val commonRunConfigurations: MutableList<KotlinWebpack.() -> Unit> = mutableListOf()
|
private val commonRunConfigurations: MutableList<KotlinWebpack.() -> Unit> = mutableListOf()
|
||||||
private val distribution: Distribution = BrowserDistribution()
|
private val distribution: Distribution = BrowserDistribution()
|
||||||
|
|
||||||
private lateinit var buildVariants: NamedDomainObjectContainer<BuildVariant>
|
|
||||||
|
|
||||||
override val testTaskDescription: String
|
override val testTaskDescription: String
|
||||||
get() = "Run all ${target.name} tests inside browser using karma and webpack"
|
get() = "Run all ${target.name} tests inside browser using karma and webpack"
|
||||||
|
|
||||||
@@ -197,20 +194,7 @@ open class KotlinBrowserJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
|||||||
BuildVariantKind.DEVELOPMENT -> debugValue
|
BuildVariantKind.DEVELOPMENT -> debugValue
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun configureBuildVariants() {
|
|
||||||
buildVariants = project.container(BuildVariant::class.java)
|
|
||||||
buildVariants.create(PRODUCTION) {
|
|
||||||
it.kind = BuildVariantKind.PRODUCTION
|
|
||||||
}
|
|
||||||
buildVariants.create(DEVELOPMENT) {
|
|
||||||
it.kind = BuildVariantKind.DEVELOPMENT
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val PRODUCTION = "production"
|
|
||||||
const val DEVELOPMENT = "development"
|
|
||||||
|
|
||||||
private const val WEBPACK_TASK_NAME = "webpack"
|
private const val WEBPACK_TASK_NAME = "webpack"
|
||||||
private const val DISTRIBUTE_RESOURCES_TASK_NAME = "distributeResources"
|
private const val DISTRIBUTE_RESOURCES_TASK_NAME = "distributeResources"
|
||||||
private const val DISTRIBUTION_TASK_NAME = "distribution"
|
private const val DISTRIBUTION_TASK_NAME = "distribution"
|
||||||
|
|||||||
-3
@@ -39,7 +39,6 @@ abstract class KotlinJsIrSubTarget(
|
|||||||
internal fun configure() {
|
internal fun configure() {
|
||||||
NpmResolverPlugin.apply(project)
|
NpmResolverPlugin.apply(project)
|
||||||
|
|
||||||
configureBuildVariants()
|
|
||||||
configureTests()
|
configureTests()
|
||||||
|
|
||||||
target.compilations.all {
|
target.compilations.all {
|
||||||
@@ -63,8 +62,6 @@ abstract class KotlinJsIrSubTarget(
|
|||||||
protected fun disambiguateCamelCased(vararg names: String): String =
|
protected fun disambiguateCamelCased(vararg names: String): String =
|
||||||
lowerCamelCaseName(target.disambiguationClassifier, disambiguationClassifier, *names)
|
lowerCamelCaseName(target.disambiguationClassifier, disambiguationClassifier, *names)
|
||||||
|
|
||||||
abstract fun configureBuildVariants()
|
|
||||||
|
|
||||||
private fun configureTests() {
|
private fun configureTests() {
|
||||||
testRuns = project.container(KotlinJsPlatformTestRun::class.java) { name -> KotlinJsPlatformTestRun(name, target) }.also {
|
testRuns = project.container(KotlinJsPlatformTestRun::class.java) { name -> KotlinJsPlatformTestRun(name, target) }.also {
|
||||||
(this as ExtensionAware).extensions.add(this::testRuns.name, it)
|
(this as ExtensionAware).extensions.add(this::testRuns.name, it)
|
||||||
|
|||||||
-3
@@ -47,7 +47,4 @@ open class KotlinNodeJsIr @Inject constructor(target: KotlinJsIrTarget) :
|
|||||||
val assembleTask = project.tasks.getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME)
|
val assembleTask = project.tasks.getByName(LifecycleBasePlugin.ASSEMBLE_TASK_NAME)
|
||||||
assembleTask.dependsOn(productionExecutable.linkTask)
|
assembleTask.dependsOn(productionExecutable.linkTask)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun configureBuildVariants() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user