1
- apply plugin : ' com.android.application'
2
- apply plugin : ' kotlin-android'
3
- apply plugin : ' kotlin-parcelize'
4
- apply plugin : ' kotlin-kapt'
5
-
6
- // Navigation Component: Safe Args
7
- apply plugin : " androidx.navigation.safeargs"
8
-
9
- apply plugin : ' com.google.gms.google-services'
1
+ plugins {
2
+ id ' com.android.application'
3
+ id ' kotlin-android'
4
+ id ' kotlin-parcelize'
5
+ id ' kotlin-kapt'
6
+ id ' androidx.navigation.safeargs'
7
+ id ' com.google.gms.google-services'
8
+ id ' com.google.firebase.crashlytics'
9
+ id ' dagger.hilt.android.plugin'
10
+ }
10
11
11
12
android {
12
- compileSdkVersion 30
13
- buildToolsVersion " 30 .0.3 "
13
+ compileSdkVersion 31
14
+ buildToolsVersion " 31 .0.0 "
14
15
15
16
defaultConfig {
16
17
applicationId " org.imaginativeworld.simplemvvm"
17
18
minSdkVersion 21
18
- targetSdkVersion 30
19
+ targetSdkVersion 31
19
20
versionCode 1
20
- versionName " 1.0.000000" // Major.Minor.YYMMDD
21
+ versionName " 1.0.0.000000" // Major.Minor.Patch.YYMMDD
22
+ vectorDrawables. useSupportLibrary = true
21
23
22
24
testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
23
25
24
26
javaCompileOptions {
25
27
annotationProcessorOptions {
26
- arguments = [
28
+ arguments + = [
27
29
" room.schemaLocation" : " $projectDir /schemas" . toString(),
28
30
" room.incremental" : " true" ,
29
31
" room.expandProjection" : " true"
@@ -33,16 +35,16 @@ android {
33
35
}
34
36
35
37
buildTypes {
36
- release {
37
- minifyEnabled true
38
- shrinkResources true
39
- proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
40
- }
41
38
debug {
42
39
debuggable true
43
40
applicationIdSuffix " .debug"
44
41
versionNameSuffix " -debug"
45
42
}
43
+ release {
44
+ minifyEnabled true
45
+ shrinkResources true
46
+ proguardFiles getDefaultProguardFile(' proguard-android.txt' ), ' proguard-rules.pro'
47
+ }
46
48
}
47
49
48
50
// flavorDimensions "feature"
@@ -66,38 +68,60 @@ android {
66
68
67
69
kotlinOptions {
68
70
jvmTarget = " 1.8"
71
+ useIR = true
72
+ freeCompilerArgs + = " -Xopt-in=kotlin.RequiresOptIn"
73
+ freeCompilerArgs + = " -Xallow-jvm-ir-dependencies"
74
+ // Enable experimental coroutines APIs, including Flow
75
+ freeCompilerArgs + = ' -Xopt-in=kotlin.Experimental'
69
76
}
70
77
71
78
buildFeatures {
72
79
viewBinding = true
73
80
dataBinding = true
81
+
82
+ // Disable unused AGP features
83
+ // buildConfig false
84
+ aidl false
85
+ renderScript false
86
+ resValues false
87
+ shaders false
74
88
}
75
89
}
76
90
77
91
dependencies {
78
- implementation fileTree(dir : ' libs' , include : [' *.jar' ])
79
92
implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
80
- implementation ' androidx.appcompat:appcompat:1.3.0'
81
- implementation ' androidx.core:core-ktx:1.5.0'
82
- implementation ' androidx.constraintlayout:constraintlayout:2.0.4'
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'
96
+
83
97
testImplementation ' junit:junit:4.13.2'
84
- androidTestImplementation ' androidx.test.ext:junit:1.1.2 '
85
- androidTestImplementation ' androidx.test.espresso:espresso-core:3.3 .0'
98
+ androidTestImplementation ' androidx.test.ext:junit:1.1.3 '
99
+ androidTestImplementation ' androidx.test.espresso:espresso-core:3.4 .0'
86
100
87
- // Retrofit and Moshi
101
+ // Material Design
102
+ implementation ' com.google.android.material:material:1.4.0'
103
+
104
+ // Retrofit
88
105
implementation ' com.squareup.retrofit2:retrofit:2.9.0'
89
- implementation ' com.squareup.retrofit2:converter-moshi:2.9.0'
90
106
implementation ' com.squareup.okhttp3:logging-interceptor:4.9.1'
107
+
108
+ // Moshi
109
+ implementation ' com.squareup.retrofit2:converter-moshi:2.9.0'
91
110
implementation " com.squareup.moshi:moshi-kotlin:1.12.0"
92
111
kapt " com.squareup.moshi:moshi-kotlin-codegen:1.12.0"
93
112
113
+ // Gson
114
+ implementation ' com.google.code.gson:gson:2.8.7'
115
+
94
116
// ViewModel and LiveData
95
- implementation ' androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 '
96
- implementation " androidx.lifecycle:lifecycle-livedata-ktx:2.3.1 "
117
+ implementation " androidx.lifecycle:lifecycle-viewmodel-ktx:$l ifecycle_version "
118
+ implementation " androidx.lifecycle:lifecycle-livedata-ktx:$l ifecycle_version "
97
119
implementation " androidx.lifecycle:lifecycle-common-java8:2.3.1"
120
+ implementation " androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version "
98
121
99
- // Material Design
100
- implementation ' com.google.android.material:material:1.3.0'
122
+ // Kotlin Coroutines
123
+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1"
124
+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1"
101
125
102
126
// Room Persistence Library
103
127
implementation " androidx.room:room-runtime:2.3.0"
@@ -110,40 +134,28 @@ dependencies {
110
134
implementation " androidx.navigation:navigation-fragment-ktx:2.3.5"
111
135
implementation " androidx.navigation:navigation-ui-ktx:2.3.5"
112
136
113
- // Kotlin Coroutines
114
- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0"
115
- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0"
116
- // Lifecycles only (without ViewModel or LiveData)
117
- // implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0"
118
-
119
137
// Glide
120
138
implementation ' com.github.bumptech.glide:glide:4.12.0'
121
139
kapt ' com.github.bumptech.glide:compiler:4.12.0'
122
140
123
141
// Paging
124
- implementation " androidx.paging:paging-runtime-ktx:3.0.0"
125
-
126
- // No Internet Library
127
- implementation ' org.imaginativeworld.oopsnointernet:oopsnointernet:2.0.0'
142
+ implementation " androidx.paging:paging-runtime-ktx:3.0.1"
128
143
129
144
// Permission
130
145
implementation ' com.karumi:dexter:6.2.2'
131
146
132
147
// Timber
133
- implementation ' com.jakewharton.timber:timber:4.7 .1'
148
+ implementation ' com.jakewharton.timber:timber:5.0 .1'
134
149
135
- // Dagger
136
- implementation ' com.google.dagger:dagger:2.36'
137
- kapt ' com.google.dagger:dagger-compiler:2.36'
138
-
139
- implementation ' com.google.dagger:dagger-android:2.36'
140
- kapt ' com.google.dagger:dagger-android-processor:2.36'
150
+ // Hilt
151
+ implementation " com.google.dagger:hilt-android:$hilt_version "
152
+ kapt " com.google.dagger:hilt-compiler:$hilt_version "
141
153
142
154
// Shimmer
143
155
implementation ' com.facebook.shimmer:shimmer:0.5.0'
144
156
145
157
// Firebase BoM
146
- implementation platform(' com.google.firebase:firebase-bom:26.1 .0' )
158
+ implementation platform(' com.google.firebase:firebase-bom:28.2 .0' )
147
159
148
160
// Firebase Libraries
149
161
implementation ' com.google.firebase:firebase-analytics-ktx'
@@ -158,6 +170,28 @@ dependencies {
158
170
// Image compressor
159
171
implementation ' id.zelory:compressor:3.0.1'
160
172
173
+ // No Internet Library
174
+ implementation ' org.imaginativeworld.oopsnointernet:oopsnointernet:2.0.0'
175
+
161
176
// Image Carousel
162
177
implementation " org.imaginativeworld.whynotimagecarousel:whynotimagecarousel:2.0.2"
178
+
179
+ // OneSignal SDK
180
+ implementation ' com.onesignal:OneSignal:4.5.1'
181
+
182
+ // Coil
183
+ implementation(" io.coil-kt:coil:1.3.2" )
184
+
185
+ // Palette
186
+ implementation ' androidx.palette:palette-ktx:1.0.0'
163
187
}
188
+
189
+ // Workaround for OneSignal from:
190
+ // https://github.com/OneSignal/OneSignal-Gradle-Plugin/issues/37#issuecomment-391983620
191
+ googleServices { disableVersionCheck = true }
192
+
193
+ tasks. withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile ). configureEach {
194
+ kotlinOptions {
195
+ jvmTarget = " 1.8"
196
+ }
197
+ }
0 commit comments