Skip to content

Instantly share code, notes, and snippets.

@x80486
Last active April 29, 2020 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x80486/52d5b8f1d584f90732e7d1881df423a7 to your computer and use it in GitHub Desktop.
Save x80486/52d5b8f1d584f90732e7d1881df423a7 to your computer and use it in GitHub Desktop.
Kotlin DSL Multi-Project
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.github.johnrengelman.shadow").version("5.2.0").apply(false)
id("io.gitlab.arturbosch.detekt").version("1.8.0").apply(false)
id("org.gradle.eclipse")
id("org.gradle.idea")
id("org.jetbrains.kotlin.jvm").version("1.3.72").apply(false)
}
allprojects {
repositories {
jcenter()
}
}
subprojects {
apply(plugin = "io.gitlab.arturbosch.detekt") // ...disabling/enabling this makes no difference
group = "io.shido"
version = "0.1.2-SNAPSHOT"
dependencies {
// implementation(enforcedPlatform("io.ktor:ktor-bom:${properties["ktor.version"]}"))
}
detekt {
config = files("${project.rootDir}/config/detekt/detekt-ruleset.yml")
input = files("${project.rootDir}/project-whirlpool/", "${project.rootDir}/*.kts")
reports {
html {
destination = file("${rootProject.buildDir}/reports/detekt/detekt-report.html")
enabled = true
}
xml {
destination = file("${rootProject.buildDir}/reports/detekt/detekt-report.xml")
enabled = false
}
}
// toolVersion = "1.8.0"
}
tasks {
withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "${JavaVersion.VERSION_11}"
}
}
}
}
// ...filename is build.gradle.kts within that project, but Gists can't have duplicated file names
plugins {
id("com.github.johnrengelman.shadow")
id("io.gitlab.arturbosch.detekt")
id("org.gradle.application")
id("org.jetbrains.kotlin.jvm")
}
dependencies {
implementation(enforcedPlatform("io.ktor:ktor-bom:${properties["ktor.version"]}"))
implementation("ch.qos.logback:logback-classic:1.2.3")
implementation("io.ktor:ktor-html-builder")
implementation("io.ktor:ktor-server-netty")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
testImplementation("io.ktor:ktor-server-test-host")
testImplementation("org.assertj:assertj-core:3.15.0")
}
application {
mainClassName = "io.shido.ApplicationKt"
}
include("module-one")
rootProject.name = "project-whirlpool"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment