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,29 @@ 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.lifecycle.compose.ExperimentalLifecycleComposeApi" ,
60+ " -opt-in=androidx.compose.foundation.ExperimentalFoundationApi" ,
61+ " -opt-in=androidx.compose.animation.ExperimentalAnimationApi" ,
62+ " -opt-in=androidx.compose.material.ExperimentalMaterialApi"
4963 ]
5064 }
5165 testOptions {
66+ managedDevices {
67+ devices {
68+ pixel4api31(ManagedVirtualDevice ) {
69+ device = " Pixel 4"
70+ apiLevel = 31
71+ systemImageSource = " google"
72+ require64Bit = true
73+ }
74+ }
75+ }
5276 unitTests {
5377 includeAndroidResources = true
5478 all { ignoreFailures = true }
@@ -92,18 +116,25 @@ android {
92116 }
93117 }
94118 }
95- lintOptions {
96- lintConfig project. file(' lint.xml' )
97- disable " GoogleAppIndexingWarning"
98- disable " RemoveWorkManagerInitializer"
119+ packagingOptions {
120+ resources {
121+ excludes + = [' **/LICENSE' , ' **/LICENSE.txt' , ' **/NOTICE' , ' **/NOTICE.txt' , ' **/*.gwt.xml' ]
122+ }
123+ }
124+ composeOptions {
125+ kotlinCompilerExtensionVersion Versions . androidXComposeCompiler
126+ }
127+ lint {
128+ disable ' GoogleAppIndexingWarning' , ' RemoveWorkManagerInitializer'
99129 enable ' Interoperability'
130+ lintConfig file(' lint.xml' )
100131 }
101- packagingOptions {
102- exclude ' **/LICENSE '
103- exclude ' **/LICENSE.txt '
104- exclude ' **/NOTICE '
105- exclude ' **/NOTICE.txt '
106- exclude ' **/*.gwt.xml '
132+ applicationVariants . all { variant ->
133+ kotlin . sourceSets {
134+ getByName(variant . name) {
135+ kotlin . srcDir( " build/generated/ksp/ ${ variant.name } /kotlin " )
136+ }
137+ }
107138 }
108139}
109140
@@ -133,30 +164,50 @@ dependencies {
133164 implementation Libs . androidx_browser
134165 implementation Libs . androidx_constraint_layout
135166 implementation Libs . androidx_core
167+ implementation " androidx.core:core-splashscreen:1.0.0"
136168 implementation Libs . androidx_fragment
137169 implementation Libs . androidx_hilt_work
138170 implementation Libs . androidx_lifecycle_viewmodel
171+ implementation Libs . androidx_lifecycle_livedata
139172 implementation Libs . androidx_lifecycle_java8
173+ implementation Libs . androidx_lifecycle_runtime
140174 implementation Libs . androidx_lifecycle_process
141175 implementation Libs . androidx_navigation_fragment
142176 implementation Libs . androidx_navigation_ui
177+ implementation " androidx.navigation:navigation-compose:$Versions . androidXNavigation "
143178 implementation Libs . androidx_preference
144179 implementation Libs . androidx_recyclerview
145180 implementation Libs . androidx_recyclerview_selection
146181 implementation Libs . androidx_room_runtime
147182 implementation Libs . androidx_room_ktx
148183 implementation Libs . androidx_work_runtime
149184 implementation Libs . androidx_work_gcm
185+ implementation ' androidx.activity:activity-compose:1.6.0'
186+ implementation " androidx.compose.ui:ui:$Versions . androidXCompose "
187+ implementation " androidx.compose.foundation:foundation:$Versions . androidXCompose "
188+ implementation " androidx.compose.material:material:$Versions . androidXCompose "
189+ implementation " androidx.compose.material:material-icons-core:$Versions . androidXCompose "
190+ implementation " androidx.compose.material:material-icons-extended:$Versions . androidXCompose "
191+ implementation " androidx.compose.ui:ui-tooling:$Versions . androidXCompose "
192+
193+ implementation " androidx.lifecycle:lifecycle-runtime-compose:2.6.0-alpha02"
194+ implementation " androidx.lifecycle:lifecycle-viewmodel-compose:$Versions . androidXLifecycle "
195+ implementation ' androidx.hilt:hilt-navigation-compose:1.0.0'
196+ androidTestImplementation " androidx.compose.ui:ui-test-junit4:$Versions . androidXCompose "
150197 kapt Libs . androidx_room_compiler
151198 kapt Libs . androidx_hilt_compiler
152199
153200 // Android Material
154201 implementation Libs . material_components
155202
156203 // Color Picker
157- implementation " com.github.dhaval2404:colorpicker:2.0"
204+ implementation " com.github.dhaval2404:colorpicker:2.3"
205+
206+ // Compose Destinations
207+ implementation ' io.github.raamcosta.compose-destinations:core:1.7.21-beta'
208+ ksp ' io.github.raamcosta.compose-destinations:ksp:1.7.21-beta'
158209
159- // Dagger
210+ // Dagger
160211 implementation Libs . daggerHiltAndroid
161212 kapt Libs . daggerHiltAndroidCompiler
162213
@@ -182,8 +233,8 @@ dependencies {
182233 implementation Libs . kotlinCoroutinesAndroid
183234
184235 // LeakCanary
185- debugImplementation Libs . leakCanary
186- implementation Libs . leakCanaryPlumberAndroid
236+ // debugImplementation Libs.leakCanary
237+ // implementation Libs.leakCanaryPlumberAndroid
187238
188239 // Logging
189240 implementation Libs . slf4jAndroidLogger
@@ -200,6 +251,10 @@ kapt {
200251 correctErrorTypes true
201252}
202253
254+ jacoco {
255+ toolVersion = " 0.8.7"
256+ }
257+
203258play {
204259 def serviceAccountFileName = " google-play-api.json"
205260 if (rootProject. file(serviceAccountFileName). exists()) {
0 commit comments