-
Notifications
You must be signed in to change notification settings - Fork 251
/
build.gradle.kts
170 lines (149 loc) · 5.99 KB
/
build.gradle.kts
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
import Dependencies.forceHapiVersion
import Dependencies.removeIncompatibleDependencies
import java.net.URL
plugins {
id(Plugins.BuildPlugins.androidLib)
id(Plugins.BuildPlugins.kotlinAndroid)
id(Plugins.BuildPlugins.mavenPublish)
jacoco
id(Plugins.BuildPlugins.dokka).version(Plugins.Versions.dokka)
}
publishArtifact(Releases.Workflow)
createJacocoTestReportTask()
android {
compileSdk = Sdk.compileSdk
defaultConfig {
minSdk = Sdk.minSdkWorkflow
targetSdk = Sdk.targetSdk
testInstrumentationRunner = Dependencies.androidJunitRunner
// Need to specify this to prevent junit runner from going deep into our dependencies
testInstrumentationRunnerArguments["package"] = "com.google.android.fhir.workflow"
}
// Added this for fixing out of memory issue in running test cases
tasks.withType<Test>().configureEach {
maxParallelForks = (Runtime.getRuntime().availableProcessors() - 1).takeIf { it > 0 } ?: 1
setForkEvery(100)
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
}
}
compileOptions {
sourceCompatibility = Java.sourceCompatibility
targetCompatibility = Java.targetCompatibility
}
packagingOptions {
resources.excludes.addAll(
listOf(
"license.html",
"META-INF/ASL2.0",
"META-INF/ASL-2.0.txt",
"META-INF/DEPENDENCIES",
"META-INF/LGPL-3.0.txt",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/license.txt",
"META-INF/license.html",
"META-INF/LICENSE.md",
"META-INF/NOTICE",
"META-INF/NOTICE.txt",
"META-INF/NOTICE.md",
"META-INF/notice.txt",
"META-INF/LGPL-3.0.txt",
"META-INF/sun-jaxb.episode",
"META-INF/*.kotlin_module",
"readme.html",
)
)
}
kotlinOptions { jvmTarget = Java.kotlinJvmTarget.toString() }
configureJacocoTestOptions()
}
configurations {
all {
removeIncompatibleDependencies()
forceHapiVersion()
}
}
dependencies {
androidTestImplementation(Dependencies.AndroidxTest.core)
androidTestImplementation(Dependencies.AndroidxTest.extJunit)
androidTestImplementation(Dependencies.AndroidxTest.extJunitKtx)
androidTestImplementation(Dependencies.AndroidxTest.runner)
androidTestImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx)
androidTestImplementation(Dependencies.jsonAssert)
androidTestImplementation(Dependencies.junit)
androidTestImplementation(Dependencies.truth)
androidTestImplementation(Dependencies.xmlUnit)
androidTestImplementation(project(":testing"))
androidTestImplementation(project(":workflow-testing"))
api(Dependencies.HapiFhir.structuresR4) { exclude(module = "junit") }
implementation(Dependencies.Androidx.coreKtx)
implementation(Dependencies.Cql.engine)
implementation(Dependencies.Cql.engineJackson) // Necessary to import Executable XML/JSON CQL libs
implementation(Dependencies.Cql.evaluator)
implementation(Dependencies.Cql.evaluatorBuilder)
implementation(Dependencies.Cql.evaluatorDagger)
implementation(Dependencies.Cql.evaluatorPlanDef)
implementation(Dependencies.Cql.translatorCqlToElm) // Overrides HAPI's old versions
implementation(Dependencies.Cql.translatorElm) // Overrides HAPI's old versions
implementation(Dependencies.Cql.translatorElmJackson) // Necessary to import XML/JSON CQL Libs
implementation(Dependencies.Cql.translatorModel) // Overrides HAPI's old versions
implementation(Dependencies.Cql.translatorModelJackson) // Necessary to import XML/JSON ModelInfos
// Forces the most recent version of jackson, ignoring what dependencies use.
// Remove these lines when HAPI 6.4 becomes available.
implementation(Dependencies.Jackson.annotations)
implementation(Dependencies.Jackson.bom)
implementation(Dependencies.Jackson.core)
implementation(Dependencies.Jackson.databind)
implementation(Dependencies.Jackson.dataformatXml)
implementation(Dependencies.Jackson.jaxbAnnotations)
implementation(Dependencies.Jackson.jsr310)
// 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
implementation(Dependencies.HapiFhir.caffeine)
implementation(Dependencies.Kotlin.kotlinCoroutinesAndroid)
implementation(Dependencies.Kotlin.kotlinCoroutinesCore)
implementation(Dependencies.Kotlin.stdlib)
implementation(Dependencies.xerces)
implementation(project(":engine"))
testImplementation(Dependencies.AndroidxTest.core)
testImplementation(Dependencies.jsonAssert)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.robolectric)
testImplementation(Dependencies.truth)
testImplementation(Dependencies.xmlUnit)
testImplementation(project(":testing"))
testImplementation(project(":workflow-testing"))
}
tasks.dokkaHtml.configure {
outputDirectory.set(file("../docs/${Releases.Workflow.artifactId}/${Releases.Workflow.version}"))
suppressInheritedMembers.set(true)
dokkaSourceSets {
named("main") {
moduleName.set(Releases.Workflow.artifactId)
moduleVersion.set(Releases.Workflow.version)
noAndroidSdkLink.set(false)
sourceLink {
localDirectory.set(file("src/main/java"))
remoteUrl.set(
URL("https://github.com/google/android-fhir/tree/master/workflow/src/main/java")
)
remoteLineSuffix.set("#L")
}
externalDocumentationLink {
url.set(URL("https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r4/"))
packageListUrl.set(
URL("https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-structures-r4/element-list")
)
}
externalDocumentationLink {
url.set(URL("https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-base/"))
packageListUrl.set(URL("https://hapifhir.io/hapi-fhir/apidocs/hapi-fhir-base/element-list"))
}
}
}
}