-
Notifications
You must be signed in to change notification settings - Fork 54
/
build.gradle
180 lines (158 loc) · 5.41 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
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.30'
id 'androidx.navigation.safeargs.kotlin'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'jacoco'
}
tasks.whenTaskAdded { task ->
if (task.name == 'assembleDebug')
task.dependsOn codeCoverageDebugReport
}
tasks.whenTaskAdded { task ->
if (task.name == 'assembleRelease')
task.dependsOn codeCoverageReleaseReport
}
def androidExclusion = [
'**/databinding/**/*.*',
'**/android/databinding/*Binding.*',
'**/BR.*',
'**/R.*',
'**/R$*.*',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*_MembersInjector.*',
'**/Dagger*Component.*',
'**/Dagger*Component$Builder.*',
'**/*Module_*Factory.*',
'**/*Fragment*.*',
'**/*Activity*.*',
'**/*Adapter*.*',
'**/*ViewPager*.*',
'**/*ViewHolder*.*',
'**/*ModuleKt*.*',
'**/network/**',
'**/model/**',
'**/security/**',
'**/worker/**',
'**/VerificaApplication*.*',
'**/Key*.*'
]
task codeCoverageDebugReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = true
html.enabled = true
}
getClassDirectories().setFrom(fileTree(
dir: 'build/tmp/kotlin-classes/debug',
excludes: androidExclusion
))
getSourceDirectories().setFrom(files('src/main/java/it/ministerodellasalute/verificaC19'))
getExecutionData().setFrom(files('build/jacoco/testDebugUnitTest.exec'))
}
task getDebugCoverage(type: Exec, dependsOn: 'codeCoverageDebugReport') {
group = "Reporting"
commandLine "open", "$buildDir/reports/jacoco/codeCoverageReport/html/index.html"
}
task codeCoverageReleaseReport(type: JacocoReport, dependsOn: 'testReleaseUnitTest') {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = true
html.enabled = true
}
getClassDirectories().setFrom(fileTree(
dir: 'build/tmp/kotlin-classes/release',
excludes: androidExclusion
))
getSourceDirectories().setFrom(files('src/main/java/it/ministerodellasalute/verificaC19'))
getExecutionData().setFrom(files('build/jacoco/testReleaseUnitTest.exec'))
}
task getReleaseCoverage(type: org.gradle.api.tasks.Exec, dependsOn: 'codeCoverageReleaseReport') {
group = "Reporting"
commandLine "open", "$buildDir/reports/jacoco/codeCoverageReport/html/index.html"
}
android {
compileSdkVersion Config.compileSdk
defaultConfig {
applicationId "it.ministerodellasalute.verificaC19"
minSdkVersion Config.minSdk
targetSdkVersion Config.targetSdk
versionCode 577
versionName "1.1.2"
testInstrumentationRunner Config.androidTestInstrumentation
}
buildTypes {
debug {
minifyEnabled false
debuggable true
}
release {
//signingConfig signingConfigs.debug
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
coreLibraryDesugaringEnabled = true
sourceCompatibility Config.javaVersion
targetCompatibility Config.javaVersion
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
packagingOptions {
pickFirst 'META-INF/ASL-2.0.txt'
pickFirst 'draftv4/schema'
pickFirst 'draftv3/schema'
pickFirst 'META-INF/LGPL-3.0.txt'
exclude 'META-INF/atomicfu.kotlin_module'
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def lintTask = tasks["lint${variant.name.capitalize()}"]
output.assemble.dependsOn lintTask
}
}
}
dependencies {
implementation project(':dgc-sdk')
implementation project(':decoder')
coreLibraryDesugaring Deps.desugar_jdk_libs
implementation Deps.kotlin_stdlib
implementation Deps.androidx_core
implementation Deps.androidx_appcompat
implementation Deps.androidx_material
implementation Deps.androidx_constraint
implementation Deps.androidx_navigation_fragment
implementation Deps.androidx_navigation_ui
implementation Deps.androidx_room_runtime
implementation Deps.androidx_worker_ktx
implementation Deps.kotlinx_coroutines
implementation Deps.zxing
implementation Deps.guava_conflict_resolver
implementation Deps.hilt
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
kapt Deps.hilt_compiler
implementation Deps.hilt_viewmodel
implementation Deps.hilt_work
kapt Deps.androidx_hilt_compiler
kapt Deps.androidx_room_compiler
implementation Deps.retrofit2
implementation Deps.log_interceptor
implementation Deps.gson_converter
testImplementation Deps.test_junit
testImplementation "io.mockk:mockk:1.11.0"
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0'
}