Wizard: allow specifying Kotlin target version for JPS build system

#KT-37970 fixed
This commit is contained in:
Ilya Kirillov
2020-04-06 20:40:42 +03:00
parent 82a40e3394
commit a6af27d852
6 changed files with 68 additions and 10 deletions
@@ -1,5 +1,6 @@
package org.jetbrains.kotlin.tools.projectWizard.core.service
import org.jetbrains.kotlin.tools.projectWizard.core.Reader
import org.jetbrains.kotlin.tools.projectWizard.core.TaskResult
import org.jetbrains.kotlin.tools.projectWizard.core.UNIT_SUCCESS
import org.jetbrains.kotlin.tools.projectWizard.ir.buildsystem.ModuleIR
@@ -8,6 +9,7 @@ import java.nio.file.Path
interface ProjectImportingWizardService : BuildSystemWizardService {
fun importProject(
reader: Reader,
path: Path,
modulesIrs: List<ModuleIR>,
buildSystem: BuildSystemType
@@ -17,6 +19,7 @@ interface ProjectImportingWizardService : BuildSystemWizardService {
class ProjectImportingWizardServiceImpl : ProjectImportingWizardService, IdeaIndependentWizardService {
override fun isSuitableFor(buildSystemType: BuildSystemType): Boolean = true
override fun importProject(
reader: Reader,
path: Path,
modulesIrs: List<ModuleIR>,
buildSystem: BuildSystemType
@@ -100,7 +100,7 @@ abstract class BuildSystemPlugin(context: Context) : Plugin(context) {
withAction {
val data = BuildSystemPlugin::buildSystemData.propertyValue.first { it.type == buildSystemType }
service<ProjectImportingWizardService> { service -> service.isSuitableFor(data.type) }
.importProject(StructurePlugin::projectPath.reference.settingValue, allIRModules, buildSystemType)
.importProject(this, StructurePlugin::projectPath.reference.settingValue, allIRModules, buildSystemType)
}
}