@@ -10,13 +10,14 @@ plugins {
1010}
1111
1212android {
13- compileSdkVersion 31
14- buildToolsVersion " 31.0.0"
13+ namespace ' org.imaginativeworld.simplemvvm'
14+ compileSdkVersion 33
15+ buildToolsVersion " 33.0.0"
1516
1617 defaultConfig {
1718 applicationId " org.imaginativeworld.simplemvvm"
1819 minSdkVersion 21
19- targetSdkVersion 31
20+ targetSdkVersion 33
2021 versionCode 1
2122 versionName " 1.0.0.000000" // Major.Minor.Patch.YYMMDD
2223 vectorDrawables. useSupportLibrary = true
@@ -25,25 +26,50 @@ android {
2526
2627 javaCompileOptions {
2728 annotationProcessorOptions {
28- arguments + = [
29- " room.schemaLocation" : " $projectDir /schemas" . toString(),
30- " room.incremental" : " true" ,
31- " room.expandProjection" : " true"
32- ]
29+ arguments + = [" room.schemaLocation" : " $projectDir /schemas" . toString(),
30+ " room.incremental" : " true" ,
31+ " room.expandProjection" : " true" ]
3332 }
3433 }
34+ signingConfig signingConfigs. debug
3535 }
3636
3737 buildTypes {
38- debug {
38+ local { // Local
39+ initWith debug
40+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
41+
42+ loadConfigurationProperties it, " config/internal.properties"
43+
44+ matchingFallbacks = [' debug' ]
45+ }
46+
47+ debug { // Development
3948 debuggable true
49+ minifyEnabled false
4050 applicationIdSuffix " .debug"
4151 versionNameSuffix " -debug"
52+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
53+
54+ loadConfigurationProperties it, " config/development.properties"
55+ }
56+
57+ staging { // Staging
58+ initWith debug
59+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
60+
61+ loadConfigurationProperties it, " config/staging.properties"
62+
63+ matchingFallbacks = [' release' ]
4264 }
43- release {
65+
66+ release { // Production
67+ debuggable false
4468 minifyEnabled true
4569 shrinkResources true
46- proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
70+ proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
71+
72+ loadConfigurationProperties it, " config/release.properties"
4773 }
4874 }
4975
@@ -68,16 +94,15 @@ android {
6894
6995 kotlinOptions {
7096 jvmTarget = " 1.8"
71- useIR = true
7297 freeCompilerArgs + = " -Xopt-in=kotlin.RequiresOptIn"
7398 freeCompilerArgs + = " -Xallow-jvm-ir-dependencies"
7499 // Enable experimental coroutines APIs, including Flow
75100 freeCompilerArgs + = ' -Xopt-in=kotlin.Experimental'
76101 }
77102
78103 buildFeatures {
79- viewBinding = true
80- dataBinding = true
104+ viewBinding true
105+ dataBinding true
81106
82107 // Disable unused AGP features
83108 // buildConfig false
@@ -86,63 +111,72 @@ android {
86111 resValues false
87112 shaders false
88113 }
114+
115+ signingConfigs {
116+ debug {
117+ storeFile file(' ../debug.keystore' )
118+ storePassword ' android'
119+ keyAlias ' androiddebugkey'
120+ keyPassword ' android'
121+ }
122+ }
89123}
90124
91125dependencies {
92126 implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
93- implementation ' androidx.appcompat:appcompat:1.3 .1'
94- implementation ' androidx.core:core-ktx:1.6 .0'
95- implementation ' androidx.constraintlayout:constraintlayout:2.1.0 '
127+ implementation ' androidx.appcompat:appcompat:1.6 .1'
128+ implementation ' androidx.core:core-ktx:1.9 .0'
129+ implementation ' androidx.constraintlayout:constraintlayout:2.1.4 '
96130
97131 testImplementation ' junit:junit:4.13.2'
98- androidTestImplementation ' androidx.test.ext:junit:1.1.3 '
99- androidTestImplementation ' androidx.test.espresso:espresso-core:3.4.0 '
132+ androidTestImplementation ' androidx.test.ext:junit:1.1.5 '
133+ androidTestImplementation ' androidx.test.espresso:espresso-core:3.5.1 '
100134
101135 // Material Design
102- implementation ' com.google.android.material:material:1.4 .0'
136+ implementation ' com.google.android.material:material:1.8 .0'
103137
104138 // Retrofit
105139 implementation ' com.squareup.retrofit2:retrofit:2.9.0'
106- implementation ' com.squareup.okhttp3:logging-interceptor:4.9.1 '
140+ implementation ' com.squareup.okhttp3:logging-interceptor:4.9.3 '
107141
108142 // Moshi
109143 implementation ' com.squareup.retrofit2:converter-moshi:2.9.0'
110- implementation " com.squareup.moshi:moshi-kotlin:1.12 .0"
111- kapt " com.squareup.moshi:moshi-kotlin-codegen:1.12 .0"
144+ implementation " com.squareup.moshi:moshi-kotlin:1.14 .0"
145+ kapt " com.squareup.moshi:moshi-kotlin-codegen:1.14 .0"
112146
113147 // Gson
114- implementation ' com.google.code.gson:gson:2.8.7 '
148+ implementation ' com.google.code.gson:gson:2.10.1 '
115149
116150 // ViewModel and LiveData
117151 implementation " androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version "
118152 implementation " androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version "
119- implementation " androidx.lifecycle:lifecycle-common-java8:2.3.1 "
153+ implementation " androidx.lifecycle:lifecycle-common: $l ifecycle_version "
120154 implementation " androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version "
121155
122156 // Kotlin Coroutines
123- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1 "
124- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1 "
157+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 "
158+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 "
125159
126160 // Room Persistence Library
127- implementation " androidx.room:room-runtime:2.3.0 "
128- kapt " androidx.room:room-compiler:2.3.0 "
161+ implementation " androidx.room:room-runtime:$r oom_version "
162+ kapt " androidx.room:room-compiler:$r oom_version "
129163
130164 // Room: Kotlin Extensions and Coroutines support for Room
131- implementation " androidx.room:room-ktx:2.3.0 "
165+ implementation " androidx.room:room-ktx:$r oom_version "
132166
133167 // Android Navigation Architecture
134- implementation " androidx.navigation:navigation-fragment-ktx:2.3.5 "
135- implementation " androidx.navigation:navigation-ui-ktx:2.3.5 "
168+ implementation " androidx.navigation:navigation-fragment-ktx:2.5.3 "
169+ implementation " androidx.navigation:navigation-ui-ktx:2.5.3 "
136170
137171 // Glide
138- implementation ' com.github.bumptech.glide:glide:4.12.0 '
139- kapt ' com.github.bumptech.glide:compiler:4.12.0 '
172+ implementation ' com.github.bumptech.glide:glide:4.15.1 '
173+ kapt ' com.github.bumptech.glide:compiler:4.15.1 '
140174
141175 // Paging
142- implementation " androidx.paging:paging-runtime-ktx:3.0 .1"
176+ implementation " androidx.paging:paging-runtime-ktx:3.1 .1"
143177
144178 // Permission
145- implementation ' com.karumi:dexter:6.2.2 '
179+ implementation ' com.karumi:dexter:6.2.3 '
146180
147181 // Timber
148182 implementation ' com.jakewharton.timber:timber:5.0.1'
@@ -155,17 +189,17 @@ dependencies {
155189 implementation ' com.facebook.shimmer:shimmer:0.5.0'
156190
157191 // Firebase BoM
158- implementation platform(' com.google.firebase:firebase-bom:28 .2.0 ' )
192+ implementation platform(' com.google.firebase:firebase-bom:31 .2.3 ' )
159193
160194 // Firebase Libraries
161195 implementation ' com.google.firebase:firebase-analytics-ktx'
162196 implementation ' com.google.firebase:firebase-messaging-ktx'
163197
164198 // Maps
165- implementation ' com.google.android.gms:play-services-maps:17.0.1 '
199+ implementation ' com.google.android.gms:play-services-maps:18.1.0 '
166200
167201 // Location
168- implementation ' com.google.android.gms:play-services-location:18 .0.0 '
202+ implementation ' com.google.android.gms:play-services-location:21 .0.1 '
169203
170204 // Image compressor
171205 implementation ' id.zelory:compressor:3.0.1'
@@ -174,16 +208,28 @@ dependencies {
174208 implementation ' org.imaginativeworld.oopsnointernet:oopsnointernet:2.0.0'
175209
176210 // Image Carousel
177- implementation " org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.0.2 "
211+ implementation " org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.1.0 "
178212
179213 // OneSignal SDK
180- implementation ' com.onesignal:OneSignal:4.5.1 '
214+ implementation ' com.onesignal:OneSignal:4.8.5 '
181215
182216 // Coil
183- implementation(" io.coil-kt:coil:1.3 .2" )
217+ implementation(" io.coil-kt:coil:2.2 .2" )
184218
185219 // Palette
186220 implementation ' androidx.palette:palette-ktx:1.0.0'
221+
222+ // Markdown
223+ implementation " io.noties.markwon:core:$markwon_version "
224+ implementation " io.noties.markwon:ext-latex:$markwon_version "
225+ implementation " io.noties.markwon:inline-parser:$markwon_version "
226+
227+ // Latex
228+ implementation " ru.noties:jlatexmath-android:$jlatexmath_version "
229+ // for Cyrillic symbols
230+ implementation " ru.noties:jlatexmath-android-font-cyrillic:$jlatexmath_version "
231+ // for Greek symbols
232+ implementation " ru.noties:jlatexmath-android-font-greek:$jlatexmath_version "
187233}
188234
189235// Workaround for OneSignal from:
@@ -194,4 +240,14 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
194240 kotlinOptions {
195241 jvmTarget = " 1.8"
196242 }
243+ }
244+
245+ /**
246+ * Load properties from configuration file.
247+ */
248+ def loadConfigurationProperties (buildType , String fileLocation ) {
249+ Properties properties = new Properties ()
250+ properties. load(project. rootProject. file(fileLocation). newDataInputStream())
251+
252+ buildType. buildConfigField " String" , " BASE_URL" , " \" ${ properties.getProperty("baseUrl")} \" "
197253}
0 commit comments