mp
10/09/2018, 4:16 PMmaven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }
- Specified the kotlin version on the stdlib dependency (instead of letting the 1.2.71 plugin set it)
- Specified kotlin-reflect
dependency to set matching version (transitive dependency from jackson-module-kotlin
)
- Changed imports for coroutine types
- Also in gradle, added languageVersion and apiVersion:
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.3"
apiVersion = "1.3"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.3"
apiVersion = "1.3"
}
}
With that, I get:
w: Language version 1.3 is experimental, there are no backwards compatibility guarantees for new language and library features
and
e: java.lang.IllegalStateException: Backend Internal error: Exception during code generation
Cause: Back-end (JVM) Internal error: Error type encountered: [ERROR : For SuccessOrFailure] (ErrorType).
Cause: Error type encountered: [ERROR : For SuccessOrFailure] (ErrorType).
File being compiled at position: (28,42) in /home/mbp/dev/.../Foo.kt
The root cause was thrown at: KotlinTypeMapper.java:114
File being compiled at position: file:///home/mbp/dev/.../Foo.kt
The root cause was thrown at: ExpressionCodegen.java:320
at org.jetbrains.kotlin.codegen.CompilationErrorHandler.lambda$static$0(CompilationErrorHandler.java:24)
at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generate(PackageCodegenImpl.java:74)
at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generatePackage(CodegenFactory.kt:97)
at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generateModule(CodegenFactory.kt:68)
at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.doGenerateFiles(KotlinCodegenFacade.java:47)
at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:39)
Am I missing a step?e5l
10/09/2018, 4:18 PMmp
10/09/2018, 4:18 PMe5l
10/09/2018, 4:19 PMkotlin-multiplatform
or kotlin-platform-*
?mp
10/09/2018, 4:19 PMe5l
10/09/2018, 4:20 PMmp
10/09/2018, 4:20 PMreturn withContext(ioDispatcher) {
where ioDispatcher
is a CoroutineDispatchere5l
10/09/2018, 4:20 PMmp
10/09/2018, 4:20 PMplugins {
id "org.jetbrains.kotlin.jvm" version "1.2.71" apply false
id "com.dorongold.task-tree" version "1.3"
id "com.github.ben-manes.versions" version "0.20.0" apply false
}
ext {
deps = [
ktor : '1.0.0-alpha-1',
kotlin : '1.3.0-rc-131',
postgresql: '42.2.5',
jackson : '2.9.7',
slf4j : '1.7.25',
junit : '5.3.1',
ahc : '2.5.4',
urlBuilder: '1.1.1',
jaxb : '2.3.0.1',
jaxbApi : '2.3.0',
activation: '1.2.0'
]
}
repositories {
jcenter()
}
subprojects {
apply plugin: "org.jetbrains.kotlin.jvm"
apply plugin: "com.github.ben-manes.versions"
repositories {
jcenter()
maven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$deps.kotlin"
testCompile "org.junit.jupiter:junit-jupiter-api:$deps.junit"
testImplementation "org.junit.jupiter:junit-jupiter-api:$deps.junit"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$deps.junit"
}
configurations.all {
// don't let commons logging creep into the classpath; use jcl-over-slf4j instead
exclude group: 'commons-logging', module: 'commons-logging'
}
test {
useJUnitPlatform()
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.3"
apiVersion = "1.3"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
languageVersion = "1.3"
apiVersion = "1.3"
}
}
}
mp
10/09/2018, 4:21 PMe5l
10/09/2018, 4:22 PMmp
10/09/2018, 4:22 PMmp
10/09/2018, 4:22 PMmp
10/09/2018, 4:23 PMimport org.flywaydb.gradle.task.FlywayCleanTask
import org.flywaydb.gradle.task.FlywayMigrateTask
buildscript {
dependencies {
classpath "org.postgresql:postgresql:$deps.postgresql"
// used by jooq gradle plugin to write config
classpath "com.sun.xml.bind:jaxb-impl:$deps.jaxb"
classpath "com.sun.xml.bind:jaxb-core:$deps.jaxb"
classpath "com.sun.activation:javax.activation:$deps.activation"
}
}
plugins {
id 'application'
id "org.flywaydb.flyway" version "5.2.0"
id "nu.studer.jooq" version "3.0.2"
}
repositories {
maven { url '<https://dl.bintray.com/kotlin/ktor>' }
maven { url = '<https://dl.bintray.com/michaelbull/maven>' }
}
dependencies {
compile "io.ktor:ktor-server-core:$deps.ktor"
compile "io.ktor:ktor-server-netty:$deps.ktor"
compile "io.ktor:ktor-jackson:$deps.ktor"
compile "io.ktor:ktor-server-sessions:$deps.ktor"
compile "io.ktor:ktor-auth:$deps.ktor"
compile "io.ktor:ktor-html-builder:$deps.ktor"
testCompile("io.ktor:ktor-server-test-host:$deps.ktor") {
// this depends on logback-classic, which ends up duplicated in IntelliJ's classpath.
// Gradle gets it right, but to avoid angry warnings in IntelliJ tests, we'll exclude it
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
compile "com.fasterxml.jackson.core:jackson-databind:$deps.jackson"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$deps.jackson"
compile "com.fasterxml.jackson.module:jackson-module-kotlin:$deps.jackson"
compile "com.fasterxml.jackson.dataformat:jackson-dataformat-csv:$deps.jackson"
runtime "ch.qos.logback:logback-classic:1.2.3"
runtime "org.slf4j:jcl-over-slf4j:$deps.slf4j"
compile "org.slf4j:jul-to-slf4j:$deps.slf4j"
compile 'com.google.inject:guice:4.2.1'
compile 'org.skife.config:config-magic:0.17'
compile 'commons-configuration:commons-configuration:1.10'
compile 'com.zaxxer:HikariCP:3.2.0'
compile 'org.jooq:jooq'
runtime "org.postgresql:postgresql:$deps.postgresql"
jooqRuntime "org.postgresql:postgresql:$deps.postgresql"
jooqRuntime "com.sun.xml.bind:jaxb-impl:$deps.jaxb"
jooqRuntime "com.sun.xml.bind:jaxb-core:$deps.jaxb"
jooqRuntime "javax.xml.bind:jaxb-api:$deps.jaxbApi"
jooqRuntime "com.sun.activation:javax.activation:$deps.activation"
compile 'com.google.guava:guava:26.0-jre'
testCompile 'com.h2database:h2:1.4.197'
compile 'io.lettuce:lettuce-core:5.1.0.RELEASE'
compile project(':authrocket-client')
compile 'com.auth0:java-jwt:3.4.0'
compile('com.sendgrid:sendgrid-java:4.2.1') {
// goddamnit sendgrid if you're going to make your own http client then at least don't screw up the dependencies
exclude module: 'mockito-core'
}
compile 'com.michael-bull.kotlin-result:kotlin-result:1.1.0'
compile 'org.mpierce.ktor.csrf:ktor-csrf:0.3.2'
compile 'com.lambdaworks:scrypt:1.4.0'
compile 'org.jetbrains.kotlinx:kotlinx-html-jvm:0.6.11'
compile 'com.google.cloud:google-cloud-storage:1.48.0'
compile 'com.google.cloud.sql:postgres-socket-factory:1.0.11'
// for its test helpers so we can test GCS with a local emulator
testCompile 'com.google.cloud:google-cloud-nio:0.65.0-alpha'
compile 'azadev.kotlin:aza-kotlin-css:1.0'
compile project(':trello-client')
}
mp
10/09/2018, 4:24 PMchristophsturm
10/09/2018, 4:27 PMmp
10/09/2018, 4:28 PMchristophsturm
10/09/2018, 4:30 PMmp
10/09/2018, 4:31 PMe5l
10/09/2018, 4:32 PMmaven { url '<https://dl.bintray.com/kotlin/kotlin-eap>' }
mp
10/09/2018, 4:34 PMDeactivated User
10/09/2018, 5:55 PM