forked from wordpress-mobile/WordPress-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
227 lines (189 loc) · 5.93 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
buildscript {
ext.kotlinVersion = '1.4.20'
ext.serializationVersion = '1.0-M1-1.4.0-rc'
ext.navComponentVersion = '2.3.5'
ext.kotlin_coroutines_version = '1.3.9'
ext.coroutinesVersion = '1.3.9'
ext.kotlin_ktx_version = '1.2.0'
ext.wordPressUtilsVersion = '2.2.0'
ext.wordPressLoginVersion = '0.0.8'
ext.detektVersion = '1.15.0'
ext.gutenbergMobileVersion = 'v1.65.0'
ext.storiesVersion = '1.2.0'
repositories {
maven {
url 'https://a8c-libs.s3.amazonaws.com/android'
content {
includeGroup "com.automattic.android"
}
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.automattic.android:fetchstyle:1.1'
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navComponentVersion"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion"
}
}
apply plugin: 'com.automattic.android.fetchstyle'
allprojects {
apply plugin: 'checkstyle'
apply plugin: 'io.gitlab.arturbosch.detekt'
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
flatDir {
dirs '../aars'
}
}
tasks.register("checkstyle", Checkstyle) {
source 'src'
classpath = files()
}
checkstyle {
toolVersion = '8.3'
configFile file("${project.rootDir}/config/checkstyle.xml")
}
detekt {
config = files("${project.rootDir}/config/detekt/detekt.yml")
autoCorrect = false
buildUponDefaultConfig = false
disableDefaultRuleSets = false
ignoreFailures = false
parallel = false
debug = false
reports {
html.enabled = true
xml.enabled = true
txt.enabled = true
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
subprojects {
configurations {
ktlint
}
dependencies {
ktlint 'com.github.shyiko:ktlint:0.29.0'
}
tasks.register("ktlint", JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}
tasks.register("ktlintFormat", JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "-F", "src/**/*.kt"
}
tasks.register("ciktlint", JavaExec) {
main = "com.github.shyiko.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt", "--reporter=checkstyle,output=${buildDir}/ktlint.xml"
}
}
buildScan {
// Always run Gradle scan on CI builds
if (System.getenv('CI')) {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
tag 'CI'
publishAlways()
// Otherwise CI might shut down before it's uploaded
uploadInBackground = false
}
}
ext {
minSdkVersion = 24
compileSdkVersion = 30
targetSdkVersion = 30
coroutinesVersion = '1.3.9'
androidxWorkVersion = "2.4.0"
daggerVersion = '2.29.1'
fluxCVersion = '1.29.0'
appCompatVersion = '1.0.2'
coreVersion = '1.3.2'
lifecycleVersion = '2.2.0'
constraintLayoutVersion = '1.1.3'
materialVersion = '1.2.1'
preferenceVersion = '1.1.0'
swipeToRefresh = '1.1.0'
uCropVersion = '2.2.4'
lifecycleVersion = '2.2.0'
tracksVersion = '2.1.0'
roomVersion = '2.3.0'
coreLibraryDesugaringVersion = '1.1.5'
exoPlayerVersion = '2.9.3'
// testing
jUnitVersion = '4.13'
androidxTestVersion = '1.1.0'
androidxArchCoreVersion = '2.0.0'
assertJVersion = '3.11.1'
espressoVersion = '3.1.0'
mockitoCoreVersion = "3.3.3"
nhaarmanMockitoVersion = "2.2.0"
}
// Onboarding and dev env setup tasks
tasks.register("checkBundler", Exec) {
doFirst {
println "Check Bundler"
}
workingDir = './'
executable "sh"
args "-c", "if ! type 'bundle' > /dev/null; then gem install bundler; fi"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method checkBundler.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
tasks.register("checkBundle", Exec) {
dependsOn tasks.named("checkBundler")
doFirst {
println "Check Bundle"
}
workingDir = './'
executable "sh"
args "-c", "bundle check --path=\${BUNDLE_PATH:-vendor/bundle} > /dev/null || bundle install --jobs=3 --retry=3 --path=\${BUNDLE_PATH:-vendor/bundle}"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method checkBundle.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
tasks.register("applyCredentials", Exec) {
dependsOn tasks.named("checkBundle")
doFirst {
println "Apply credentials for this branch"
}
workingDir = './'
executable "sh"
args "-c", "FASTLANE_SKIP_UPDATE_CHECK=1 FASTLANE_ENV_PRINTER=1 bundle exec fastlane run configure_apply force:true"
//store the output instead of printing to the console:
standardOutput = new ByteArrayOutputStream()
//extension method checkBundle.output() can be used to obtain the output:
ext.output = {
return standardOutput.toString()
}
}
tasks.register("configureApply") {
group = 'Onboarding'
description = 'Install dependencies for debug and production builds'
dependsOn applyCredentials
doLast {
println("Done")
}
}