forked from google/android-fhir
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
143 lines (124 loc) · 4.51 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
import Releases.useApache2License
plugins {
id(Plugins.BuildPlugins.androidLib)
id(Plugins.BuildPlugins.kotlinAndroid)
id(Plugins.BuildPlugins.kotlinKapt)
id(Plugins.BuildPlugins.mavenPublish)
jacoco
}
afterEvaluate {
publishing {
publications {
register("release", MavenPublication::class) {
from(components["release"])
groupId = Releases.groupId
artifactId = Releases.Engine.artifactId
version = Releases.Engine.version
// Also publish source code for developers' convenience
artifact(
tasks.create<Jar>("androidSourcesJar") {
archiveClassifier.set("sources")
from(android.sourceSets.getByName("main").java.srcDirs)
}
)
pom {
name.set(Releases.Engine.name)
useApache2License()
}
}
}
}
}
createJacocoTestReportTask()
android {
compileSdk = Sdk.compileSdk
defaultConfig {
minSdk = Sdk.minSdk
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"
// Required when setting minSdkVersion to 20 or lower
// See https://developer.android.com/studio/write/java8-support
multiDexEnabled = true
}
sourceSets {
getByName("androidTest").apply {
java.srcDirs("src/test-common/java")
resources.setSrcDirs(listOf("sampledata"))
}
getByName("test").apply {
java.srcDirs("src/test-common/java")
resources.setSrcDirs(listOf("sampledata"))
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
}
compileOptions {
// Flag to enable support for the new language APIs
// See https = //developer.android.com/studio/write/java8-support
isCoreLibraryDesugaringEnabled = true
// Sets Java compatibility to Java 8
// See https = //developer.android.com/studio/write/java8-support
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
packagingOptions {
resources.excludes.addAll(listOf("META-INF/ASL-2.0.txt", "META-INF/LGPL-3.0.txt"))
}
// See https = //developer.android.com/studio/write/java8-support
kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8.toString() }
configureJacocoTestOptions()
}
configurations {
all {
exclude(module = "json")
exclude(module = "xpp3")
exclude(group = "net.sf.saxon", module = "Saxon-HE")
exclude(module = "hamcrest-all")
exclude(module = "jakarta.activation-api")
exclude(module = "javax.activation")
exclude(module = "jakarta.xml.bind-api")
}
}
dependencies {
androidTestImplementation(Dependencies.junit)
androidTestImplementation(Dependencies.truth)
androidTestImplementation(Dependencies.AndroidxTest.core)
androidTestImplementation(Dependencies.AndroidxTest.extJunitKtx)
androidTestImplementation(Dependencies.AndroidxTest.runner)
androidTestImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx)
api(Dependencies.HapiFhir.structuresR4) { exclude(module = "junit") }
coreLibraryDesugaring(Dependencies.desugarJdkLibs)
implementation(Dependencies.Androidx.datastorePref)
implementation(Dependencies.Androidx.sqliteKtx)
implementation(Dependencies.Androidx.workRuntimeKtx)
implementation(Dependencies.HapiFhir.validation) {
exclude(module = "commons-logging")
exclude(module = "httpclient")
}
implementation(Dependencies.Kotlin.stdlib)
implementation(Dependencies.Lifecycle.liveDataKtx)
implementation(Dependencies.Room.ktx)
implementation(Dependencies.Room.runtime)
implementation(Dependencies.androidFhirCommon)
implementation(Dependencies.guava)
implementation(Dependencies.jsonToolsPatch)
implementation(Dependencies.sqlcipher)
implementation(Dependencies.timber)
kapt(Dependencies.Room.compiler)
testImplementation(Dependencies.junit)
testImplementation(Dependencies.mockitoKotlin)
testImplementation(Dependencies.robolectric)
testImplementation(Dependencies.truth)
testImplementation(Dependencies.AndroidxTest.core)
testImplementation(Dependencies.AndroidxTest.archCore)
testImplementation(Dependencies.AndroidxTest.workTestingRuntimeKtx)
testImplementation(Dependencies.Kotlin.kotlinCoroutinesTest)
}
// Generate SearchParameterRepositoryGenerated.kt.
tasks.getByName("build") { dependsOn(":codegen:runCodeGenerator") }