@@ -21,25 +21,25 @@ static def getDate() {
2121}
2222
2323android {
24- compileSdk 34
24+ compileSdk = 34
2525 namespace = " org.openimis.imispolicies"
2626 if (keystorePropertiesFile. exists()) {
2727 signingConfigs {
2828 releaseConfig {
29- storeFile file(keystoreProperties[' storeFile' ])
30- storePassword keystoreProperties[' storePassword' ]
31- keyAlias keystoreProperties[' keyAlias' ]
32- keyPassword keystoreProperties[' keyPassword' ]
29+ storeFile = file(keystoreProperties[' storeFile' ])
30+ storePassword = keystoreProperties[' storePassword' ]
31+ keyAlias = keystoreProperties[' keyAlias' ]
32+ keyPassword = keystoreProperties[' keyPassword' ]
3333 }
3434 }
3535 }
3636 defaultConfig {
37- applicationId " org.openimis.imispolicies"
37+ applicationId = " org.openimis.imispolicies"
3838 minSdkVersion 21
3939 targetSdkVersion 33
40- versionCode gitVersionCode
41- versionName gitVersionName
42- testInstrumentationRunner ' androidx.test.runner.AndroidJUnitRunner'
40+ versionCode = gitVersionCode
41+ versionName = gitVersionName
42+ testInstrumentationRunner = ' androidx.test.runner.AndroidJUnitRunner'
4343 vectorDrawables {
4444 useSupportLibrary = true
4545 }
@@ -52,11 +52,12 @@ android {
5252 buildConfigField " boolean" , " IS_PAYMENT_ENABLED" , ' false'
5353 resValue " string" , " app_name_policies" , " Policies"
5454 resValue " string" , " ReleaseDateValue" , getDate()
55+ resValue " string" , " sentry_dsn" , " "
5556 }
5657 buildTypes {
5758 release {
58- minifyEnabled false
59- shrinkResources false
59+ minifyEnabled = false
60+ shrinkResources = false
6061 proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
6162 debuggable = false
6263 if (keystorePropertiesFile. exists()) {
@@ -81,19 +82,19 @@ android {
8182 flavorDimensions = [' std' ]
8283 productFlavors {
8384 demoProd {
84- applicationId " org.openimis.imispolicies.demoProd"
85+ applicationId = " org.openimis.imispolicies.demoProd"
8586 buildConfigField " String" , " API_BASE_URL" , ' "https://demo.openimis.org/"'
8687 resValue " string" , " app_name_policies" , " Policies Demo"
8788 dimension = ' std'
8889 }
8990 demoRelease {
90- applicationId " org.openimis.imispolicies.demoRelease"
91+ applicationId = " org.openimis.imispolicies.demoRelease"
9192 buildConfigField " String" , " API_BASE_URL" , ' "https://release.openimis.org/"'
9293 resValue " string" , " app_name_policies" , " Policies Release"
9394 dimension = ' std'
9495 }
9596 chfDev {
96- applicationId " org.openimis.imispolicies.chfdev"
97+ applicationId = " org.openimis.imispolicies.chfdev"
9798 buildConfigField " String" , " API_BASE_URL" , ' "http://chf-dev.swisstph-mis.ch/"'
9899 buildConfigField " boolean" , " SHOW_PAYMENT_MENU" , ' true'
99100 buildConfigField " boolean" , " SHOW_BULK_CN_MENU" , ' true'
@@ -102,36 +103,36 @@ android {
102103 dimension = ' std'
103104 }
104105 mvDev {
105- applicationId " org.openimis.imispolicies.mv"
106+ applicationId = " org.openimis.imispolicies.mv"
106107 buildConfigField " String" , " API_BASE_URL" , ' "http://imis-mv.swisstph-mis.ch/"'
107108 buildConfigField " boolean" , " SHOW_PAYMENT_MENU" , ' true'
108109 buildConfigField " String" , " API_VERSION" , ' "3"'
109110 resValue " string" , " app_name_policies" , " Policies MV DEV"
110111 dimension = ' std'
111112 }
112113 bephaDev {
113- applicationId " org.openimis.imispolicies.bepha"
114+ applicationId = " org.openimis.imispolicies.bepha"
114115 buildConfigField " String" , " API_BASE_URL" , ' "http://149.210.235.40/devupgrade/"'
115116 buildConfigField " String" , " DEFAULT_LANGUAGE_CODE" , ' "en-cm"'
116117 resValue " string" , " app_name_policies" , " Policies BEPHA DEV"
117118 dimension = ' std'
118119 }
119120 tchadDev {
120- applicationId " org.openimis.imispolicies.tchadDev"
121+ applicationId = " org.openimis.imispolicies.tchadDev"
121122 buildConfigField " String" , " API_BASE_URL" , ' "http://imis-tchad-dev.swisstph-mis.ch/"'
122123 resValue " string" , " app_name_policies" , " Policies TCHAD DEV"
123124 dimension = ' std'
124125 }
125126 local {
126- applicationId " org.openimis.imispolicies.local"
127+ applicationId = " org.openimis.imispolicies.local"
127128 buildConfigField " String" , " API_BASE_URL" , ' "http://10.0.2.2:35787/"'
128129 buildConfigField " boolean" , " SHOW_PAYMENT_MENU" , ' true'
129130 resValue " string" , " app_name_policies" , " Policies Local"
130131 dimension = ' std'
131132 versionCode = gitVersionCodeTime
132133 }
133134 niger {
134- applicationId " org.openimis.imispolicies.niger"
135+ applicationId = " org.openimis.imispolicies.niger"
135136 buildConfigField " String" , " API_BASE_URL" , ' "' + (System . getenv(" API_BASE_URL" ) ?: ' http://192.168.0.100/' ) + ' "'
136137 resValue " string" , " app_name_policies" , System . getenv(" CLI_APP_NAME" ) ?: " Polices Niger"
137138 dimension = ' std'
@@ -140,10 +141,10 @@ android {
140141 applicationIdSuffix System . getenv(" APPLICATION_ID" ) ?: " org.openimis.imispolicies.cli"
141142 buildConfigField " String" , " API_BASE_URL" , ' "' + (System . getenv(" API_BASE_URL" ) ?: ' http://10.0.2.2:35787/' ) + ' "'
142143 resValue " string" , " app_name_policies" , System . getenv(" CLI_APP_NAME" ) ?: " Policies CLI"
143- dimension ' std'
144+ dimension = ' std'
144145 }
145146 mauritaniaTrain {
146- applicationId " org.openimis.policies.mauritaniaTrain"
147+ applicationId = " org.openimis.policies.mauritaniaTrain"
147148 buildConfigField " String" , " API_BASE_URL" , ' "https://formation.cnass-mauritanie.swisstph-mis.ch/"'
148149 buildConfigField " boolean" , " SHOW_PAYMENT_MENU" , ' false'
149150 buildConfigField " boolean" , " SHOW_BULK_CN_MENU" , ' false'
@@ -192,8 +193,8 @@ android {
192193 }
193194
194195 compileOptions {
195- sourceCompatibility JavaVersion . VERSION_11
196- targetCompatibility JavaVersion . VERSION_11
196+ sourceCompatibility = JavaVersion . VERSION_11
197+ targetCompatibility = JavaVersion . VERSION_11
197198 }
198199
199200 packagingOptions {
@@ -203,7 +204,14 @@ android {
203204 }
204205
205206 buildFeatures {
206- buildConfig true
207+ buildConfig = true
208+ }
209+
210+ testOptions {
211+ unitTests {
212+ includeAndroidResources = true
213+ returnDefaultValues = true
214+ }
207215 }
208216}
209217
@@ -218,6 +226,14 @@ apollo {
218226 ]
219227}
220228
229+ tasks. withType(Test ). configureEach {
230+ testLogging {
231+ events " passed" , " skipped" , " failed"
232+ exceptionFormat = " full"
233+ showStandardStreams = false
234+ }
235+ }
236+
221237dependencies {
222238 implementation fileTree(include : [' *.jar' , ' *.aar' ], dir : ' libs' )
223239 implementation ' com.squareup.okhttp3:okhttp:4.11.0'
@@ -242,9 +258,16 @@ dependencies {
242258 implementation ' cz.msebera.android:httpclient:4.5.8'
243259 implementation ' androidx.activity:activity:1.8.0'
244260 implementation " androidx.viewpager2:viewpager2:1.0.0"
261+ implementation ' androidx.test:core:1.7.0'
245262
246263 androidTestImplementation(' androidx.test.espresso:espresso-core:3.1.0' , {
247264 exclude group : ' com.android.support' , module : ' support-annotations'
248265 })
266+
267+ // unit tests
249268 testImplementation ' junit:junit:4.13.2'
269+ implementation ' io.sentry:sentry-android:8.25.0'
270+ testImplementation ' org.mockito:mockito-core:5.5.0'
271+ testImplementation ' org.robolectric:robolectric:4.11.1'
250272}
273+
0 commit comments