mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
KTIJ-18974 [New Project Wizard]: remove 'withJava' setting
Prior to this commit 'withJava' was an explicit setting applicable to project level. Some module templates (e.g. 'Web server') though couldn't be used without it and therefore set it implicitly under the hood. As a result, resulting Gradle script could differ from what the user selected. Not to confuse users 'withJava' is now automatically applied to all jvm modules/targets excluding those having 'Android' plugin configured. 'Android' and 'Java' plugins cannot to used together. ^KTIJ-18974 Fixed GitOrigin-RevId: 518d83dc0db1ebe79739e9397fdab6acc3f804f7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1c6948bac6
commit
43db6f1cf9
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnit()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnit()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = '9'
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnit()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = "9"
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnit()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = "11"
|
||||
}
|
||||
withJava()
|
||||
}
|
||||
sourceSets {
|
||||
val jvmMain by getting {
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = '1.8'
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ kotlin {
|
||||
compilations.all {
|
||||
kotlinOptions.jvmTarget = "1.8"
|
||||
}
|
||||
withJava()
|
||||
testRuns["test"].executionTask.configure {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
-2
@@ -89,8 +89,6 @@ module.configurator.common=Common
|
||||
module.configurator.jvm=JVM
|
||||
module.configurator.jvm.setting.target.jvm.version=Target JVM version
|
||||
module.configurator.jvm.setting.target.jvm.version.description= The version of the JVM bytecode that will be produced as the result of compiling this module
|
||||
module.configurator.jvm.setting.java.support=Java language support
|
||||
module.configurator.jvm.setting.java.support.description=Allows you to write Java code in the selected target.
|
||||
|
||||
module.configurator.mpp=Multiplatform
|
||||
module.configurator.ios=IOS
|
||||
|
||||
+4
-17
@@ -17,12 +17,9 @@ import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.JSConfigurat
|
||||
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.JsBrowserBasedConfigurator.Companion.browserSubTarget
|
||||
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.JsBrowserBasedConfigurator.Companion.cssSupport
|
||||
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.JsNodeBasedConfigurator.Companion.nodejsSubTarget
|
||||
import org.jetbrains.kotlin.tools.projectWizard.moduleConfigurators.JsNodeTargetConfigurator.createTargetIrs
|
||||
import org.jetbrains.kotlin.tools.projectWizard.phases.GenerationPhase
|
||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.buildSystemType
|
||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.buildSystem.isGradle
|
||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModuleSubType
|
||||
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.ModulesToIrConversionData
|
||||
import org.jetbrains.kotlin.tools.projectWizard.settings.DisplayableSettingItem
|
||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.Module
|
||||
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
|
||||
@@ -170,7 +167,7 @@ object JvmTargetConfigurator : JvmModuleConfigurator,
|
||||
}
|
||||
|
||||
}
|
||||
if (Settings.javaSupport.reference.settingValue) {
|
||||
if (!module.hasAndroidSibling()) {
|
||||
"withJava"()
|
||||
}
|
||||
}
|
||||
@@ -185,17 +182,7 @@ object JvmTargetConfigurator : JvmModuleConfigurator,
|
||||
}
|
||||
}
|
||||
|
||||
override fun getConfiguratorSettings(): List<ModuleConfiguratorSetting<*, *>> =
|
||||
super.getConfiguratorSettings() +
|
||||
Settings.javaSupport
|
||||
|
||||
object Settings : ModuleConfiguratorSettings() {
|
||||
val javaSupport by booleanSetting(
|
||||
KotlinNewProjectWizardBundle.message("module.configurator.jvm.setting.java.support"),
|
||||
GenerationPhase.PROJECT_GENERATION
|
||||
) {
|
||||
description = KotlinNewProjectWizardBundle.message("module.configurator.jvm.setting.java.support.description")
|
||||
defaultValue = value(false)
|
||||
}
|
||||
}
|
||||
private fun Module.hasAndroidSibling(): Boolean =
|
||||
configurator is TargetConfigurator
|
||||
&& parent?.subModules?.any { it.configurator is AndroidModuleConfigurator } ?: false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user