forked from SORMAS-Foundation/SORMAS-Project
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
209 lines (194 loc) · 8.09 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
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'
ext.sormasVersion = getVersionName()
ext.keystoreProperties = loadKeystoreProperties()
android {
// this avoids build errors as these files are present multiple times in the project dependencies,
// however, as they do not need to be part of the artifact, they can be excluded
packagingOptions {
jniLibs {
excludes += ['META-INF/spring.*']
}
resources {
excludes += ['META-INF/LICENSE.md',
'META-INF/NOTICE.md',
'META-INF/maven/de.symeda.sormas/sormas-api/pom.properties',
'META-INF/maven/de.symeda.sormas/sormas-api/pom.xml',
'META-INF/license.txt',
'META-INF/notice.txt',
'META-INF/spring.*']
}
}
// https://medium.com/google-developers/picking-your-compilesdkversion-minsdkversion-targetsdkversion-a098a0341ebd
// ideally: minSdkVersion (lowest possible) <= targetSdkVersion == compileSdkVersion (latest SDK)
compileSdkVersion 33
defaultConfig {
applicationId "de.symeda.sormas.app"
minSdkVersion 26
targetSdkVersion 33
versionCode buildVersionCode()
versionName "$sormasVersion"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
setProperty("archivesBaseName", "sormas-$versionName")
multiDexEnabled true
}
signingConfigs {
release {
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
signingConfig signingConfigs.release
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
firebaseCrashlytics {
mappingFileUploadEnabled = false
}
}
}
productFlavors {
}
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildFeatures {
dataBinding true
viewBinding true
}
// needed for pre androidx testing. This will not make it's way into the apk
useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
namespace 'de.symeda.sormas.app'
lint {
abortOnError false
}
}
repositories {
mavenLocal()
google()
maven { url "https://maven.repository.redhat.com/ga/" }
jcenter()
}
dependencies {
implementation 'androidx.core:core:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
def lifecycle_version = "2.2.0"
def paging_version = "3.0.1"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation platform('com.google.firebase:firebase-bom:32.2.0')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.j256.ormlite:ormlite-android:6.1'
implementation 'javax.persistence:persistence-api:1.0.2'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-perf'
implementation 'com.google.firebase:firebase-config'
implementation("de.symeda.sormas:sormas-api:$sormasVersion") { changing = true }
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation 'com.github.mpkorstanje:simmetrics-core:4.1.1'
implementation 'com.google.guava:guava:32.0.1-jre'
implementation 'com.opencsv:opencsv:5.7.1'
implementation 'commons-beanutils:commons-beanutils:1.9.4'
implementation 'commons-codec:commons-codec:1.16.0'
implementation 'commons-collections:commons-collections:3.2.2'
implementation 'commons-logging:commons-logging:1.2'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'org.jsoup:jsoup:1.16.1'
implementation('org.springframework:spring-context:5.3.27') {
// spring-jcl duplicates commons-logging classes
exclude group: 'org.springframework', module: 'spring-jcl'
}
implementation 'com.googlecode:openbeans:1.0'
implementation files('libs/MPAndroidChart-v3.0.2.jar')
implementation(name: 'CircleProgress-v1.2.1', ext: 'aar')
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.3.8'
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.15.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.6.1'
implementation 'androidx.paging:paging-runtime:3.1.1'
implementation 'androidx.work:work-runtime-ktx:2.8.1'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'me.dm7.barcodescanner:zxing:1.9.13'
implementation 'io.crowdcode.sormas.lbds:lbds-android-messaging:1.4.8'
implementation 'org.slf4j:slf4j-api:2.0.7'
// Align versions of all Kotlin components
implementation platform("org.jetbrains.kotlin:kotlin-bom:1.9.0")
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.hamcrest:hamcrest-core:2.2'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'org.mockito:mockito-core:5.4.0'
androidTestImplementation 'androidx.annotation:annotation:1.5.0'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}
apply plugin: "jacoco"
jacoco {
toolVersion = "0.8.5"
reportsDirectory = file("$buildDir/reports")
}
task jacocoUnitTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
def coverageSourceDirs = [
"src/main/java"
]
def fileFilter = [
'**/R.class',
'**/R$*.class',
'**/*$ViewInjector*.*',
'**/*$ViewBinder*.*',
'**/BuildConfig.*',
'**/Manifest*.*'
]
def javaClasses = fileTree(
dir: "$buildDir/intermediates/javac/debug/classes/de/symeda/sormas/app",
excludes: fileFilter
)
classDirectories.from = files([ javaClasses ])
additionalSourceDirs.from = files(coverageSourceDirs)
sourceDirectories.from = files(coverageSourceDirs)
executionData.from = fileTree(dir: "$buildDir", includes: [
"jacoco/testDebugUnitTest.exec"
])
reports {
xml.required = true
html.required = true
}
}
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property "sonar.projectKey", "de.symeda.sormas:sormas-app"
property "sonar.projectVersion", "$sormasVersion"
property "sonar.projectName", "sormas-app"
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacocoUnitTestReport/jacocoUnitTestReport.xml"
property "sonar.junit.reportPaths", "build/test-results/testDebugUnitTest/"
}
}