forked from firebase/quickstart-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
91 lines (79 loc) · 2.37 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
buildscript {
repositories {
google()
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.0'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0'
classpath 'com.google.gms:google-services:4.3.15'
classpath 'com.google.firebase:perf-plugin:1.4.2'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'androidx.navigation:navigation-safe-args-gradle-plugin:2.5.3'
}
}
plugins {
id 'com.github.ben-manes.versions' version '0.41.0'
}
allprojects {
repositories {
google()
//mavenLocal() must be listed at the top to facilitate testing
mavenLocal()
mavenCentral()
}
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.pinterest:ktlint:0.48.2") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
}
}
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
mainClass.set("com.pinterest.ktlint.Main")
args = [
"--format",
"--android",
"--reporter=plain",
"--reporter=checkstyle,output=${outputFile}",
"**/*.kt",
]
}
task clean(type: Delete) {
delete rootProject.buildDir
}