Revert "Add Kotlin/MPP to Gradle group of New Project Wizards #KT-32105 Fixed"
This reverts commit 6b3117cc
This commit is contained in:
+3
-35
@@ -289,8 +289,8 @@ open class GradleKotlinJSNodeFrameworkSupportProvider(
|
|||||||
override fun getDescription() = "A Kotlin library or application targeting JavaScript for Node.js"
|
override fun getDescription() = "A Kotlin library or application targeting JavaScript for Node.js"
|
||||||
}
|
}
|
||||||
|
|
||||||
open class GradleKotlinMPPFrameworkSupportProvider : GradleKotlinFrameworkSupportProvider(
|
class GradleKotlinMPPFrameworkSupportProvider : GradleKotlinFrameworkSupportProvider(
|
||||||
"KOTLIN_MPP", "Kotlin/Multiplatform", KotlinIcons.MPP
|
"KOTLIN_MPP", "Kotlin (Multiplatform - Experimental)", KotlinIcons.MPP
|
||||||
) {
|
) {
|
||||||
override fun getPluginId() = "org.jetbrains.kotlin.multiplatform"
|
override fun getPluginId() = "org.jetbrains.kotlin.multiplatform"
|
||||||
override fun getPluginExpression() = "id 'org.jetbrains.kotlin.multiplatform'"
|
override fun getPluginExpression() = "id 'org.jetbrains.kotlin.multiplatform'"
|
||||||
@@ -298,38 +298,6 @@ open class GradleKotlinMPPFrameworkSupportProvider : GradleKotlinFrameworkSuppor
|
|||||||
override fun getDependencies(sdk: Sdk?): List<String> = listOf()
|
override fun getDependencies(sdk: Sdk?): List<String> = listOf()
|
||||||
override fun getTestDependencies(): List<String> = listOf()
|
override fun getTestDependencies(): List<String> = listOf()
|
||||||
|
|
||||||
override fun getDescription() =
|
override fun getDescription() = "Kotlin multiplatform code"
|
||||||
"For sharing code between platforms (JVM, JS, Android, iOS, etc.)"
|
|
||||||
|
|
||||||
override fun addSupport(
|
|
||||||
buildScriptData: BuildScriptDataBuilder,
|
|
||||||
module: Module,
|
|
||||||
sdk: Sdk?,
|
|
||||||
specifyPluginVersionIfNeeded: Boolean,
|
|
||||||
explicitPluginVersion: String?
|
|
||||||
) {
|
|
||||||
super.addSupport(buildScriptData, module, sdk, specifyPluginVersionIfNeeded, explicitPluginVersion)
|
|
||||||
|
|
||||||
buildScriptData.addOther(
|
|
||||||
"""kotlin {
|
|
||||||
/* Targets declarations omitted
|
|
||||||
* Documentation: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html */
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
commonMain {
|
|
||||||
dependencies {
|
|
||||||
implementation kotlin('stdlib-common')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
commonTest {
|
|
||||||
dependencies {
|
|
||||||
implementation kotlin('test-common')
|
|
||||||
implementation kotlin('test-annotations-common')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-50
@@ -80,6 +80,7 @@ abstract class KotlinDslGradleKotlinFrameworkSupportProvider(
|
|||||||
|
|
||||||
buildScriptData
|
buildScriptData
|
||||||
.addPluginDefinitionInPluginsGroup(getPluginDefinition() + " version \"$kotlinVersion\"")
|
.addPluginDefinitionInPluginsGroup(getPluginDefinition() + " version \"$kotlinVersion\"")
|
||||||
|
.addDependencyNotation(getRuntimeLibrary(rootModel, null))
|
||||||
} else {
|
} else {
|
||||||
if (additionalRepository != null) {
|
if (additionalRepository != null) {
|
||||||
val repository = additionalRepository.toKotlinRepositorySnippet()
|
val repository = additionalRepository.toKotlinRepositorySnippet()
|
||||||
@@ -94,6 +95,7 @@ abstract class KotlinDslGradleKotlinFrameworkSupportProvider(
|
|||||||
.addBuildscriptRepositoriesDefinition("mavenCentral()")
|
.addBuildscriptRepositoriesDefinition("mavenCentral()")
|
||||||
// TODO: in gradle > 4.1 this could be single declaration e.g. 'val kotlin_version: String by extra { "1.1.11" }'
|
// TODO: in gradle > 4.1 this could be single declaration e.g. 'val kotlin_version: String by extra { "1.1.11" }'
|
||||||
.addBuildscriptPropertyDefinition("var $GSK_KOTLIN_VERSION_PROPERTY_NAME: String by extra\n $GSK_KOTLIN_VERSION_PROPERTY_NAME = \"$kotlinVersion\"")
|
.addBuildscriptPropertyDefinition("var $GSK_KOTLIN_VERSION_PROPERTY_NAME: String by extra\n $GSK_KOTLIN_VERSION_PROPERTY_NAME = \"$kotlinVersion\"")
|
||||||
|
.addDependencyNotation(getRuntimeLibrary(rootModel, "\$$GSK_KOTLIN_VERSION_PROPERTY_NAME"))
|
||||||
.addBuildscriptDependencyNotation(getKotlinGradlePluginClassPathSnippet())
|
.addBuildscriptDependencyNotation(getKotlinGradlePluginClassPathSnippet())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,6 +112,8 @@ abstract class KotlinDslGradleKotlinFrameworkSupportProvider(
|
|||||||
|
|
||||||
private fun RepositoryDescription.toKotlinRepositorySnippet() = "maven { setUrl(\"$url\") }"
|
private fun RepositoryDescription.toKotlinRepositorySnippet() = "maven { setUrl(\"$url\") }"
|
||||||
|
|
||||||
|
protected abstract fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?): String
|
||||||
|
|
||||||
protected abstract fun getOldSyntaxPluginDefinition(): String
|
protected abstract fun getOldSyntaxPluginDefinition(): String
|
||||||
protected abstract fun getPluginDefinition(): String
|
protected abstract fun getPluginDefinition(): String
|
||||||
}
|
}
|
||||||
@@ -120,7 +124,7 @@ class KotlinDslGradleKotlinJavaFrameworkSupportProvider :
|
|||||||
override fun getOldSyntaxPluginDefinition() = "plugin(\"${KotlinGradleModuleConfigurator.KOTLIN}\")"
|
override fun getOldSyntaxPluginDefinition() = "plugin(\"${KotlinGradleModuleConfigurator.KOTLIN}\")"
|
||||||
override fun getPluginDefinition() = "kotlin(\"jvm\")"
|
override fun getPluginDefinition() = "kotlin(\"jvm\")"
|
||||||
|
|
||||||
private fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
override fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
||||||
"implementation(${getKotlinModuleDependencySnippet(getStdlibArtifactId(rootModel.sdk, bundledRuntimeVersion()), version)})"
|
"implementation(${getKotlinModuleDependencySnippet(getStdlibArtifactId(rootModel.sdk, bundledRuntimeVersion()), version)})"
|
||||||
|
|
||||||
override fun addSupport(
|
override fun addSupport(
|
||||||
@@ -137,11 +141,6 @@ class KotlinDslGradleKotlinJavaFrameworkSupportProvider :
|
|||||||
.addImport("import org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
.addImport("import org.jetbrains.kotlin.gradle.tasks.KotlinCompile")
|
||||||
.addOther("tasks.withType<KotlinCompile> {\n kotlinOptions.jvmTarget = \"1.8\"\n}\n")
|
.addOther("tasks.withType<KotlinCompile> {\n kotlinOptions.jvmTarget = \"1.8\"\n}\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildScriptData.gradleVersion >= MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX)
|
|
||||||
buildScriptData.addDependencyNotation(getRuntimeLibrary(rootModel, null))
|
|
||||||
else
|
|
||||||
buildScriptData.addDependencyNotation(getRuntimeLibrary(rootModel, "\$$GSK_KOTLIN_VERSION_PROPERTY_NAME"))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,17 +160,12 @@ abstract class AbstractKotlinDslGradleKotlinJSFrameworkSupportProvider(
|
|||||||
super.addSupport(projectId, module, rootModel, modifiableModelsProvider, buildScriptData)
|
super.addSupport(projectId, module, rootModel, modifiableModelsProvider, buildScriptData)
|
||||||
|
|
||||||
buildScriptData.addOther("kotlin.target.$jsSubTargetName { }")
|
buildScriptData.addOther("kotlin.target.$jsSubTargetName { }")
|
||||||
|
|
||||||
if (buildScriptData.gradleVersion >= MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX)
|
|
||||||
buildScriptData.addDependencyNotation(getRuntimeLibrary(rootModel, null))
|
|
||||||
else
|
|
||||||
buildScriptData.addDependencyNotation(getRuntimeLibrary(rootModel, "\$$GSK_KOTLIN_VERSION_PROPERTY_NAME"))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getOldSyntaxPluginDefinition(): String = "plugin(\"${KotlinJsGradleModuleConfigurator.KOTLIN_JS}\")"
|
override fun getOldSyntaxPluginDefinition(): String = "plugin(\"${KotlinJsGradleModuleConfigurator.KOTLIN_JS}\")"
|
||||||
override fun getPluginDefinition(): String = "id(\"org.jetbrains.kotlin.js\")"
|
override fun getPluginDefinition(): String = "id(\"org.jetbrains.kotlin.js\")"
|
||||||
|
|
||||||
private fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
override fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
||||||
"implementation(${getKotlinModuleDependencySnippet(MAVEN_JS_STDLIB_ID.removePrefix("kotlin-"), version)})"
|
"implementation(${getKotlinModuleDependencySnippet(MAVEN_JS_STDLIB_ID.removePrefix("kotlin-"), version)})"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,41 +180,3 @@ class KotlinDslGradleKotlinJSNodeFrameworkSupportProvider :
|
|||||||
override val jsSubTargetName: String
|
override val jsSubTargetName: String
|
||||||
get() = "nodejs"
|
get() = "nodejs"
|
||||||
}
|
}
|
||||||
|
|
||||||
class KotlinDslGradleKotlinMPPFrameworkSupportProvider :
|
|
||||||
KotlinDslGradleKotlinFrameworkSupportProvider("KOTLIN_MPP", "Kotlin/Multiplatform", KotlinIcons.MPP) {
|
|
||||||
|
|
||||||
override fun getOldSyntaxPluginDefinition() = "plugin(\"org.jetbrains.kotlin.multiplatform\")"
|
|
||||||
override fun getPluginDefinition() = "kotlin(\"multiplatform\")"
|
|
||||||
|
|
||||||
override fun addSupport(
|
|
||||||
projectId: ProjectId,
|
|
||||||
module: Module,
|
|
||||||
rootModel: ModifiableRootModel,
|
|
||||||
modifiableModelsProvider: ModifiableModelsProvider,
|
|
||||||
buildScriptData: BuildScriptDataBuilder
|
|
||||||
) {
|
|
||||||
super.addSupport(projectId, module, rootModel, modifiableModelsProvider, buildScriptData)
|
|
||||||
|
|
||||||
buildScriptData.addOther(
|
|
||||||
"""kotlin {
|
|
||||||
/* Targets declarations omitted
|
|
||||||
* Documentation: https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html */
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
val commonMain by getting {
|
|
||||||
dependencies {
|
|
||||||
implementation(kotlin("stdlib-common"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
val commonTest by getting {
|
|
||||||
dependencies {
|
|
||||||
implementation(kotlin("test-common"))
|
|
||||||
implementation(kotlin("test-annotations-common"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}"""
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinMPPFrameworkSupportProvider"/>
|
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSBrowserFrameworkSupportProvider"/>
|
||||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSNodeFrameworkSupportProvider"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user