Replace deprecated gradle configurations

This commit is contained in:
Michael Bull 2019-05-30 13:28:56 +01:00
parent 183ea9a234
commit 1e487d1468
2 changed files with 15 additions and 11 deletions

View File

@ -19,6 +19,7 @@ plugins {
allprojects { allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
jcenter()
} }
plugins.withType<KotlinPluginWrapper> { plugins.withType<KotlinPluginWrapper> {
@ -42,8 +43,8 @@ dependencies {
val SourceSet.kotlin: SourceDirectorySet val SourceSet.kotlin: SourceDirectorySet
get() = withConvention(KotlinSourceSet::class) { kotlin } get() = withConvention(KotlinSourceSet::class) { kotlin }
fun BintrayExtension.pkg(configure: BintrayExtension.PackageConfig.() -> Unit): Any? { fun BintrayExtension.pkg(configure: BintrayExtension.PackageConfig.() -> Unit) {
return pkg(closureOf(configure)) pkg(delegateClosureOf(configure))
} }
val dokka by tasks.existing(DokkaTask::class) { val dokka by tasks.existing(DokkaTask::class) {
@ -54,16 +55,16 @@ val dokka by tasks.existing(DokkaTask::class) {
} }
dokka { dokka {
kotlinTasks(closureOf<Any?> { emptyList() })
sourceDirs = sourceSets["main"].kotlin.srcDirs sourceDirs = sourceSets["main"].kotlin.srcDirs
outputFormat = "javadoc" outputFormat = "javadoc"
outputDirectory = "$buildDir/docs/javadoc" outputDirectory = "$buildDir/docs/javadoc"
kotlinTasks(::defaultKotlinTasks)
} }
val javadocJar by tasks.registering(Jar::class) { val javadocJar by tasks.registering(Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP group = LifecycleBasePlugin.BUILD_GROUP
description = "Assembles a jar archive containing the Javadoc API documentation." description = "Assembles a jar archive containing the Javadoc API documentation."
classifier = "javadoc" archiveClassifier.set("javadoc")
dependsOn(dokka) dependsOn(dokka)
from(dokka.get().outputDirectory) from(dokka.get().outputDirectory)
} }
@ -71,7 +72,7 @@ val javadocJar by tasks.registering(Jar::class) {
val sourcesJar by tasks.registering(Jar::class) { val sourcesJar by tasks.registering(Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP group = LifecycleBasePlugin.BUILD_GROUP
description = "Assembles a jar archive containing the main classes with sources." description = "Assembles a jar archive containing the main classes with sources."
classifier = "sources" archiveClassifier.set("sources")
from(sourceSets["main"].allSource) from(sourceSets["main"].allSource)
} }
@ -85,9 +86,12 @@ publishing {
} }
} }
val bintrayUser: String? by project
val bintrayKey: String? by project
bintray { bintray {
user = project.findProperty("bintrayUser")?.toString() ?: "" user = bintrayUser
key = project.findProperty("bintrayKey")?.toString() ?: "" key = bintrayKey
setPublications("mavenJava") setPublications("mavenJava")
pkg { pkg {
@ -105,6 +109,6 @@ val bintrayUpload by tasks.existing(BintrayUploadTask::class) {
dependsOn(javadocJar) dependsOn(javadocJar)
} }
tasks.named<Task>("afterReleaseBuild") { tasks.named("afterReleaseBuild") {
dependsOn(bintrayUpload) dependsOn(bintrayUpload)
} }

View File

@ -18,7 +18,7 @@ dependencies {
implementation(project(":")) implementation(project(":"))
implementation(kotlin("stdlib-jdk8")) implementation(kotlin("stdlib-jdk8"))
implementation("ch.qos.logback:logback-classic:1.2.3") implementation("ch.qos.logback:logback-classic:1.2.3")
implementation("io.ktor:ktor-server-core:${ktorVersion}") implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:${ktorVersion}") implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-gson:${ktorVersion}") implementation("io.ktor:ktor-gson:$ktorVersion")
} }