-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.gradle
122 lines (107 loc) · 3.64 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: "com.github.ben-manes.versions"
apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: "io.gitlab.arturbosch.detekt"
buildscript {
ext.kotlin_version = "1.4.32"
ext.build_tools_version = '7.0.0-alpha14'
ext.compose_version = '1.0.0-beta05'
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://plugins.gradle.org/m2/" }
google()
}
dependencies {
classpath "com.android.tools.build:gradle:$build_tools_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.github.ben-manes:gradle-versions-plugin:0.38.0"
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.0.0"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.16.0"
classpath "com.google.gms:google-services:4.3.5"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
ext {
androidMinSdkVersion = 21
androidTargetSdkVersion = 29
androidCompileSdkVersion = 29
appCompatVersion = "1.2.0"
lifecycleVersion = "2.3.1"
coroutinesVersion = "1.4.3"
architectureComponentsVersion = "2.1.0"
materialVersion = "1.3.0"
espressoVersion = "3.3.0"
constraintLayoutVersion = "2.0.4"
timberVersion = "4.7.1"
koinVersion = "2.2.2"
androidxArchVersion = "2.1.0"
androidxTestVersion = "1.3.0"
androidxJunitVersion = "1.1.2"
junitVersion = "4.13.2"
mockkVersion = "1.11.0"
truthVersion = "1.1.2"
androidxCoreVersion = "1.3.2"
turbineVersion = "0.4.1"
kielVersion = "1.2.1"
}
configurations.all {
resolutionStrategy {
force "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
}
}
}
subprojects {
apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: "io.gitlab.arturbosch.detekt"
ktlint {
ktlint.version = "0.40.0"
android = true
enableExperimentalRules = true
reporters {
reporter "plain"
reporter "checkstyle"
}
additionalEditorconfigFile = file("${project.projectDir}/.editorConfig")
outputColorName = "RED"
}
detekt {
config = files("${rootProject.projectDir}/config/detekt/detekt.yml")
reports {
txt.enabled = true
// similar to the console output, contains issue signature to manually edit baseline files
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
dependencyUpdates {
gradleReleaseChannel = "current"
rejectVersionIf {
isNonStable(it.candidate.version) && !isNonStable(it.currentVersion)
}
}
/**
* This is a special task that allows us to pass a flag to avoid any tasks with Lint in the name.
*
* To use, you can call `./gradlew build -PnoLint` from the command line.
*
* https://kousenit.org/2016/04/20/excluding-gradle-tasks-with-a-name-pattern/
*/
gradle.taskGraph.whenReady { graph ->
if (project.hasProperty('noLint')) {
graph.allTasks.findAll { it.name ==~ /.*lint.*/ }*.enabled = false
}
}