Gradle, js: don't use any subtarget by default
This commit is contained in:
-10
@@ -36,16 +36,12 @@ class KotlinJsTarget(project: Project, platformType: KotlinPlatformType) :
|
|||||||
val runTaskName get() = lowerCamelCaseName(disambiguationClassifier, runTaskNameSuffix)
|
val runTaskName get() = lowerCamelCaseName(disambiguationClassifier, runTaskNameSuffix)
|
||||||
val runTask get() = project.tasks.maybeCreate(runTaskName)
|
val runTask get() = project.tasks.maybeCreate(runTaskName)
|
||||||
|
|
||||||
private var hasSubtargets = false
|
|
||||||
|
|
||||||
val browser by lazy {
|
val browser by lazy {
|
||||||
hasSubtargets = true
|
|
||||||
KotlinBrowserJs(this).also {
|
KotlinBrowserJs(this).also {
|
||||||
it.configure()
|
it.configure()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val nodejs by lazy {
|
val nodejs by lazy {
|
||||||
hasSubtargets = true
|
|
||||||
KotlinNodeJs(this).also {
|
KotlinNodeJs(this).also {
|
||||||
it.configure()
|
it.configure()
|
||||||
}
|
}
|
||||||
@@ -58,10 +54,4 @@ class KotlinJsTarget(project: Project, platformType: KotlinPlatformType) :
|
|||||||
override fun nodejs(body: KotlinJsNodeDsl.() -> Unit) {
|
override fun nodejs(body: KotlinJsNodeDsl.() -> Unit) {
|
||||||
nodejs.body()
|
nodejs.body()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun configureDefaults() {
|
|
||||||
if (!hasSubtargets) {
|
|
||||||
browser()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
-1
@@ -19,7 +19,6 @@ open class KotlinJsTargetConfigurator(kotlinPluginVersion: String) :
|
|||||||
override fun configureTarget(target: KotlinOnlyTarget<KotlinJsCompilation>) {
|
override fun configureTarget(target: KotlinOnlyTarget<KotlinJsCompilation>) {
|
||||||
target as KotlinJsTarget
|
target as KotlinJsTarget
|
||||||
|
|
||||||
target.configureDefaults()
|
|
||||||
super.configureTarget(target)
|
super.configureTarget(target)
|
||||||
|
|
||||||
target.compilations.forEach {
|
target.compilations.forEach {
|
||||||
|
|||||||
Reference in New Issue
Block a user