加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 2.15 KB
一键复制 编辑 原始数据 按行查看 历史
Sam Stern 提交于 2021-01-27 13:10 . Use respectful terms (#1251)
buildscript {
repositories {
google()
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:perf-plugin:1.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.27.0'
}
allprojects {
repositories {
google()
//mavenLocal() must be listed at the top to facilitate testing
mavenLocal()
jcenter()
}
def isNonStable = { candidate ->
return ['alpha', 'beta', 'rc', 'snapshot', '-m'].any { word ->
return candidate.version.toLowerCase().contains(word)
}
}
def isBlocked = { candidate ->
def blocklist = [
'androidx.browser:browser',
'com.facebook.android',
'com.google.guava',
'com.github.bumptech.glide'
]
return blocklist.any { word ->
return candidate.toString().contains(word)
}
}
dependencyUpdates {
rejectVersionIf {
isNonStable(it.candidate) || isBlocked(it.candidate)
}
}
}
configurations {
ktlint
}
dependencies {
ktlint "com.github.shyiko:ktlint:0.31.0"
}
task("ktlint", type: JavaExec, group: "verification") {
def outputDir = "${project.buildDir}/reports/ktlint/"
def inputFiles = project.fileTree(dir: "src", include: "**/*.kt")
def outputFile = "${outputDir}ktlint-checkstyle-report.xml"
// See:
// https://medium.com/@vanniktech/making-your-gradle-tasks-incremental-7f26e4ef09c3
inputs.files(inputFiles)
outputs.dir(outputDir)
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.github.shyiko.ktlint.Main"
args = [
"--format",
"--android",
"--reporter=plain",
"--reporter=checkstyle,output=${outputFile}",
"**/*.kt",
]
}
task clean(type: Delete) {
delete rootProject.buildDir
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化