Wizard: Move module templates to modules: separate SourcetModuleIR to MultiplatformModuleIR & SourcesetIR
This commit is contained in:
+3
-5
@@ -5,14 +5,12 @@ import org.jetbrains.kotlin.tools.projectWizard.core.safeAs
|
|||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.*
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.*
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.DefaultTargetConfigurationIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.DefaultTargetConfigurationIR
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.TargetConfigurationIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.TargetConfigurationIR
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.TargetIR
|
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleSubType
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleSubType
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.BuildFilePrinter
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.BuildFilePrinter
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.GradlePrinter
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.GradlePrinter
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.MavenPrinter
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.MavenPrinter
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.DefaultRepository
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.DefaultRepository
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
import javax.xml.transform.Source
|
|
||||||
|
|
||||||
data class BuildFileIR(
|
data class BuildFileIR(
|
||||||
val name: String,
|
val name: String,
|
||||||
@@ -110,7 +108,7 @@ val BuildFileIR.sourcesets
|
|||||||
get() = modules.modules.flatMap { module ->
|
get() = modules.modules.flatMap { module ->
|
||||||
when (module) {
|
when (module) {
|
||||||
is SingleplatformModuleIR -> module.sourcesets
|
is SingleplatformModuleIR -> module.sourcesets
|
||||||
is SourcesetModuleIR -> listOf(module as SourcesetIR)
|
is MultiplatformModuleIR -> listOf(module as SourcesetIR)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,11 +127,11 @@ sealed class ModulesStructureIR : BuildSystemIR, IrsOwner {
|
|||||||
|
|
||||||
data class MultiplatformModulesStructureIR(
|
data class MultiplatformModulesStructureIR(
|
||||||
val targets: List<BuildSystemIR>,
|
val targets: List<BuildSystemIR>,
|
||||||
override val modules: List<SourcesetModuleIR>,
|
override val modules: List<MultiplatformModuleIR>,
|
||||||
override val irs: List<BuildSystemIR>
|
override val irs: List<BuildSystemIR>
|
||||||
) : GradleIR, ModulesStructureIR() {
|
) : GradleIR, ModulesStructureIR() {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
override fun withModules(modules: List<ModuleIR>) = copy(modules = modules as List<SourcesetModuleIR>)
|
override fun withModules(modules: List<ModuleIR>) = copy(modules = modules as List<MultiplatformModuleIR>)
|
||||||
|
|
||||||
override fun withReplacedIrs(irs: List<BuildSystemIR>): MultiplatformModulesStructureIR = copy(irs = irs)
|
override fun withReplacedIrs(irs: List<BuildSystemIR>): MultiplatformModulesStructureIR = copy(irs = irs)
|
||||||
|
|
||||||
|
|||||||
+9
-37
@@ -17,15 +17,10 @@ sealed class ModuleIR : IrsOwner, BuildSystemIR {
|
|||||||
abstract val template: Template?
|
abstract val template: Template?
|
||||||
abstract val type: ModuleType
|
abstract val type: ModuleType
|
||||||
abstract val originalModule: Module
|
abstract val originalModule: Module
|
||||||
|
abstract val sourcesets: List<SourcesetIR>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface SourcesetIR : BuildSystemIR {
|
|
||||||
val sourcesetType: SourcesetType
|
|
||||||
val path: Path
|
|
||||||
val original: Sourceset
|
|
||||||
}
|
|
||||||
|
|
||||||
data class SingleplatformModuleIR(
|
data class SingleplatformModuleIR(
|
||||||
override val name: String,
|
override val name: String,
|
||||||
override val path: Path,
|
override val path: Path,
|
||||||
@@ -33,7 +28,7 @@ data class SingleplatformModuleIR(
|
|||||||
override val template: Template?,
|
override val template: Template?,
|
||||||
override val type: ModuleType,
|
override val type: ModuleType,
|
||||||
override val originalModule: Module,
|
override val originalModule: Module,
|
||||||
val sourcesets: List<SingleplatformSourcesetIR>
|
override val sourcesets: List<SingleplatformSourcesetIR>
|
||||||
) : ModuleIR() {
|
) : ModuleIR() {
|
||||||
override fun withReplacedIrs(irs: List<BuildSystemIR>): SingleplatformModuleIR = copy(irs = irs)
|
override fun withReplacedIrs(irs: List<BuildSystemIR>): SingleplatformModuleIR = copy(irs = irs)
|
||||||
|
|
||||||
@@ -51,42 +46,19 @@ data class SingleplatformModuleIR(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data class SingleplatformSourcesetIR(
|
|
||||||
override val sourcesetType: SourcesetType,
|
|
||||||
override val path: Path,
|
|
||||||
override val irs: List<BuildSystemIR>,
|
|
||||||
override val original: Sourceset
|
|
||||||
) : SourcesetIR, IrsOwner {
|
|
||||||
override fun withReplacedIrs(irs: List<BuildSystemIR>): SingleplatformSourcesetIR = copy(irs = irs)
|
|
||||||
override fun BuildFilePrinter.render() = Unit
|
|
||||||
}
|
|
||||||
|
|
||||||
data class SourcesetModuleIR(
|
data class MultiplatformModuleIR(
|
||||||
override val name: String,
|
override val name: String,
|
||||||
override val path: Path,
|
override val path: Path,
|
||||||
override val irs: List<BuildSystemIR>,
|
override val irs: List<BuildSystemIR>,
|
||||||
override val type: ModuleType,
|
override val type: ModuleType,
|
||||||
override val sourcesetType: SourcesetType,
|
|
||||||
override val template: Template?,
|
override val template: Template?,
|
||||||
override val originalModule: Module,
|
override val originalModule: Module,
|
||||||
override val original: Sourceset
|
override val sourcesets: List<MultiplatformSourcesetIR>
|
||||||
) : SourcesetIR, GradleIR, ModuleIR() {
|
) : GradleIR, ModuleIR() {
|
||||||
override fun withReplacedIrs(irs: List<BuildSystemIR>): SourcesetModuleIR = copy(irs = irs)
|
override fun withReplacedIrs(irs: List<BuildSystemIR>): MultiplatformModuleIR = copy(irs = irs)
|
||||||
|
|
||||||
override fun GradlePrinter.renderGradle() = getting(name, prefix = null) {
|
override fun GradlePrinter.renderGradle() {
|
||||||
val dependencies = irsOfType<DependencyIR>()
|
sourcesets.listNl(needFirstIndent = false)
|
||||||
val needBody = dependencies.isNotEmpty() || dsl == GradlePrinter.GradleDsl.GROOVY
|
|
||||||
if (needBody) {
|
|
||||||
+" "
|
|
||||||
inBrackets {
|
|
||||||
if (dependencies.isNotEmpty()) {
|
|
||||||
indent()
|
|
||||||
sectionCall("dependencies", dependencies)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val SourcesetModuleIR.targetName
|
|
||||||
get() = name.removeSuffix(sourcesetType.name.capitalize())
|
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.GradleIR
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.BuildFilePrinter
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.printer.GradlePrinter
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Sourceset
|
||||||
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.SourcesetType
|
||||||
|
import java.nio.file.Path
|
||||||
|
|
||||||
|
|
||||||
|
sealed class SourcesetIR : BuildSystemIR {
|
||||||
|
abstract val sourcesetType: SourcesetType
|
||||||
|
abstract val path: Path
|
||||||
|
abstract val original: Sourceset
|
||||||
|
}
|
||||||
|
|
||||||
|
data class SingleplatformSourcesetIR(
|
||||||
|
override val sourcesetType: SourcesetType,
|
||||||
|
override val path: Path,
|
||||||
|
override val irs: List<BuildSystemIR>,
|
||||||
|
override val original: Sourceset
|
||||||
|
) : SourcesetIR(), IrsOwner {
|
||||||
|
override fun withReplacedIrs(irs: List<BuildSystemIR>): SingleplatformSourcesetIR = copy(irs = irs)
|
||||||
|
override fun BuildFilePrinter.render() = Unit
|
||||||
|
}
|
||||||
|
|
||||||
|
data class MultiplatformSourcesetIR(
|
||||||
|
override val sourcesetType: SourcesetType,
|
||||||
|
override val path: Path,
|
||||||
|
val targetName: String,
|
||||||
|
override val irs: List<BuildSystemIR>,
|
||||||
|
override val original: Sourceset
|
||||||
|
) : SourcesetIR(), IrsOwner, GradleIR {
|
||||||
|
override fun withReplacedIrs(irs: List<BuildSystemIR>): MultiplatformSourcesetIR = copy(irs = irs)
|
||||||
|
|
||||||
|
override fun GradlePrinter.renderGradle() = getting(sourcesetName, prefix = null) {
|
||||||
|
val dependencies = irsOfType<DependencyIR>()
|
||||||
|
val needBody = dependencies.isNotEmpty() || dsl == GradlePrinter.GradleDsl.GROOVY
|
||||||
|
if (needBody) {
|
||||||
|
+" "
|
||||||
|
inBrackets {
|
||||||
|
if (dependencies.isNotEmpty()) {
|
||||||
|
indent()
|
||||||
|
sectionCall("dependencies", dependencies)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val MultiplatformSourcesetIR.sourcesetName
|
||||||
|
get() = targetName + sourcesetType.name.capitalize()
|
||||||
+2
-7
@@ -68,13 +68,8 @@ class KotlinPlugin(context: Context) : Plugin(context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forEachModule { moduleIR ->
|
forEachModule { moduleIR ->
|
||||||
when (moduleIR) {
|
moduleIR.sourcesets.mapSequenceIgnore { sourcesetIR ->
|
||||||
is SingleplatformModuleIR -> moduleIR.sourcesets.mapSequenceIgnore { sourcesetIR ->
|
sourcesetIR.path.createKotlinAndResourceDirectories()
|
||||||
sourcesetIR.path.createKotlinAndResourceDirectories()
|
|
||||||
}
|
|
||||||
is SourcesetModuleIR -> {
|
|
||||||
moduleIR.path.createKotlinAndResourceDirectories()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-11
@@ -160,7 +160,7 @@ class ModulesToIRsConverter(
|
|||||||
(subModule.configurator as TargetConfigurator).createTargetIrs(subModule)
|
(subModule.configurator as TargetConfigurator).createTargetIrs(subModule)
|
||||||
}
|
}
|
||||||
|
|
||||||
val sourcesetsIrs = module.subModules.flatMap { target ->
|
val targetModuleIrs = module.subModules.map { target ->
|
||||||
createTargetSourceset(target, modulePath)
|
createTargetSourceset(target, modulePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ class ModulesToIRsConverter(
|
|||||||
modulePath,
|
modulePath,
|
||||||
MultiplatformModulesStructureIR(
|
MultiplatformModulesStructureIR(
|
||||||
targetIrs,
|
targetIrs,
|
||||||
sourcesetsIrs,
|
targetModuleIrs,
|
||||||
emptyList()
|
emptyList()
|
||||||
),
|
),
|
||||||
pomIr,
|
pomIr,
|
||||||
@@ -180,8 +180,8 @@ class ModulesToIRsConverter(
|
|||||||
).asSingletonList().asSuccess()
|
).asSingletonList().asSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createTargetSourceset(target: Module, modulePath: Path): List<SourcesetModuleIR> =
|
private fun createTargetSourceset(target: Module, modulePath: Path): MultiplatformModuleIR {
|
||||||
target.sourcesets.map { sourceset ->
|
val sourcesetss = target.sourcesets.map { sourceset ->
|
||||||
val sourcesetName = target.name + sourceset.sourcesetType.name.capitalize()
|
val sourcesetName = target.name + sourceset.sourcesetType.name.capitalize()
|
||||||
val sourcesetIrs = buildList<BuildSystemIR> {
|
val sourcesetIrs = buildList<BuildSystemIR> {
|
||||||
+sourceset.dependencies.map { it.toIR(sourceset.sourcesetType.toDependencyType()) }
|
+sourceset.dependencies.map { it.toIR(sourceset.sourcesetType.toDependencyType()) }
|
||||||
@@ -198,17 +198,24 @@ class ModulesToIRsConverter(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SourcesetModuleIR(
|
MultiplatformSourcesetIR(
|
||||||
sourcesetName,
|
|
||||||
modulePath / Defaults.SRC_DIR / sourcesetName,
|
|
||||||
sourcesetIrs,
|
|
||||||
sourceset.containingModuleType,
|
|
||||||
sourceset.sourcesetType,
|
sourceset.sourcesetType,
|
||||||
target.template,
|
modulePath / Defaults.SRC_DIR / sourcesetName,
|
||||||
target,
|
target.name,
|
||||||
|
sourcesetIrs,
|
||||||
sourceset
|
sourceset
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
return MultiplatformModuleIR(
|
||||||
|
target.name,
|
||||||
|
modulePath,
|
||||||
|
emptyList(),
|
||||||
|
target.configurator.moduleType,
|
||||||
|
target.template,
|
||||||
|
target,
|
||||||
|
sourcesetss
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
private fun TaskRunningContext.mutateProjectStructureByModuleConfigurator(
|
private fun TaskRunningContext.mutateProjectStructureByModuleConfigurator(
|
||||||
module: Module,
|
module: Module,
|
||||||
|
|||||||
+2
-2
@@ -52,8 +52,8 @@ abstract class BuildFilePrinter {
|
|||||||
suffix()
|
suffix()
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun <T : BuildSystemIR> List<T>.listNl() {
|
open fun <T : BuildSystemIR> List<T>.listNl(needFirstIndent: Boolean = true) {
|
||||||
indent()
|
if (needFirstIndent) indent()
|
||||||
list(separator = { nl(); indent() }) { it.render(this) }
|
list(separator = { nl(); indent() }) { it.render(this) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -36,7 +36,7 @@ MavenPrinter(override val indent: Int = 4) : BuildFilePrinter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We already have line break after node
|
// We already have line break after node
|
||||||
override fun <T : BuildSystemIR> List<T>.listNl() {
|
override fun <T : BuildSystemIR> List<T>.listNl(needFirstIndent: Boolean) {
|
||||||
list(separator = { +"" }) { it.render(this) }
|
list(separator = { +"" }) { it.render(this) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-9
@@ -112,8 +112,8 @@ class TemplatesPlugin(context: Context) : Plugin(context) {
|
|||||||
val template = module.template ?: return UNIT_SUCCESS
|
val template = module.template ?: return UNIT_SUCCESS
|
||||||
val settings = with(template) { settingsAsMap(module.originalModule) }
|
val settings = with(template) { settingsAsMap(module.originalModule) }
|
||||||
val allSettings = settings + interceptionPointSettings.mapKeys { it.key.name }
|
val allSettings = settings + interceptionPointSettings.mapKeys { it.key.name }
|
||||||
return with(template) { getFileTemplates(module) }.mapNotNull { (fileTemplateDescriptor, filePath) ->
|
return with(template) { getFileTemplates(module) }.map { (fileTemplateDescriptor, filePath) ->
|
||||||
val path = generatePathForFileTemplate(module, filePath) ?: return@mapNotNull null
|
val path = generatePathForFileTemplate(module, filePath)
|
||||||
val fileTemplate = FileTemplate(
|
val fileTemplate = FileTemplate(
|
||||||
fileTemplateDescriptor,
|
fileTemplateDescriptor,
|
||||||
module.path / path,
|
module.path / path,
|
||||||
@@ -131,13 +131,12 @@ class TemplatesPlugin(context: Context) : Plugin(context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is SourcesetModuleIR -> {
|
is MultiplatformModuleIR -> {
|
||||||
if (filePath.sourcesetType == module.sourcesetType) {
|
val directory = when (filePath) {
|
||||||
when (filePath) {
|
is SrcFilePath -> KOTLIN_DIR
|
||||||
is SrcFilePath -> KOTLIN_DIR
|
is ResourcesFilePath -> RESOURCES_DIR
|
||||||
is ResourcesFilePath -> RESOURCES_DIR
|
}
|
||||||
}
|
SRC_DIR / "${module.name}${filePath.sourcesetType.name.capitalize()}" / directory
|
||||||
} else null
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-1
@@ -9,7 +9,6 @@ import org.jetbrains.kotlin.tools.projectWizard.core.TaskRunningContext
|
|||||||
import org.jetbrains.kotlin.tools.projectWizard.core.asPath
|
import org.jetbrains.kotlin.tools.projectWizard.core.asPath
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.core.buildList
|
import org.jetbrains.kotlin.tools.projectWizard.core.buildList
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.ModuleIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.ModuleIR
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.SourcesetIR
|
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.NativeTargetInternalIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.NativeTargetInternalIR
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.TargetConfigurationIR
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.gradle.multiplatform.TargetConfigurationIR
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.withIrs
|
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.withIrs
|
||||||
|
|||||||
+2
-3
@@ -18,7 +18,6 @@ import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleSubType
|
|||||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleType
|
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleType
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.DefaultRepository
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.DefaultRepository
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Sourceset
|
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.SourcesetType
|
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.SourcesetType
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.settings.version.Version
|
import org.jetbrains.kotlin.tools.projectWizard.settings.version.Version
|
||||||
import org.jetbrains.kotlin.tools.projectWizard.transformers.interceptors.TemplateInterceptor
|
import org.jetbrains.kotlin.tools.projectWizard.transformers.interceptors.TemplateInterceptor
|
||||||
@@ -83,7 +82,7 @@ class SimpleJsClientTemplate : Template() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transformBuildFile { buildFileIR ->
|
transformBuildFile { buildFileIR ->
|
||||||
val jsSourcesetName = module.safeAs<SourcesetModuleIR>()?.targetName ?: return@transformBuildFile null
|
val jsSourcesetName = module.safeAs<MultiplatformModuleIR>()?.name ?: return@transformBuildFile null
|
||||||
val jvmTarget = buildFileIR.targets.firstOrNull { target ->
|
val jvmTarget = buildFileIR.targets.firstOrNull { target ->
|
||||||
target.safeAs<DefaultTargetConfigurationIR>()?.targetAccess?.type == ModuleSubType.jvm
|
target.safeAs<DefaultTargetConfigurationIR>()?.targetAccess?.type == ModuleSubType.jvm
|
||||||
} as? DefaultTargetConfigurationIR ?: return@transformBuildFile null
|
} as? DefaultTargetConfigurationIR ?: return@transformBuildFile null
|
||||||
@@ -136,7 +135,7 @@ class SimpleJsClientTemplate : Template() {
|
|||||||
|
|
||||||
override fun TaskRunningContext.getIrsToAddToBuildFile(module: ModuleIR): List<BuildSystemIR> = buildList {
|
override fun TaskRunningContext.getIrsToAddToBuildFile(module: ModuleIR): List<BuildSystemIR> = buildList {
|
||||||
+RepositoryIR(DefaultRepository.JCENTER)
|
+RepositoryIR(DefaultRepository.JCENTER)
|
||||||
if (module is SourcesetModuleIR) {
|
if (module is MultiplatformModuleIR) {
|
||||||
+GradleImportIR("org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack")
|
+GradleImportIR("org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack")
|
||||||
val taskAccessIR = GradleByNameTaskAccessIR(
|
val taskAccessIR = GradleByNameTaskAccessIR(
|
||||||
"${module.name}BrowserWebpack",
|
"${module.name}BrowserWebpack",
|
||||||
|
|||||||
+1
-1
@@ -89,7 +89,7 @@ abstract class Template : SettingsOwner {
|
|||||||
val irsToAddToBuildFile = getIrsToAddToBuildFile(module)
|
val irsToAddToBuildFile = getIrsToAddToBuildFile(module)
|
||||||
|
|
||||||
val targetsUpdater = when (module) {
|
val targetsUpdater = when (module) {
|
||||||
is SourcesetModuleIR -> { target: TargetConfigurationIR ->
|
is MultiplatformModuleIR -> { target: TargetConfigurationIR ->
|
||||||
if (target.targetName == module.name) updateTargetIr(module, target)
|
if (target.targetName == module.name) updateTargetIr(module, target)
|
||||||
else target
|
else target
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user