-
Notifications
You must be signed in to change notification settings - Fork 246
/
Dependencies.kt
355 lines (311 loc) · 15.5 KB
/
Dependencies.kt
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.gradle.api.artifacts.Configuration
import org.gradle.kotlin.dsl.exclude
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
object Dependencies {
object Androidx {
const val activity = "androidx.activity:activity:${Versions.Androidx.activity}"
const val appCompat = "androidx.appcompat:appcompat:${Versions.Androidx.appCompat}"
const val constraintLayout =
"androidx.constraintlayout:constraintlayout:${Versions.Androidx.constraintLayout}"
const val coreKtx = "androidx.core:core-ktx:${Versions.Androidx.coreKtx}"
const val datastorePref =
"androidx.datastore:datastore-preferences:${Versions.Androidx.datastorePref}"
const val fragmentKtx = "androidx.fragment:fragment-ktx:${Versions.Androidx.fragmentKtx}"
const val recyclerView = "androidx.recyclerview:recyclerview:${Versions.Androidx.recyclerView}"
const val sqliteKtx = "androidx.sqlite:sqlite-ktx:${Versions.Androidx.sqliteKtx}"
const val workRuntimeKtx = "androidx.work:work-runtime-ktx:${Versions.Androidx.workRuntimeKtx}"
}
object Cql {
const val openCdsGroup = "org.opencds.cqf.cql"
const val translatorGroup = "info.cqframework"
const val engine = "$openCdsGroup:engine:${Versions.Cql.engine}"
const val engineJackson = "$openCdsGroup:engine.jackson:${Versions.Cql.engine}"
const val evaluator = "$openCdsGroup:evaluator:${Versions.Cql.evaluator}"
const val evaluatorBuilder = "$openCdsGroup:evaluator.builder:${Versions.Cql.evaluator}"
const val evaluatorDagger = "$openCdsGroup:evaluator.dagger:${Versions.Cql.evaluator}"
const val evaluatorPlanDef = "$openCdsGroup:evaluator.plandefinition:${Versions.Cql.evaluator}"
const val translatorCqlToElm = "$translatorGroup:cql-to-elm:${Versions.Cql.translator}"
const val translatorElm = "$translatorGroup:elm:${Versions.Cql.translator}"
const val translatorModel = "$translatorGroup:model:${Versions.Cql.translator}"
const val translatorElmJackson = "$translatorGroup:elm-jackson:${Versions.Cql.translator}"
const val translatorModelJackson = "$translatorGroup:model-jackson:${Versions.Cql.translator}"
}
object Glide {
const val glide = "com.github.bumptech.glide:glide:${Versions.Glide.glide}"
}
object HapiFhir {
const val fhirBase = "ca.uhn.hapi.fhir:hapi-fhir-base:${Versions.hapiFhir}"
const val fhirClient = "ca.uhn.hapi.fhir:hapi-fhir-client:${Versions.hapiFhir}"
const val structuresDstu2 = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:${Versions.hapiFhir}"
const val structuresDstu3 = "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu3:${Versions.hapiFhir}"
const val structuresR4 = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4:${Versions.hapiFhir}"
const val structuresR4b = "ca.uhn.hapi.fhir:hapi-fhir-structures-r4b:${Versions.hapiFhir}"
const val structuresR5 = "ca.uhn.hapi.fhir:hapi-fhir-structures-r5:${Versions.hapiFhir}"
const val validation = "ca.uhn.hapi.fhir:hapi-fhir-validation:${Versions.hapiFhir}"
const val validationDstu3 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-dstu3:${Versions.hapiFhir}"
const val validationR4 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r4:${Versions.hapiFhir}"
const val validationR5 =
"ca.uhn.hapi.fhir:hapi-fhir-validation-resources-r5:${Versions.hapiFhir}"
const val fhirCoreDstu2 = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu2:${Versions.hapiFhirCore}"
const val fhirCoreDstu2016 =
"ca.uhn.hapi.fhir:org.hl7.fhir.dstu2016may:${Versions.hapiFhirCore}"
const val fhirCoreDstu3 = "ca.uhn.hapi.fhir:org.hl7.fhir.dstu3:${Versions.hapiFhirCore}"
const val fhirCoreR4 = "ca.uhn.hapi.fhir:org.hl7.fhir.r4:${Versions.hapiFhirCore}"
const val fhirCoreR4b = "ca.uhn.hapi.fhir:org.hl7.fhir.r4b:${Versions.hapiFhirCore}"
const val fhirCoreR5 = "ca.uhn.hapi.fhir:org.hl7.fhir.r5:${Versions.hapiFhirCore}"
const val fhirCoreUtils = "ca.uhn.hapi.fhir:org.hl7.fhir.utilities:${Versions.hapiFhirCore}"
const val fhirCoreConvertors =
"ca.uhn.hapi.fhir:org.hl7.fhir.convertors:${Versions.hapiFhirCore}"
// Runtime dependency that is required to run FhirPath (also requires minSDK of 26).
// Version 3.0 uses java.lang.System.Logger, which is not available on Android
// Replace for Guava when this PR gets merged: https://github.com/hapifhir/hapi-fhir/pull/3977
const val caffeine = "com.github.ben-manes.caffeine:caffeine:${Versions.caffeine}"
}
object Jackson {
const val mainGroup = "com.fasterxml.jackson"
const val coreGroup = "$mainGroup.core"
const val dataformatGroup = "$mainGroup.dataformat"
const val datatypeGroup = "$mainGroup.datatype"
const val moduleGroup = "$mainGroup.module"
const val annotations = "$coreGroup:jackson-annotations:${Versions.jackson}"
const val bom = "$mainGroup:jackson-bom:${Versions.jackson}"
const val core = "$coreGroup:jackson-core:${Versions.jackson}"
const val databind = "$coreGroup:jackson-databind:${Versions.jackson}"
const val dataformatXml = "$dataformatGroup:jackson-dataformat-xml:${Versions.jackson}"
const val jaxbAnnotations = "$moduleGroup:jackson-module-jaxb-annotations:${Versions.jackson}"
const val jsr310 = "$datatypeGroup:jackson-datatype-jsr310:${Versions.jackson}"
}
object Kotlin {
const val kotlinCoroutinesAndroid =
"org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.Kotlin.kotlinCoroutinesCore}"
const val kotlinCoroutinesCore =
"org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.Kotlin.kotlinCoroutinesCore}"
const val kotlinTestJunit = "org.jetbrains.kotlin:kotlin-test-junit:${Versions.Kotlin.stdlib}"
const val kotlinCoroutinesTest =
"org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.Kotlin.kotlinCoroutinesCore}"
const val stdlib = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.Kotlin.stdlib}"
}
object Lifecycle {
const val liveDataKtx =
"androidx.lifecycle:lifecycle-livedata-ktx:${Versions.Androidx.lifecycle}"
const val runtime = "androidx.lifecycle:lifecycle-runtime:${Versions.Androidx.lifecycle}"
const val viewModelKtx =
"androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.Androidx.lifecycle}"
}
object Navigation {
const val navFragmentKtx =
"androidx.navigation:navigation-fragment-ktx:${Versions.Androidx.navigation}"
const val navUiKtx = "androidx.navigation:navigation-ui-ktx:${Versions.Androidx.navigation}"
}
object Retrofit {
const val coreRetrofit = "com.squareup.retrofit2:retrofit:${Versions.retrofit}"
}
object Room {
const val compiler = "androidx.room:room-compiler:${Versions.Androidx.room}"
const val ktx = "androidx.room:room-ktx:${Versions.Androidx.room}"
const val runtime = "androidx.room:room-runtime:${Versions.Androidx.room}"
const val testing = "androidx.room:room-testing:${Versions.Androidx.room}"
}
object Mlkit {
const val barcodeScanning =
"com.google.mlkit:barcode-scanning:${Versions.Mlkit.barcodeScanning}"
const val objectDetection =
"com.google.mlkit:object-detection:${Versions.Mlkit.objectDetection}"
const val objectDetectionCustom =
"com.google.mlkit:object-detection-custom:${Versions.Mlkit.objectDetectionCustom}"
}
const val androidFhirGroup = "com.google.android.fhir"
const val androidFhirCommon = "$androidFhirGroup:common:${Versions.androidFhirCommon}"
const val androidFhirEngineModule = "engine"
const val androidFhirEngine =
"$androidFhirGroup:$androidFhirEngineModule:${Versions.androidFhirEngine}"
const val lifecycleExtensions =
"androidx.lifecycle:lifecycle-extensions:${Versions.Androidx.lifecycle}"
const val desugarJdkLibs = "com.android.tools:desugar_jdk_libs:${Versions.desugarJdkLibs}"
const val fhirUcum = "org.fhir:ucum:${Versions.fhirUcum}"
const val guava = "com.google.guava:guava:${Versions.guava}"
const val httpInterceptor = "com.squareup.okhttp3:logging-interceptor:${Versions.http}"
const val http = "com.squareup.okhttp3:okhttp:${Versions.http}"
const val mockWebServer = "com.squareup.okhttp3:mockwebserver:${Versions.http}"
const val jsonToolsPatch = "com.github.java-json-tools:json-patch:${Versions.jsonToolsPatch}"
const val kotlinPoet = "com.squareup:kotlinpoet:${Versions.kotlinPoet}"
const val material = "com.google.android.material:material:${Versions.material}"
const val sqlcipher = "net.zetetic:android-database-sqlcipher:${Versions.sqlcipher}"
const val timber = "com.jakewharton.timber:timber:${Versions.timber}"
const val woodstox = "com.fasterxml.woodstox:woodstox-core:${Versions.woodstox}"
const val xerces = "xerces:xercesImpl:${Versions.xerces}"
// Dependencies for testing go here
object AndroidxTest {
const val archCore = "androidx.arch.core:core-testing:${Versions.AndroidxTest.archCore}"
const val benchmarkJunit =
"androidx.benchmark:benchmark-junit4:${Versions.AndroidxTest.benchmarkJUnit}"
const val core = "androidx.test:core:${Versions.AndroidxTest.core}"
const val extJunit = "androidx.test.ext:junit:${Versions.AndroidxTest.extJunit}"
const val extJunitKtx = "androidx.test.ext:junit-ktx:${Versions.AndroidxTest.extJunit}"
const val fragmentTesting =
"androidx.fragment:fragment-testing:${Versions.AndroidxTest.fragmentVersion}"
const val rules = "androidx.test:rules:${Versions.AndroidxTest.rules}"
const val runner = "androidx.test:runner:${Versions.AndroidxTest.runner}"
const val workTestingRuntimeKtx =
"androidx.work:work-testing:${Versions.Androidx.workRuntimeKtx}"
}
object Espresso {
const val espressoCore = "androidx.test.espresso:espresso-core:${Versions.espresso}"
const val espressoContrib = "androidx.test.espresso:espresso-contrib:${Versions.espresso}"
}
const val androidBenchmarkRunner = "androidx.benchmark.junit4.AndroidBenchmarkRunner"
const val androidJunitRunner = "androidx.test.runner.AndroidJUnitRunner"
// Makes Json assertions where the order of elements, tabs/whitespaces are not important.
const val jsonAssert = "org.skyscreamer:jsonassert:${Versions.jsonAssert}"
const val junit = "junit:junit:${Versions.junit}"
const val mockitoKotlin = "org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}"
const val mockitoInline = "org.mockito:mockito-inline:${Versions.mockitoInline}"
const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}"
const val slf4j = "org.slf4j:slf4j-android:${Versions.slf4j}"
const val truth = "com.google.truth:truth:${Versions.truth}"
// Makes XML assertions where the order of elements, tabs/whitespaces are not important.
const val xmlUnit = "org.xmlunit:xmlunit-core:${Versions.xmlUnit}"
object Versions {
object Androidx {
const val activity = "1.2.1"
const val appCompat = "1.1.0"
const val constraintLayout = "2.1.1"
const val coreKtx = "1.2.0"
const val datastorePref = "1.0.0"
const val fragmentKtx = "1.3.1"
const val lifecycle = "2.2.0"
const val navigation = "2.3.4"
const val recyclerView = "1.1.0"
const val room = "2.4.2"
const val sqliteKtx = "2.1.0"
const val workRuntimeKtx = "2.7.1"
}
object Cql {
const val antlr = "4.10.1"
const val engine = "2.4.0"
const val evaluator = "2.4.0"
const val translator = "2.4.0"
}
object Glide {
const val glide = "4.14.2"
}
object Kotlin {
const val kotlinCoroutinesCore = "1.6.4"
const val stdlib = "1.6.10"
}
const val androidFhirCommon = "0.1.0-alpha03"
const val androidFhirEngine = "0.1.0-beta02"
const val desugarJdkLibs = "1.1.5"
const val caffeine = "2.9.1"
const val fhirUcum = "1.0.3"
const val guava = "28.2-android"
// Hapi FHIR and HL7 Core Components are interlinked.
// Newer versions of HapiFhir don't work on Android due to the use of Caffeine 3+
// Wait for this to release (6.3): https://github.com/hapifhir/hapi-fhir/pull/4196
const val hapiFhir = "6.0.1"
// Newer versions don't work on Android due to Apache Commons Codec:
// Wait for this fix: https://github.com/hapifhir/org.hl7.fhir.core/issues/1046
const val hapiFhirCore = "5.6.36"
const val http = "4.9.1"
const val jackson = "2.14.1"
const val jsonToolsPatch = "1.13"
const val jsonAssert = "1.5.1"
const val kotlinPoet = "1.9.0"
const val material = "1.6.0"
const val retrofit = "2.7.2"
const val slf4j = "1.7.36"
const val sqlcipher = "4.5.0"
const val timber = "5.0.1"
const val truth = "1.1.3"
const val woodstox = "6.2.7"
const val xerces = "2.12.2"
const val xmlUnit = "2.9.0"
// Test dependencies
object AndroidxTest {
const val benchmarkJUnit = "1.1.0"
const val core = "1.4.0"
const val archCore = "2.1.0"
const val extJunit = "1.1.5"
const val rules = "1.4.0"
const val runner = "1.5.2"
const val fragmentVersion = "1.3.6"
}
const val espresso = "3.4.0"
const val jacoco = "0.8.7"
const val junit = "4.13.2"
const val mockitoKotlin = "3.2.0"
const val mockitoInline = "4.0.0"
const val robolectric = "4.7.3"
object Mlkit {
const val barcodeScanning = "16.1.1"
const val objectDetection = "16.2.3"
const val objectDetectionCustom = "16.3.1"
}
}
fun Configuration.removeIncompatibleDependencies() {
exclude(module = "xpp3")
exclude(module = "xpp3_min")
exclude(module = "xmlpull")
exclude(module = "javax.json")
exclude(module = "jcl-over-slf4j")
exclude(group = "org.apache.httpcomponents")
}
fun Configuration.forceHapiVersion() {
// Removes newer versions of caffeine and manually imports 2.9
// Removes newer versions of hapi and keeps on 6.0.1
// Removes newer versions of HL7 core and keeps it on 5.6.36
// (newer versions don't work on Android)
resolutionStrategy {
force(HapiFhir.caffeine)
force(HapiFhir.fhirBase)
force(HapiFhir.fhirClient)
force(HapiFhir.fhirCoreConvertors)
force(HapiFhir.fhirCoreDstu2)
force(HapiFhir.fhirCoreDstu2016)
force(HapiFhir.fhirCoreDstu3)
force(HapiFhir.fhirCoreR4)
force(HapiFhir.fhirCoreR4b)
force(HapiFhir.fhirCoreR5)
force(HapiFhir.fhirCoreUtils)
force(HapiFhir.structuresDstu2)
force(HapiFhir.structuresDstu3)
force(HapiFhir.structuresR4)
force(HapiFhir.structuresR5)
force(HapiFhir.validation)
force(HapiFhir.validationDstu3)
force(HapiFhir.validationR4)
force(HapiFhir.validationR5)
}
}
}