-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
237 lines (192 loc) · 6.5 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply from: 'depends.gradle'
buildscript {
ext {
versions = [
multidex : '1.0.3',
// retrolambda : '3.7.0',
support : '28.0.0',
buildTool : '29.0.2',
constraintLayout: '1.1.3',
butterKnife : '10.1.0',
guava : '26.0-android',
storeBox : '1.4.0',
DBFlow : '4.2.4',
kotlin : '1.3.21',
dagger : '2.21',
okhttp : '3.11.0',
jackson : '2.9.6',
rx : '2.2.1',
rxAndroid : '2.1.0',
netty : '4.1.29.Final',
retrofit : '2.4.0',
reflections : '0.9.11',
apacheCommons : [
codec: '1.11'
],
stetho : '1.5.0',
anko : '0.10.8',
ktlint : '5.1.0',
testJunit : '4.12',
testHamcrest : '1.3',
testMockito : '2.0.2-beta',
testUnitils : '3.4.6',
testAssertj : [
java : '3.8.0',
android: '1.2.0'
],
testRunner : '1.0.2',
testEspresso : '3.0.2'
]
checkstyleConfigs = [
main: file("${rootProject.rootDir}/.assets/checkstyle/checkstyle.xml"),
test: file("${rootProject.rootDir}/.assets/checkstyle/checkstyle-test.xml")
]
}
repositories {
google()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
// maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // For Butter Knife SNAPSHOT
}
configurations {
ktlint
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle-experimental:0.11.1'
// classpath "me.tatarka:gradle-retrolambda:${versions.retrolambda}" // Plugin support by java 8, Enable if SDK version < 24
classpath "com.jakewharton:butterknife-gradle-plugin:${versions.butterKnife}"
//noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
classpath "gradle.plugin.org.jlleitschuh.gradle:ktlint-gradle:${versions.ktlint}"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
// configurations.classpath.exclude group: 'com.android.tools.external.lombok'
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
maven { url 'https://www.jitpack.io' }
// maven { url "https://oss.sonatype.org/content/repositories/snapshots" } // For Butter Knife SNAPSHOT
}
}
subprojects {
// apply plugin: 'me.tatarka.retrolambda' // Plugin support by java 8, Enable if SDK version < 24
// apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'checkstyle'
apply plugin: "org.jlleitschuh.gradle.ktlint"
checkstyle {
toolVersion '8.4'
ignoreFailures false
showViolations true
}
ktlint {
version = "0.28.0"
debug = true
verbose = true
android = true
// reporter = "checkstyle"
ignoreFailures = true
}
tasks.withType(Checkstyle) {
reports {
html.destination rootProject.file("build/reports/checkstyle.html")
}
}
if (project.name.startsWith("lib.common")) {
return
}
if (project.name.startsWith("lib.")) {
apply plugin: 'com.android.library'
} else {
apply plugin: 'com.android.application'
dependencies {
implementation project(":lib.widget")
}
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
kotlin {
experimental {
coroutines "enable"
}
}
dependencies {
implementation project(":lib.common")
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation libs.main.common
implementation libs.main.guava
implementation libs.main.kotlin
implementation libs.main.stetho
testImplementation libs.test.android
}
android {
compileSdkVersion 29
buildToolsVersion versions.buildTool
defaultConfig {
multiDexEnabled true
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
}
lintOptions {
abortOnError false
}
dexOptions {
javaMaxHeapSize "8g"
jumboMode = true
preDexLibraries = true
threadCount = 8
}
}
// For android project
task checkstyleMain(type: Checkstyle) {
outputs.upToDateWhen { false }
source 'src/main'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
classpath = files()
configFile = checkstyleConfigs.main
}
task checkstyleTest(type: Checkstyle) {
outputs.upToDateWhen { false }
source 'src/test'
source 'src/androidTest'
include '**/*.java'
exclude '**/gen/**'
exclude '**/R.java'
exclude '**/BuildConfig.java'
classpath = files()
configFile = checkstyleConfigs.test
}
task checkstyle(dependsOn: [checkstyleMain, checkstyleTest]) {
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}