加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle.kts 1.63 KB
一键复制 编辑 原始数据 按行查看 历史
Nicola Corti 提交于 2020-04-05 16:50 . Detekt to 1.7.4 (#2)
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
id("com.android.application") version BuildPluginsVersion.AGP apply false
id("com.android.library") version BuildPluginsVersion.AGP apply false
kotlin("android") version BuildPluginsVersion.KOTLIN apply false
id("io.gitlab.arturbosch.detekt") version BuildPluginsVersion.DETEKT
id("org.jlleitschuh.gradle.ktlint") version BuildPluginsVersion.KTLINT
id("com.github.ben-manes.versions") version BuildPluginsVersion.VERSIONS_PLUGIN
}
allprojects {
group = PUBLISHING_GROUP
repositories {
google()
mavenCentral()
jcenter()
}
}
subprojects {
apply {
plugin("io.gitlab.arturbosch.detekt")
plugin("org.jlleitschuh.gradle.ktlint")
}
ktlint {
debug.set(false)
version.set(Versions.KTLINT)
verbose.set(true)
android.set(false)
outputToConsole.set(true)
ignoreFailures.set(false)
enableExperimentalRules.set(true)
filter {
exclude("**/generated/**")
include("**/kotlin/**")
}
}
detekt {
config = rootProject.files("config/detekt/detekt.yml")
reports {
html {
enabled = true
destination = file("build/reports/detekt.html")
}
}
}
}
tasks.register("clean", Delete::class.java) {
delete(rootProject.buildDir)
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version)
}
}
fun isNonStable(version: String) = "^[0-9,.v-]+(-r)?$".toRegex().matches(version).not()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化