Update Kotlin to 1.3.0

This commit is contained in:
Michael Bull 2018-11-01 11:03:47 +00:00
parent 722ddd7c1f
commit 7e45bfb7f2
2 changed files with 19 additions and 33 deletions

View File

@ -4,13 +4,14 @@ import groovy.lang.Closure
import org.gradle.api.internal.HasConvention import org.gradle.api.internal.HasConvention
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
description = "A Result monad for modelling success or failure operations." description = "A Result monad for modelling success or failure operations."
plugins { plugins {
`maven-publish` `maven-publish`
kotlin("jvm") version ("1.2.71") kotlin("jvm") version ("1.3.0")
id("org.jetbrains.dokka") version ("0.9.17") id("org.jetbrains.dokka") version ("0.9.17")
id("com.github.ben-manes.versions") version ("0.20.0") id("com.github.ben-manes.versions") version ("0.20.0")
id("com.jfrog.bintray") version ("1.8.4") id("com.jfrog.bintray") version ("1.8.4")
@ -21,11 +22,18 @@ allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
} }
plugins.withType<KotlinPluginWrapper> {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
} }
dependencies { dependencies {
implementation(kotlin("stdlib")) implementation(kotlin("stdlib"))
testImplementation("junit:junit:4.12") testImplementation("junit:junit:4.12")
testImplementation(kotlin("test-common")) testImplementation(kotlin("test-common"))
testImplementation(kotlin("test-annotations-common")) testImplementation(kotlin("test-annotations-common"))
@ -36,16 +44,11 @@ dependencies {
val SourceSet.kotlin: SourceDirectorySet val SourceSet.kotlin: SourceDirectorySet
get() = withConvention(KotlinSourceSet::class) { kotlin } get() = withConvention(KotlinSourceSet::class) { kotlin }
val compileKotlin by tasks.existing(KotlinCompile::class) val dokka by tasks.existing(DokkaTask::class) {
val compileTestKotlin by tasks.existing(KotlinCompile::class) kotlinTasks(closureOf<Any?> { emptyList() })
val dokka by tasks.existing(DokkaTask::class) sourceDirs = sourceSets["main"].kotlin.srcDirs
outputFormat = "javadoc"
compileKotlin { outputDirectory = "$buildDir/docs/javadoc"
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
} }
dokka { dokka {
@ -93,19 +96,13 @@ bintray {
}) })
} }
val build by tasks.existing val bintrayUpload by tasks.existing(BintrayUploadTask::class) {
val generatePomFileForMavenJavaPublication by tasks.existing(GenerateMavenPom::class) dependsOn("build")
val bintrayUpload by tasks.existing(BintrayUploadTask::class) dependsOn("generatePomFileForMavenJavaPublication")
bintrayUpload {
dependsOn(build)
dependsOn(generatePomFileForMavenJavaPublication)
dependsOn(sourcesJar) dependsOn(sourcesJar)
dependsOn(javadocJar) dependsOn(javadocJar)
} }
val afterReleaseBuild by tasks.existing tasks.named<Task>("afterReleaseBuild") {
afterReleaseBuild {
dependsOn(bintrayUpload) dependsOn(bintrayUpload)
} }

View File

@ -24,17 +24,6 @@ dependencies {
implementation("io.ktor:ktor-gson:${ext["ktorVersion"]}") implementation("io.ktor:ktor-gson:${ext["ktorVersion"]}")
} }
val compileKotlin by tasks.existing(KotlinCompile::class)
val compileTestKotlin by tasks.existing(KotlinCompile::class)
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
kotlin { kotlin {
experimental.coroutines = Coroutines.ENABLE experimental.coroutines = Coroutines.ENABLE
} }