Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions ktor-swagger-root.gradle.kts → build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ buildscript {
}
plugins {
// https://github.com/diffplug/spotless/tree/master/plugin-gradle
id("com.diffplug.gradle.spotless") version "3.10.0"
id("com.jfrog.bintray") version "1.8.2"
id("com.diffplug.spotless") version "5.11.1"
id("com.jfrog.bintray") version "1.8.5"
jacoco
`maven-publish`
}
Expand All @@ -24,25 +24,24 @@ object Versions {
/**
* The version of KtLint to be used for linting the Kotlin and Kotlin Script files.
*/
const val KTLINT = "0.23.1"
const val KTLINT = "0.41.0"
}

allprojects {
apply {
plugin("com.diffplug.gradle.spotless")
plugin("com.diffplug.spotless")
}
group = "de.nielsfalk.ktor"
version = "0.7.0"
version = "0.8.0"

repositories {
mavenCentral()
jcenter()
maven { setUrl("https://dl.bintray.com/kotlin/ktor") }
}
}

fun DependencyHandler.ktor(name: String) =
create(group = "io.ktor", name = name, version = "1.3.2")
create(group = "io.ktor", name = name, version = "${property("ktor.version")}")

subprojects {
apply {
Expand Down Expand Up @@ -70,16 +69,6 @@ subprojects {
}
}

tasks.withType<Test> {
extensions.configure(typeOf<JacocoTaskExtension>()) {
/*
* Fix for Jacoco breaking Build Cache support.
* https://github.com/gradle/gradle/issues/5269
*/
isAppend = false
}
}

tasks.withType<JacocoReport> {
reports {
html.isEnabled = true
Expand Down Expand Up @@ -180,7 +169,7 @@ task("stage") {
}

tasks.withType<Wrapper>().configureEach {
gradleVersion = "5.1"
gradleVersion = "6.8.3"
distributionType = Wrapper.DistributionType.ALL
}

Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
kotlin.version=1.3.70
kotlin.version=1.4.31
ktor.version=1.5.2
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
17 changes: 17 additions & 0 deletions ktor-sample-swagger/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
plugins {
application
}

fun DependencyHandler.ktor(name: String) =
create(group = "io.ktor", name = name, version = "${property("ktor.version")}")

dependencies {
implementation(project(":ktor-swagger"))
implementation(ktor("ktor-server-netty"))
implementation(ktor("ktor-gson"))
implementation(group = "com.github.ajalt.clikt", name = "clikt", version = "3.1.0")
}

application {
mainClass.set("de.nielsfalk.ktor.swagger.sample.JsonApplicationKt")
}
19 changes: 0 additions & 19 deletions ktor-sample-swagger/ktor-sample-swagger.gradle.kts

This file was deleted.

File renamed without changes.
36 changes: 2 additions & 34 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
include ":ktor-swagger"
include ":ktor-sample-swagger"

rootProject.name = 'ktor-swagger-root'


/**
* This configures the gradle build so we can use non-standard build file names.
* Additionally, this project can support sub-projects who's build file is written in Kotlin.
*
* @param project The project to configure.
*/
def configureGradleBuild(ProjectDescriptor project) {
final String fileBaseName = project.name
final String projectBuildFileBaseName = fileBaseName
final File gradleBuild = new File(project.projectDir, "${projectBuildFileBaseName}.gradle")
final File kotlinBuild = new File(project.projectDir, "${projectBuildFileBaseName}.gradle.kts")
assert !(gradleBuild.exists() && kotlinBuild.exists()),
"Project ${project.name} can not have both a ${gradleBuild.name} and a ${kotlinBuild.name} file. " +
"Rename one so that the other can serve as the base for the project's build"
if (gradleBuild.exists()) {
project.buildFileName = "$gradleBuild.name"
} else if (kotlinBuild.exists()) {
project.buildFileName = "$kotlinBuild.name"
} else {
assert false,
"Project `${project.name}` must have a either a file " +
"containing ${gradleBuild.name} or ${kotlinBuild.name}"
}

// Any nested children projects also get configured.
project.children.each { configureGradleBuild(it) }
}

configureGradleBuild rootProject
include("ktor-swagger")
include("ktor-sample-swagger")