Hi! I started getting deprecation warnings when us...
# ktor
v
Hi! I started getting deprecation warnings when using Ktor on random functions that are not themselves deprecated:
get(...) is deprecated. Experimental coroutines support will be dropped in 1.4
in the simpliest code like
Copy code
routing {
            get("/") {
                call.respondText("Hello World!", ContentType.Text.Plain)
            }
            get("/demo") {
                call.respondText("HELLO WORLD!")
            }
        }
How do I get rid of those?
c
You have old coroutines somewhere
Don't mix Kotlin 1.3 with old coroutines/ktor
v
@cy I use ktor 0.9.5 since it is the last release I see on github. Should I use another version?
c
0.9.5 works with Kotlin 1.2
You can try 1.0.0-alpha-1 with Kotlin 1.3.0-rc-131
v
Copy code
plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.3.0-rc-131'
    id 'application'
}

group 'kotlin.examples.ktor'
version '1.0-SNAPSHOT'

repositories {
    maven {     url '<http://dl.bintray.com/kotlin/kotlin-eap>' }
    mavenCentral()
    jcenter()
    maven { url "<https://dl.bintray.com/kotlin/ktor>" }
}

ext.ktor_version = '1.0.0-alpha-1'
ext.coroutines_version = '0.30.2'

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    compile "io.ktor:ktor-server-netty:1.0.0-alpha-1 "
    compile "ch.qos.logback:logback-classic:1.2.3"
//    compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:0.30.2'
//    compile 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:0.30.2'
}

sourceCompatibility = 1.8
compileKotlin { kotlinOptions.jvmTarget = "1.8" }
compileTestKotlin { kotlinOptions.jvmTarget = "1.8" }

//kotlin.experimental.coroutines "enable"
The config above does not work
I think I need to correct the versions of kotlin plugin, kotlin stdlib, coroutines, coroutines core and ktor
c
What error do you get?
coroutines should be
0.30.2-eap13
v
It can't resolve any Ktor package
c
You also need kotlinx repository
v
which one is it?
I read a migration guide somewhere, but the link to it is gone
c
This is because all these packages are beta/alpha/RC so not published to jcenter/central
v
it works now!
Copy code
plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.3.0-rc-131'
    id 'application'
}

group 'kotlin.examples.ktor'
version '1.0-SNAPSHOT'

repositories {
    maven {     url '<http://dl.bintray.com/kotlin/kotlin-eap>' }
    mavenCentral()
    jcenter()
    maven { url "<https://dl.bintray.com/kotlin/ktor>" }
}

ext.ktor_version = '1.0.0-alpha-1'
ext.coroutines_version = '0.30.2-eap13'

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    compile "io.ktor:ktor-server-netty:$ktor_version"
    compile "ch.qos.logback:logback-classic:1.2.3"
}

sourceCompatibility = 1.8
compileKotlin { kotlinOptions.jvmTarget = "1.8" }
compileTestKotlin { kotlinOptions.jvmTarget = "1.8" }
Note I didn't need a repo or a kotlinx artifact for some reason
Thanks for the help!
In general, the current situation with versions of various libraries is a mess. I understand that it is temporally untill kotlin is 1.3, but if you could provide clear compatibility mappings for all JB packages, that would be greatly appreciated
e
@Deactivated User
d
I’m in the process of updating the IJ plugin and website generator + updating the documentation
I have updated the generator website to support 1.0.0-alpha (the IJ plugin is submited but not published yet): https://ktor.io/quickstart/generator.html There you can create a valid Gradle and Gradle with Kotlin DSL project for 1.0.0-alpha
👍 1
🎉 1