Wizard: update ktor version

#KT-40037 fixed
This commit is contained in:
Ilya Kirillov
2020-07-08 11:14:43 +03:00
parent 44334fca11
commit 39601f99ab
4 changed files with 11 additions and 9 deletions
@@ -62,8 +62,8 @@ kotlin {
jvmMain {
dependencies {
implementation kotlin('stdlib-jdk8')
implementation 'io.ktor:ktor-server-netty:1.2.6'
implementation 'io.ktor:ktor-html-builder:1.2.6'
implementation 'io.ktor:ktor-server-netty:1.3.2-KOTLIN_VERSION'
implementation 'io.ktor:ktor-html-builder:1.3.2-KOTLIN_VERSION'
implementation 'org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.1-KOTLIN_VERSION'
}
}
@@ -62,8 +62,8 @@ kotlin {
val jvmMain by getting {
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("io.ktor:ktor-server-netty:1.2.6")
implementation("io.ktor:ktor-html-builder:1.2.6")
implementation("io.ktor:ktor-server-netty:1.3.2-KOTLIN_VERSION")
implementation("io.ktor:ktor-html-builder:1.3.2-KOTLIN_VERSION")
implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.1-KOTLIN_VERSION")
}
}
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.tools.projectWizard.settings.version.Version
object Versions {
val KOTLIN = version("1.4-M1") // used as fallback version
val GRADLE = version("6.3")
val KTOR = version("1.2.6")
val KTOR: (kotlinVersion: Version) -> Version = { kotlinVersion -> version("1.3.2-$kotlinVersion") }
object ANDROID {
val ANDROIDX_CORE_KTX = version("1.2.0")
@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.tools.projectWizard.WizardRunConfiguration
import org.jetbrains.kotlin.tools.projectWizard.core.Reader
import org.jetbrains.kotlin.tools.projectWizard.plugins.kotlin.KotlinPlugin
import org.jetbrains.kotlin.tools.projectWizard.settings.buildsystem.ModuleKind
import org.jetbrains.kotlin.tools.projectWizard.settings.version.Version
class KtorServerTemplate : Template() {
override val title: String = KotlinNewProjectWizardBundle.message("module.template.ktor.server.title")
@@ -40,9 +41,10 @@ class KtorServerTemplate : Template() {
override fun Writer.getRequiredLibraries(module: ModuleIR): List<DependencyIR> =
withSettingsOf(module.originalModule) {
val kotlinVersion = KotlinPlugin::version.propertyValue.version
buildList {
+ktorArtifactDependency(serverEngine.reference.settingValue.dependencyName)
+ktorArtifactDependency("ktor-html-builder")
+ktorArtifactDependency(serverEngine.reference.settingValue.dependencyName, kotlinVersion)
+ktorArtifactDependency("ktor-html-builder", kotlinVersion)
+ArtifactBasedLibraryDependencyIR(
MavenArtifact(Repositories.KOTLINX, "org.jetbrains.kotlinx", "kotlinx-html-jvm"),
Versions.KOTLINX.KOTLINX_HTML(KotlinPlugin::version.propertyValue.version),
@@ -81,9 +83,9 @@ class KtorServerTemplate : Template() {
override val settings: List<TemplateSetting<*, *>> = listOf(serverEngine)
}
private fun ktorArtifactDependency(@NonNls name: String) = ArtifactBasedLibraryDependencyIR(
private fun ktorArtifactDependency(@NonNls name: String, kotlinVersion: Version) = ArtifactBasedLibraryDependencyIR(
MavenArtifact(Repositories.KTOR_BINTRAY, "io.ktor", name),
Versions.KTOR,
Versions.KTOR(kotlinVersion),
DependencyType.MAIN
)