Skip to content

Instantly share code, notes, and snippets.

@wangerekaharun
Created August 11, 2020 10:36
Show Gist options
  • Save wangerekaharun/3c1c9a0e13767065e38a75d65d959a83 to your computer and use it in GitHub Desktop.
Save wangerekaharun/3c1c9a0e13767065e38a75d65d959a83 to your computer and use it in GitHub Desktop.
Root project level gradle file with plugins block
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id(BuildPlugins.ktlintPlugin) version Versions.ktlint
id(BuildPlugins.detektPlugin) version Versions.detekt
id(BuildPlugins.androidLibrary) apply false
id(BuildPlugins.androidApplication) apply false
id(BuildPlugins.kotlinAndroid) apply false
id(BuildPlugins.kotlinAndroidExtensions) apply false
id(BuildPlugins.dokkaPlugin) version Versions.dokka
}
allprojects {
repositories {
google()
jcenter()
maven(url = "https://jitpack.io")
maven("https://dl.bintray.com/kotlin/kotlin-eap")
}
apply(plugin = BuildPlugins.dokkaPlugin)
apply(plugin = BuildPlugins.ktlintPlugin)
ktlint {
android.set(true)
verbose.set(true)
filter {
exclude { element -> element.file.path.contains("generated/") }
}
}
}
subprojects {
apply(plugin = BuildPlugins.detektPlugin)
detekt {
config = files("${project.rootDir}/detekt.yml")
parallel = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment