@@ -18,32 +18,42 @@ repositories {
1818}
1919
2020android {
21- compileSdkVersion 30
22- buildToolsVersion ' 30 .0.3 '
21+ compileSdkVersion 32
22+ buildToolsVersion ' 33 .0.0 '
2323
2424 defaultConfig {
2525 applicationId " org.openimis.imisclaims"
26- minSdkVersion 26
27- targetSdkVersion 30
28- versionCode 3
26+ minSdkVersion 21
27+ targetSdkVersion 32
28+ versionCode 4
2929 versionName " 2.0.1"
3030 testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
31- useLibrary ' org.apache.http.legacy'
3231 }
3332 buildTypes {
3433 release {
3534 minifyEnabled false
3635 proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
36+
37+ buildConfigField " boolean" , " LOGGING_ENABLED" , " false"
38+
39+ // Refer to https://developer.android.com/reference/android/util/Log for the log level values
40+ // Irrelevant if LOGGING_ENABLED = false
41+ buildConfigField " int" , " CONSOLE_LOG_LEVEL" , ' 8' // Assert
42+ buildConfigField " int" , " FILE_LOG_LEVEL" , ' 8' // Assert
3743 }
3844 debug {
3945 debuggable true
46+ buildConfigField " boolean" , " LOGGING_ENABLED" , " true"
47+
48+ // Refer to https://developer.android.com/reference/android/util/Log for the log level values
49+ buildConfigField " int" , " CONSOLE_LOG_LEVEL" , ' 2' // Verbose
50+ buildConfigField " int" , " FILE_LOG_LEVEL" , ' 2' // Verbose
4051 }
4152 }
4253
4354 flavorDimensions ' std'
4455
4556 productFlavors. all {
46- buildConfigField " String" , " APP_DIR" , ' "IMIS"'
4757 resValue " string" , " app_name_claims" , " openIMIS Claims"
4858 resValue " string" , " ReleaseDateValue" , getDate()
4959 buildConfigField " String" , " API_BASE_URL" , ' "http://demo.openimis.org/rest/"'
@@ -54,80 +64,69 @@ android {
5464 productFlavors {
5565 demoProd {
5666 applicationIdSuffix " .demoProd"
57- buildConfigField " String" , " APP_DIR" , ' "IMIS-DEMOPROD"'
5867 resValue " string" , " app_name_claims" , " Claims Demo"
5968 buildConfigField " String" , " API_BASE_URL" , ' "http://demo.openimis.org/rest/"'
6069 dimension ' std'
6170 }
6271
6372 demoRelease {
6473 applicationIdSuffix " .demoRelease"
65- buildConfigField " String" , " APP_DIR" , ' "IMIS-DEMORELEASE"'
6674 resValue " string" , " app_name_claims" , " Claims Release"
67- buildConfigField " String" , " API_BASE_URL" , ' "https://legacy- release.s1 .openimis.org/rest/"'
75+ buildConfigField " String" , " API_BASE_URL" , ' "https://release.openimis.org/rest/"'
6876 dimension ' std'
6977 }
7078
7179 chfDev {
7280 applicationIdSuffix " .chfDev"
7381 resValue " string" , " app_name_claims" , " Claims CHF"
74- buildConfigField " String" , " APP_DIR" , ' "IMIS-CHFDEV"'
7582 buildConfigField " String" , " API_BASE_URL" , ' "http://chf-dev.swisstph-mis.ch/rest/"'
7683 dimension ' std'
7784 }
7885
7986 chfProd {
8087 applicationIdSuffix " .chfProd"
8188 resValue " string" , " app_name_claims" , " Claims CHF"
82- buildConfigField " String" , " APP_DIR" , ' "IMIS-CHFPROD"'
8389 buildConfigField " String" , " API_BASE_URL" , ' "http://chf-imis.or.tz/restapi/"'
8490 dimension ' std'
8591 }
8692 mvDev {
8793 applicationIdSuffix " .mvDev"
88- buildConfigField " String" , " APP_DIR" , ' "IMIS-MVDEV"'
8994 resValue " string" , " app_name_claims" , " Claims MV"
9095 buildConfigField " String" , " API_BASE_URL" , ' "http://imis-mv.swisstph-mis.ch/rest/"'
9196 dimension ' std'
9297 }
9398 bephaDev {
9499 applicationIdSuffix " .bephaDev"
95- buildConfigField " String" , " APP_DIR" , ' "IMIS-BEPHADEV"'
96100 resValue " string" , " app_name_claims" , " Claims BEPHA"
97101 buildConfigField " String" , " API_BASE_URL" , ' "http://149.210.235.40/devupgrade/rest/"'
98102 dimension ' std'
99103 }
100104 niger {
101105 applicationIdSuffix " .niger"
102- buildConfigField " String" , " APP_DIR" , ' "IMIS-NIGER"'
103106 resValue " string" , " app_name_claims" , " Claims Niger"
104107 buildConfigField " String" , " API_BASE_URL" , ' "http://oiniger.bluesquare.org/rest/"'
105108 }
106109 tchadDev {
107110 applicationIdSuffix " .tchadDev"
108111 buildConfigField " String" , " API_BASE_URL" , ' "https://imis-tchad-dev.swisstph-mis.ch/rest/"'
109- buildConfigField " String" , " APP_DIR" , ' "IMIS-TCHADDEV"'
110112 resValue " string" , " app_name_claims" , " Claims TCHAD DEV"
111113 dimension ' std'
112114 }
113115 local {
114116 applicationIdSuffix " .local"
115- buildConfigField " String" , " APP_DIR" , ' "IMIS-LOCAL"'
116117 resValue " string" , " app_name_claims" , " Claims Local"
117118 buildConfigField " String" , " API_BASE_URL" , ' "http://10.0.2.2:35787/"'
118119 dimension ' std'
119120 }
120121 cli {
121122 applicationIdSuffix System . getenv(" APPLICATION_ID_SUFFIX" ) ?: " .cli"
122- buildConfigField " String" , " APP_DIR" , ' "' + (System . getenv(" CLI_APP_DIR" ) ?: ' IMIS-CLI' ) + ' "'
123123 resValue " string" , " app_name_claims" , System . getenv(" CLI_APP_NAME" ) ?: " Claims CLI"
124124 buildConfigField " String" , " API_BASE_URL" , ' "' + (System . getenv(" API_BASE_URL" ) ?: ' http://10.0.2.2:35787/' ) + ' "'
125125 dimension ' std'
126126 }
127127 mauritaniaTrain {
128128 applicationIdSuffix " .mauritaniaTrain"
129129 buildConfigField " String" , " API_BASE_URL" , ' "https://formation.cnass-mauritanie.swisstph-mis.ch/rest/"'
130- buildConfigField " String" , " APP_DIR" , ' "IMIS-MAURITANIA-TRAIN"'
131130 resValue " string" , " app_name_claims" , " Claims CNASS TRAIN"
132131 dimension = ' std'
133132 }
@@ -167,14 +166,16 @@ android {
167166 cli. res. srcDir System . getenv(" CLI_RES_DIR" ) ?: ' src/demoProd/res'
168167 }
169168
170- packagingOptions {
171- exclude ' META-INF/DEPENDENCIES'
172-
173- }
174169 compileOptions {
175170 sourceCompatibility JavaVersion . VERSION_11
176171 targetCompatibility JavaVersion . VERSION_11
177172 }
173+ buildFeatures {
174+ viewBinding true
175+ }
176+ packagingOptions {
177+ exclude ' META-INF/DEPENDENCIES'
178+ }
178179}
179180
180181// Apply custom flavours
@@ -190,6 +191,11 @@ dependencies {
190191 implementation ' com.embarkmobile:zxing-android-minimal:1.2.1@aar'
191192 implementation ' commons-io:commons-io:2.11.0'
192193 implementation ' com.android.support:design:28.0.0'
194+ implementation ' com.android.support:appcompat-v7:28.0.0'
195+ implementation ' android.arch.lifecycle:livedata:1.1.1'
196+ implementation ' android.arch.lifecycle:viewmodel:1.1.1'
197+ implementation ' org.apache.httpcomponents:httpclient:4.5.9'
198+ implementation ' org.apache.httpcomponents:httpcore:4.4.11'
193199 testImplementation ' junit:junit:4.12'
194200 androidTestImplementation ' com.android.support.test:runner:1.0.2'
195201 androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2'
0 commit comments