1+ import com.android.build.api.dsl.ManagedVirtualDevice
2+
3+ plugins {
4+ id ' com.google.devtools.ksp' version ' 1.7.10-1.0.6'
5+ }
6+
17apply plugin : ' com.android.application'
28apply plugin : ' kotlin-android'
39apply plugin : ' kotlin-kapt'
4- apply plugin : " androidx.navigation.safeargs.kotlin "
10+ apply plugin : " androidx.navigation.safeargs"
511apply plugin : ' com.google.firebase.crashlytics'
612apply plugin : ' com.google.gms.google-services'
713apply plugin : ' dagger.hilt.android.plugin'
8- apply plugin : ' com.mikepenz.aboutlibraries.plugin'
914apply plugin : ' com.google.firebase.firebase-perf'
1015apply plugin : ' com.github.triplet.play'
16+ apply plugin : ' com.dicedmelon.gradle.jacoco-android'
1117
1218android {
1319 compileSdkVersion Config . compile_sdk
14- buildToolsVersion Config . build_tools
1520
1621 defaultConfig {
1722 applicationId " de.psdev.devdrawer"
@@ -22,16 +27,20 @@ android {
2227
2328 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
2429 multiDexEnabled true
25-
26- resConfig " en"
30+ resConfigs ' en'
2731
2832 // Version info
2933 buildConfigField ' String' , ' GIT_SHA' , " \" ${ project.ext.gitHash} \" "
3034
35+ vectorDrawables {
36+ useSupportLibrary true
37+ }
38+
3139 javaCompileOptions. annotationProcessorOptions. arguments[' room.schemaLocation' ] = rootProject. file(' schemas' ). toString()
3240 }
3341 buildFeatures {
3442 viewBinding true
43+ compose true
3544 }
3645 compileOptions {
3746 sourceCompatibility = JavaVersion . VERSION_1_8
@@ -41,14 +50,28 @@ android {
4150 jvmTarget = " 1.8"
4251 freeCompilerArgs + = [
4352 " -Xinline-classes" ,
44- " -Xopt-in=kotlin.RequiresOptIn" ,
45- " -Xopt-in=kotlin.ExperimentalStdlibApi" ,
46- " -Xopt-in=kotlin.time.ExperimentalTime" ,
47- " -Xopt-in=kotlinx.coroutines.FlowPreview" ,
48- " -Xopt-in=kotlinx.coroutines.ExperimentalCoroutinesApi"
53+ " -Xjvm-default=all" ,
54+ " -opt-in=kotlin.RequiresOptIn" ,
55+ " -opt-in=kotlin.ExperimentalStdlibApi" ,
56+ " -opt-in=kotlin.time.ExperimentalTime" ,
57+ " -opt-in=kotlinx.coroutines.FlowPreview" ,
58+ " -opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" ,
59+ " -opt-in=androidx.compose.foundation.ExperimentalFoundationApi" ,
60+ " -opt-in=androidx.compose.animation.ExperimentalAnimationApi" ,
61+ " -opt-in=androidx.compose.material.ExperimentalMaterialApi"
4962 ]
5063 }
5164 testOptions {
65+ managedDevices {
66+ devices {
67+ pixel4api31(ManagedVirtualDevice ) {
68+ device = " Pixel 4"
69+ apiLevel = 31
70+ systemImageSource = " google"
71+ require64Bit = true
72+ }
73+ }
74+ }
5275 unitTests {
5376 includeAndroidResources = true
5477 all { ignoreFailures = true }
@@ -92,18 +115,25 @@ android {
92115 }
93116 }
94117 }
95- lintOptions {
96- lintConfig project. file(' lint.xml' )
97- disable " GoogleAppIndexingWarning"
98- disable " RemoveWorkManagerInitializer"
118+ packagingOptions {
119+ resources {
120+ excludes + = [' **/LICENSE' , ' **/LICENSE.txt' , ' **/NOTICE' , ' **/NOTICE.txt' , ' **/*.gwt.xml' ]
121+ }
122+ }
123+ composeOptions {
124+ kotlinCompilerExtensionVersion Versions . androidXComposeCompiler
125+ }
126+ lint {
127+ disable ' GoogleAppIndexingWarning' , ' RemoveWorkManagerInitializer'
99128 enable ' Interoperability'
129+ lintConfig file(' lint.xml' )
100130 }
101- packagingOptions {
102- exclude ' **/LICENSE '
103- exclude ' **/LICENSE.txt '
104- exclude ' **/NOTICE '
105- exclude ' **/NOTICE.txt '
106- exclude ' **/*.gwt.xml '
131+ applicationVariants . all { variant ->
132+ kotlin . sourceSets {
133+ getByName(variant . name) {
134+ kotlin . srcDir( " build/generated/ksp/ ${ variant.name } /kotlin " )
135+ }
136+ }
107137 }
108138}
109139
@@ -133,30 +163,49 @@ dependencies {
133163 implementation Libs . androidx_browser
134164 implementation Libs . androidx_constraint_layout
135165 implementation Libs . androidx_core
166+ implementation " androidx.core:core-splashscreen:1.0.0"
136167 implementation Libs . androidx_fragment
137168 implementation Libs . androidx_hilt_work
138169 implementation Libs . androidx_lifecycle_viewmodel
170+ implementation Libs . androidx_lifecycle_livedata
139171 implementation Libs . androidx_lifecycle_java8
172+ implementation Libs . androidx_lifecycle_runtime
140173 implementation Libs . androidx_lifecycle_process
141174 implementation Libs . androidx_navigation_fragment
142175 implementation Libs . androidx_navigation_ui
176+ implementation " androidx.navigation:navigation-compose:$Versions . androidXNavigation "
143177 implementation Libs . androidx_preference
144178 implementation Libs . androidx_recyclerview
145179 implementation Libs . androidx_recyclerview_selection
146180 implementation Libs . androidx_room_runtime
147181 implementation Libs . androidx_room_ktx
148182 implementation Libs . androidx_work_runtime
149183 implementation Libs . androidx_work_gcm
184+ implementation ' androidx.activity:activity-compose:1.5.1'
185+ implementation " androidx.compose.ui:ui:$Versions . androidXCompose "
186+ implementation " androidx.compose.foundation:foundation:$Versions . androidXCompose "
187+ implementation " androidx.compose.material:material:$Versions . androidXCompose "
188+ implementation " androidx.compose.material:material-icons-core:$Versions . androidXCompose "
189+ implementation " androidx.compose.material:material-icons-extended:$Versions . androidXCompose "
190+ implementation " androidx.compose.ui:ui-tooling:$Versions . androidXCompose "
191+
192+ implementation " androidx.lifecycle:lifecycle-viewmodel-compose:$Versions . androidXLifecycle "
193+ implementation ' androidx.hilt:hilt-navigation-compose:1.0.0'
194+ androidTestImplementation " androidx.compose.ui:ui-test-junit4:$Versions . androidXCompose "
150195 kapt Libs . androidx_room_compiler
151196 kapt Libs . androidx_hilt_compiler
152197
153198 // Android Material
154199 implementation Libs . material_components
155200
156201 // Color Picker
157- implementation " com.github.dhaval2404:colorpicker:2.0"
202+ implementation " com.github.dhaval2404:colorpicker:2.3"
203+
204+ // Compose Destinations
205+ implementation ' io.github.raamcosta.compose-destinations:core:1.7.21-beta'
206+ ksp ' io.github.raamcosta.compose-destinations:ksp:1.7.21-beta'
158207
159- // Dagger
208+ // Dagger
160209 implementation Libs . daggerHiltAndroid
161210 kapt Libs . daggerHiltAndroidCompiler
162211
@@ -182,8 +231,8 @@ dependencies {
182231 implementation Libs . kotlinCoroutinesAndroid
183232
184233 // LeakCanary
185- debugImplementation Libs . leakCanary
186- implementation Libs . leakCanaryPlumberAndroid
234+ // debugImplementation Libs.leakCanary
235+ // implementation Libs.leakCanaryPlumberAndroid
187236
188237 // Logging
189238 implementation Libs . slf4jAndroidLogger
@@ -200,6 +249,10 @@ kapt {
200249 correctErrorTypes true
201250}
202251
252+ jacoco {
253+ toolVersion = " 0.8.7"
254+ }
255+
203256play {
204257 def serviceAccountFileName = " google-play-api.json"
205258 if (rootProject. file(serviceAccountFileName). exists()) {
0 commit comments