use new js gradle plugin and correct name of mpp plugin
This commit is contained in:
+8
-14
@@ -190,17 +190,17 @@ open class GradleKotlinJSFrameworkSupportProvider(
|
||||
) : GradleKotlinFrameworkSupportProvider(frameworkTypeId, displayName, KotlinIcons.JS) {
|
||||
|
||||
override fun getPluginId() = KotlinJsGradleModuleConfigurator.KOTLIN_JS
|
||||
override fun getPluginExpression() = "id 'kotlin2js'"
|
||||
override fun getPluginExpression() = "id 'org.jetbrains.kotlin.js'"
|
||||
|
||||
override fun getDependencies(sdk: Sdk?) = listOf(MAVEN_JS_STDLIB_ID)
|
||||
|
||||
override fun getTestDependencies() = listOf(MAVEN_JS_TEST_ID)
|
||||
|
||||
override fun updateSettingsScript(settingsBuilder: SettingsScriptBuilder, specifyPluginVersionIfNeeded: Boolean) {
|
||||
if (specifyPluginVersionIfNeeded) {
|
||||
settingsBuilder.addResolutionStrategy("kotlin2js")
|
||||
}
|
||||
}
|
||||
// override fun updateSettingsScript(settingsBuilder: SettingsScriptBuilder, specifyPluginVersionIfNeeded: Boolean) {
|
||||
// if (specifyPluginVersionIfNeeded) {
|
||||
// settingsBuilder.addResolutionStrategy("kotlin2js")
|
||||
// }
|
||||
// }
|
||||
|
||||
override fun getDescription() = "A Kotlin library or application targeting JavaScript"
|
||||
}
|
||||
@@ -208,18 +208,12 @@ open class GradleKotlinJSFrameworkSupportProvider(
|
||||
class GradleKotlinMPPFrameworkSupportProvider : GradleKotlinFrameworkSupportProvider(
|
||||
"KOTLIN_MPP", "Kotlin (Multiplatform - Experimental)", KotlinIcons.MPP
|
||||
) {
|
||||
override fun getPluginId() = "kotlin-multiplatform"
|
||||
override fun getPluginExpression() = "id 'kotlin-multiplatform'"
|
||||
override fun getPluginId() = "org.jetbrains.kotlin.multiplatform"
|
||||
override fun getPluginExpression() = "id 'org.jetbrains.kotlin.multiplatform'"
|
||||
|
||||
override fun getDependencies(sdk: Sdk?): List<String> = listOf()
|
||||
override fun getTestDependencies(): List<String> = listOf()
|
||||
|
||||
override fun updateSettingsScript(settingsBuilder: SettingsScriptBuilder, specifyPluginVersionIfNeeded: Boolean) {
|
||||
if (specifyPluginVersionIfNeeded) {
|
||||
settingsBuilder.addResolutionStrategy("kotlin-multiplatform")
|
||||
}
|
||||
}
|
||||
|
||||
override fun getDescription() = "Kotlin multiplatform code"
|
||||
}
|
||||
|
||||
|
||||
+1
-14
@@ -144,21 +144,8 @@ class KotlinDslGradleKotlinJSFrameworkSupportProvider :
|
||||
KotlinDslGradleKotlinFrameworkSupportProvider("KOTLIN_JS", "Kotlin/JS", KotlinIcons.JS) {
|
||||
|
||||
override fun getOldSyntaxPluginDefinition(): String = "plugin(\"${KotlinJsGradleModuleConfigurator.KOTLIN_JS}\")"
|
||||
override fun getPluginDefinition(): String = "id(\"kotlin2js\")"
|
||||
override fun getPluginDefinition(): String = "id(\"org.jetbrains.kotlin.js\")"
|
||||
|
||||
override fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
||||
"implementation(${getKotlinModuleDependencySnippet(MAVEN_JS_STDLIB_ID.removePrefix("kotlin-"), version)})"
|
||||
|
||||
override fun addSupport(
|
||||
projectId: ProjectId,
|
||||
module: Module,
|
||||
rootModel: ModifiableRootModel,
|
||||
modifiableModelsProvider: ModifiableModelsProvider,
|
||||
buildScriptData: BuildScriptDataBuilder
|
||||
) {
|
||||
super.addSupport(projectId, module, rootModel, modifiableModelsProvider, buildScriptData)
|
||||
updateSettingsScript(module) {
|
||||
it.addResolutionStrategy("kotlin2js")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -240,10 +240,7 @@ class KotlinGradleWebMultiplatformModuleBuilder : KotlinGradleAbstractMultiplatf
|
||||
js() {
|
||||
compilations.all {
|
||||
kotlinOptions {
|
||||
languageVersion = "1.3"
|
||||
moduleKind = "umd"
|
||||
sourceMap = true
|
||||
metaInfo = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user