-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
153 lines (138 loc) · 5.31 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import com.android.build.gradle.AppPlugin
import com.android.build.gradle.LibraryPlugin
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
buildscript {
ext.isCiBuild = System.getenv("CI") == "true"
ext.isIdeBuild = project.hasProperty('android.injected.invoked.from.ide')
ext.enableCoverage = project.hasProperty('coverage')
ext.buildConfig = [
minSdk : 23,
targetSdk : 30,
compileSdk: 30,
buildTools: '30.0.2'
]
ext.versions = [
androidGradlePlugin : '4.1.0-rc03',
googleServicesGradlePlugin: '4.3.3',
bugsnag : '5.1.0',
detekt : '1.14.0',
leakCanary : '2.4',
kotlin : '1.4.10',
kotlinx : [
coroutines: '1.3.9',
],
firebase : [
analytics: '17.5.0'
],
blueprint : '1.14.1',
flowbinding : '1.0.0-alpha04',
androidx : [
core : '1.5.0-alpha02',
annotation : '1.2.0-alpha01',
appCompat : '1.3.0-alpha02',
activity : '1.2.0-alpha08',
fragment : '1.3.0-alpha08',
coordinatorLayout : '1.1.0',
recyclerView : '1.2.0-alpha05',
swipeRefreshLayout: '1.2.0-alpha01',
constraintLayout : '2.0.1',
arch : '2.1.0',
lifecycle : '2.3.0-alpha07',
room : '2.3.0-alpha02',
navigation : '2.3.0',
work : '2.5.0-alpha01',
test : [
core : '1.3.0',
monitor: '1.3.0',
rules : '1.3.0',
runner : '1.3.0',
ext : [
junit: '1.1.2'
]
],
espresso : '3.3.0'
],
material : '1.3.0-alpha02',
okhttp : '4.8.1',
retrofit : '2.9.0',
moshi : '1.10.0',
json : '20190722',
rxJava : '2.2.19',
koin : '2.0.1',
timber : '4.7.1',
store : '3.1.1',
junit : '4.13',
mockk : '1.10.0',
kluent : '1.58'
]
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
classpath "com.android.tools.build:gradle:${versions.androidGradlePlugin}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "com.google.gms:google-services:${versions.googleServicesGradlePlugin}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${versions.detekt}"
}
}
allprojects {
repositories {
mavenCentral()
google()
jcenter()
}
plugins.withType(AppPlugin).configureEach { plugin ->
extensions.getByName("android").compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
plugins.withType(LibraryPlugin).configureEach { plugin ->
extensions.getByName("android").compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
tasks.withType(KotlinCompile).configureEach { task ->
task.kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += [
'-progressive',
'-XXLanguage:+InlineClasses',
'-Xjvm-default=all',
'-Xopt-in=kotlin.Experimental',
]
}
}
tasks.withType(Test).configureEach {
maxParallelForks Runtime.runtime.availableProcessors() * 2
testLogging {
events 'passed', 'skipped', 'failed'
}
}
}
subprojects {
apply from: "$project.rootDir/gradle/detekt.gradle"
/**
* Disable debug and mock tests to avoid running the same tests repeatedly in different build variants.
* ./gradlew test -PslimTests will run unit tests for *ProdRelease and *Release in Android App and Library projects,
* and all tests in JVM projects.
*/
if (project.hasProperty('slimTests')) {
tasks.configureEach { task ->
if (task.name ==~ /test.*(?i)(debug|mock).*/) {
task.enabled = false
}
}
}
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
def envOrProp(String name) {
def value = System.getenv(name)
value != null ? value : project.hasProperty(name) ? project.getProperty(name) : ''
}
apply from: "$project.rootDir/gradle/projectDependencyGraph.gradle"