forked from wordpress-mobile/WordPress-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
253 lines (220 loc) · 7.75 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
import com.automattic.android.measure.MeasureBuildsExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id "io.gitlab.arturbosch.detekt"
id 'com.automattic.android.measure-builds'
id "org.jetbrains.kotlinx.kover"
id "androidx.navigation.safeargs.kotlin" apply false
id "com.android.library" apply false
id 'com.google.gms.google-services' apply false
id "org.jetbrains.kotlin.plugin.parcelize" apply false
}
ext {
minSdkVersion = 24
compileSdkVersion = 34
targetSdkVersion = 33
}
ext {
// libs
automatticAboutVersion = '1.3.0'
automatticRestVersion = '1.0.8'
automatticStoriesVersion = '2.4.0'
automatticTracksVersion = '3.3.0'
gutenbergMobileVersion = 'v1.111.0'
wordPressAztecVersion = 'v1.9.0'
wordPressFluxCVersion = '2.61.0'
wordPressLoginVersion = '1.10.0'
wordPressPersistentEditTextVersion = '1.0.2'
wordPressUtilsVersion = '3.11.0'
indexosMediaForMobileVersion = '43a9026f0973a2f0a74fa813132f6a16f7499c3a'
// debug
stethoVersion = '1.6.0'
// main
androidInstallReferrerVersion = '2.2'
androidVolleyVersion = '1.2.1'
androidxAnnotationVersion = '1.6.0'
androidxAppcompatVersion = '1.6.1'
androidxArchCoreVersion = '2.2.0'
androidxComposeBomVersion = '2023.10.00'
androidxComposeCompilerVersion = '1.5.3'
androidxCardviewVersion = '1.0.0'
androidxConstraintlayoutVersion = '2.1.4'
androidxConstraintlayoutComposeVersion = '1.0.1'
androidxCoreVersion = '1.10.0'
androidxActivityVersion = '1.8.0'
androidxFragmentVersion = '1.6.2'
androidxGridlayoutVersion = '1.0.0'
androidxLifecycleVersion = '2.6.2'
androidxPercentlayoutVersion = '1.0.0'
androidxPreferenceVersion = '1.2.0'
androidxRecyclerviewVersion = '1.3.0'
androidxSwipeToRefreshVersion = '1.1.0'
androidxViewpager2Version = '1.0.0'
androidxWorkManagerVersion = "2.8.1"
androidxWebkitVersion = '1.7.0'
androidxComposeMaterial3Version = '1.1.1'
apacheCommonsTextVersion = '1.10.0'
coilComposeVersion = '2.4.0'
chrisbanesPhotoviewVersion = '2.3.0'
eventBusVersion = '3.3.1'
facebookShimmerVersion = '0.5.0'
firebaseBomVersion = '32.1.0'
firebaseIidVersion = '21.1.0'
glideVersion = '4.15.1'
googleAutoServiceVersion = '1.0.1'
googleExoPlayerVersion = '2.13.3'
googleFlexboxlayoutVersion = '3.0.0'
googleGsonVersion = '2.10.1'
googleMaterialVersion = '1.9.0'
googleMLKitBarcodeScanningVersion = '17.0.0'
googlePlayReviewVersion = '2.0.1'
googlePlayServicesAuthVersion = '20.4.1'
googlePlayServicesCodeScannerVersion = '16.0.0-beta3'
jsoupVersion = '1.16.2'
kotlinxCoroutinesVersion = '1.7.3'
lottieVersion = '6.1.0'
philjayMpAndroidChartVersion = 'v3.1.0'
squareupKotlinPoetVersion = '1.6.0'
squareupOkioVersion = '3.6.0'
squareupRetrofitVersion = '2.9.0'
uCropVersion = '2.2.8'
zendeskVersion = '5.1.2'
// react native
facebookReactVersion = '0.71.11'
// test
assertjVersion = '3.23.1'
junitVersion = '4.13.2'
mockitoVersion = '5.3.1'
mockitoKotlinVersion = '4.1.0'
// android test
androidxTestCoreVersion = '1.5.0'
androidxTestEspressoVersion = '3.4.0'
androidxTestExtJunitVersion = '1.1.5'
androidxTestUiAutomatorVersion = '2.2.0'
screengrabVersion = '2.1.1'
squareupMockWebServerVersion = '4.12.0'
wiremockVersion = '2.26.3'
wiremockHttpClientVersion = '4.3.5.1'
// other
androidDesugarVersion = '2.0.4'
wordPressLintVersion = '2.0.0'
}
measureBuilds {
enable = findProperty('measureBuildsEnabled')?.toBoolean() ?: false
automatticProject = MeasureBuildsExtension.AutomatticProject.WordPress
authToken = findProperty('appsMetricsToken')
attachGradleScanId = System.getenv('CI')?.toBoolean() ?: false
}
allprojects {
apply plugin: 'checkstyle'
apply plugin: 'io.gitlab.arturbosch.detekt'
repositories {
google()
mavenCentral()
maven {
url "https://a8c-libs.s3.amazonaws.com/android/jcenter-mirror"
content {
includeVersion "com.android.volley", "volley", "1.1.1"
includeVersion "com.automattic", "rest", "1.0.8"
includeVersion "com.google.android", "flexbox", "2.0.1"
includeVersion "org.wordpress", "persistentedittext", "1.0.2"
includeVersion "org.wordpress", "wellsql-core", "1.6.0"
includeVersion "org.wordpress", "wellsql", "1.6.0"
// Required for detekt
includeVersion "org.jetbrains.kotlinx", "kotlinx-html-jvm", "0.7.2"
// Required for lintWordpressVanillaRelease
includeVersion "com.jraska", "falcon", "2.1.1"
}
}
flatDir {
dirs '../aars'
}
}
tasks.register("checkstyle", Checkstyle) {
source 'src'
classpath = files()
}
checkstyle {
toolVersion = '8.3'
configFile file("${project.rootDir}/config/checkstyle.xml")
}
detekt {
toolVersion = gradle.ext.detektVersion
baseline = file("${project.rootDir}/config/detekt/baseline.xml")
config = files("${project.rootDir}/config/detekt/detekt.yml")
autoCorrect = false
buildUponDefaultConfig = true
disableDefaultRuleSets = false
ignoreFailures = false
parallel = true
debug = false
}
tasks.withType(KotlinCompile).all {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
allWarningsAsErrors = true
freeCompilerArgs += [
"-opt-in=kotlin.RequiresOptIn",
"-Xjvm-default=all"
]
}
}
}
// 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")
}
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$gradle.ext.detektVersion"
}
apply from: './config/gradle/code_coverage.gradle'
apply from: './config/gradle/gradle_build_scan.gradle'