|
1 |
| -apply plugin: 'com.android.application' |
2 |
| -apply plugin: 'kotlin-android' |
3 |
| -apply plugin: 'kotlin-kapt' |
4 |
| -apply plugin: "androidx.navigation.safeargs.kotlin" |
5 |
| -apply plugin: 'com.google.firebase.crashlytics' |
6 |
| -apply plugin: 'com.google.gms.google-services' |
7 |
| -apply plugin: 'dagger.hilt.android.plugin' |
8 |
| -apply plugin: 'com.mikepenz.aboutlibraries.plugin' |
9 |
| -apply plugin: 'com.google.firebase.firebase-perf' |
10 |
| -apply plugin: 'com.github.triplet.play' |
| 1 | +plugins { |
| 2 | + id "com.android.application" |
| 3 | + id "com.google.gms.google-services" |
| 4 | + id "com.google.firebase.crashlytics" |
| 5 | + id "kotlin-android" |
| 6 | + id 'androidx.navigation.safeargs.kotlin' |
| 7 | + id 'com.google.dagger.hilt.android' |
| 8 | + id 'com.github.triplet.play' version '3.8.4' |
| 9 | + id 'com.google.devtools.ksp' |
| 10 | + id 'jacoco' |
| 11 | +} |
11 | 12 |
|
12 | 13 | android {
|
13 |
| - compileSdkVersion Config.compile_sdk |
14 |
| - buildToolsVersion Config.build_tools |
| 14 | + namespace "de.psdev.devdrawer" |
| 15 | + compileSdk = 34 |
15 | 16 |
|
16 | 17 | defaultConfig {
|
| 18 | + namespace |
17 | 19 | applicationId "de.psdev.devdrawer"
|
18 |
| - minSdkVersion Config.min_sdk |
19 |
| - targetSdkVersion Config.target_sdk |
| 20 | + minSdkVersion 26 |
| 21 | + targetSdkVersion 34 |
20 | 22 | versionCode project.ext.appVersionCode
|
21 | 23 | versionName project.ext.appVersionName
|
22 | 24 |
|
23 | 25 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
24 | 26 | multiDexEnabled true
|
25 |
| - |
26 |
| - resConfig "en" |
| 27 | + resourceConfigurations += ['en'] |
27 | 28 |
|
28 | 29 | // Version info
|
29 | 30 | buildConfigField 'String', 'GIT_SHA', "\"${project.ext.gitHash}\""
|
30 | 31 |
|
31 |
| - javaCompileOptions.annotationProcessorOptions.arguments['room.schemaLocation'] = rootProject.file('schemas').toString() |
| 32 | + vectorDrawables { |
| 33 | + useSupportLibrary true |
| 34 | + } |
32 | 35 | }
|
33 | 36 | buildFeatures {
|
34 | 37 | viewBinding true
|
| 38 | + compose true |
| 39 | + buildConfig true |
35 | 40 | }
|
36 | 41 | compileOptions {
|
37 |
| - sourceCompatibility = JavaVersion.VERSION_1_8 |
38 |
| - targetCompatibility = JavaVersion.VERSION_1_8 |
| 42 | + targetCompatibility JavaVersion.VERSION_17 |
39 | 43 | }
|
40 | 44 | kotlinOptions {
|
41 |
| - jvmTarget = "1.8" |
42 |
| - freeCompilerArgs += [ |
43 |
| - "-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" |
49 |
| - ] |
| 45 | + jvmTarget = '17' |
50 | 46 | }
|
51 | 47 | testOptions {
|
| 48 | + managedDevices { |
| 49 | + devices { |
| 50 | + pixel4api31(com.android.build.api.dsl.ManagedVirtualDevice) { |
| 51 | + device = "Pixel 4" |
| 52 | + apiLevel = 31 |
| 53 | + systemImageSource = "google" |
| 54 | + require64Bit = true |
| 55 | + } |
| 56 | + } |
| 57 | + } |
52 | 58 | unitTests {
|
53 | 59 | includeAndroidResources = true
|
54 |
| - all { ignoreFailures = true } |
55 | 60 | }
|
56 | 61 | }
|
57 | 62 | final def keystorePropertiesFile = rootProject.file("release.properties")
|
@@ -92,112 +97,178 @@ android {
|
92 | 97 | }
|
93 | 98 | }
|
94 | 99 | }
|
95 |
| - lintOptions { |
96 |
| - lintConfig project.file('lint.xml') |
97 |
| - disable "GoogleAppIndexingWarning" |
98 |
| - disable "RemoveWorkManagerInitializer" |
| 100 | + packagingOptions { |
| 101 | + resources { |
| 102 | + excludes += ['**/LICENSE', '**/LICENSE.txt', '**/NOTICE', '**/NOTICE.txt', '**/*.gwt.xml'] |
| 103 | + } |
| 104 | + } |
| 105 | + composeOptions { |
| 106 | + kotlinCompilerExtensionVersion = "1.5.3" |
| 107 | + } |
| 108 | + lint { |
| 109 | + disable 'GoogleAppIndexingWarning', 'RemoveWorkManagerInitializer' |
99 | 110 | enable 'Interoperability'
|
| 111 | + lintConfig file('lint.xml') |
100 | 112 | }
|
101 |
| - packagingOptions { |
102 |
| - exclude '**/LICENSE' |
103 |
| - exclude '**/LICENSE.txt' |
104 |
| - exclude '**/NOTICE' |
105 |
| - exclude '**/NOTICE.txt' |
106 |
| - exclude '**/*.gwt.xml' |
| 113 | + applicationVariants.configureEach { variant -> |
| 114 | + kotlin.sourceSets { |
| 115 | + named(variant.name) { |
| 116 | + kotlin.srcDir("build/generated/ksp/${variant.name}/kotlin") |
| 117 | + } |
| 118 | + } |
107 | 119 | }
|
108 | 120 | }
|
109 | 121 |
|
| 122 | +java { |
| 123 | + toolchain { |
| 124 | + languageVersion = JavaLanguageVersion.of(17) |
| 125 | + } |
| 126 | +} |
| 127 | + |
| 128 | +ksp { |
| 129 | + arg("room.schemaLocation", rootProject.file('schemas').toString()) |
| 130 | +} |
| 131 | + |
| 132 | + |
110 | 133 | dependencies {
|
111 | 134 | //
|
112 | 135 | // Platforms
|
113 | 136 | //
|
114 |
| - implementation platform(Platforms.firebase) |
115 |
| - implementation platform(Platforms.kotlin) |
| 137 | + implementation platform("com.google.firebase:firebase-bom:32.4.0") |
116 | 138 |
|
117 | 139 | //
|
118 | 140 | // Test dependencies
|
119 | 141 | //
|
120 |
| - testImplementation Libs.junit |
121 |
| - testImplementation Libs.robolectric |
122 |
| - testImplementation Libs.mockk |
| 142 | + testImplementation libs.junit |
| 143 | + testImplementation libs.robolectric |
| 144 | + def mockkVersion = "1.13.8" |
| 145 | + testImplementation "io.mockk:mockk-android:${mockkVersion}" |
| 146 | + testImplementation "io.mockk:mockk-agent:${mockkVersion}" |
123 | 147 |
|
124 | 148 | //
|
125 | 149 | // Runtime dependencies
|
126 | 150 | //
|
127 | 151 |
|
128 | 152 | // AboutLibraries
|
129 |
| - implementation Libs.about_libraries |
| 153 | + def latestAboutLibsRelease = "10.9.1" |
| 154 | + implementation "com.mikepenz:aboutlibraries-core:${latestAboutLibsRelease}" |
| 155 | + implementation "com.mikepenz:aboutlibraries-compose:${latestAboutLibsRelease}" |
| 156 | + implementation "com.mikepenz:aboutlibraries:${latestAboutLibsRelease}" |
| 157 | + |
130 | 158 |
|
131 | 159 | // AndroidX
|
132 |
| - implementation Libs.androidx_appcompat |
133 |
| - implementation Libs.androidx_browser |
134 |
| - implementation Libs.androidx_constraint_layout |
135 |
| - implementation Libs.androidx_core |
136 |
| - implementation Libs.androidx_fragment |
137 |
| - implementation Libs.androidx_hilt_work |
138 |
| - implementation Libs.androidx_lifecycle_viewmodel |
139 |
| - implementation Libs.androidx_lifecycle_java8 |
140 |
| - implementation Libs.androidx_lifecycle_process |
141 |
| - implementation Libs.androidx_navigation_fragment |
142 |
| - implementation Libs.androidx_navigation_ui |
143 |
| - implementation Libs.androidx_preference |
144 |
| - implementation Libs.androidx_recyclerview |
145 |
| - implementation Libs.androidx_recyclerview_selection |
146 |
| - implementation Libs.androidx_room_runtime |
147 |
| - implementation Libs.androidx_room_ktx |
148 |
| - implementation Libs.androidx_work_runtime |
149 |
| - implementation Libs.androidx_work_gcm |
150 |
| - kapt Libs.androidx_room_compiler |
151 |
| - kapt Libs.androidx_hilt_compiler |
152 |
| - |
153 |
| - // Android Material |
154 |
| - implementation Libs.material_components |
| 160 | + def appcompat_version = "1.6.1" |
| 161 | + implementation "androidx.appcompat:appcompat:$appcompat_version" |
| 162 | + implementation "androidx.browser:browser:1.6.0" |
| 163 | + implementation "androidx.constraintlayout:constraintlayout:2.1.4" |
| 164 | + def core_version = "1.12.0" |
| 165 | + implementation "androidx.core:core-ktx:$core_version" |
| 166 | + |
| 167 | + implementation "androidx.core:core-splashscreen:1.0.1" |
| 168 | + def fragment_version = "1.6.1" |
| 169 | + implementation "androidx.fragment:fragment-ktx:$fragment_version" |
| 170 | + // Testing Fragments in Isolation |
| 171 | + debugImplementation "androidx.fragment:fragment-testing:$fragment_version" |
| 172 | + |
| 173 | + def dagger = "2.51.1" |
| 174 | + implementation libs.hilt.android |
| 175 | + ksp "com.google.dagger:hilt-compiler:$dagger" |
| 176 | + implementation libs.androidx.hilt.work |
| 177 | + implementation libs.androidx.hilt.navigation.fragment |
| 178 | + implementation libs.androidx.hilt.navigation.compose |
| 179 | + def hilt = "1.2.0" |
| 180 | + ksp "androidx.hilt:hilt-compiler:$hilt" |
| 181 | + |
| 182 | + implementation libs.androidx.lifecycle.viewmodel.ktx |
| 183 | + implementation libs.androidx.lifecycle.livedata.ktx |
| 184 | + implementation(libs.androidx.lifecycle.runtime.compose) |
| 185 | + implementation libs.androidx.lifecycle.common.java8 |
| 186 | + // optional - Test helpers for Lifecycle runtime |
| 187 | + testImplementation libs.androidx.lifecycle.runtime.testing |
| 188 | + // optional - ProcessLifecycleOwner provides a lifecycle for the whole application process |
| 189 | + implementation libs.androidx.lifecycle.process |
| 190 | + implementation libs.androidx.navigation.fragment.ktx |
| 191 | + implementation libs.androidx.navigation.ui.ktx |
| 192 | + // Jetpack Compose Integration |
| 193 | + implementation libs.navigation.compose |
| 194 | + implementation libs.androidx.preference.ktx |
| 195 | + implementation libs.androidx.recyclerview |
| 196 | + // For control over item selection of both touch and mouse driven selection |
| 197 | + implementation libs.androidx.recyclerview.selection |
| 198 | + implementation libs.androidx.room.runtime |
| 199 | + ksp libs.androidx.room.compiler |
| 200 | + implementation libs.androidx.room.ktx |
| 201 | + |
| 202 | + implementation libs.androidx.work.runtime.ktx |
| 203 | + androidTestImplementation libs.androidx.work.testing |
| 204 | + |
| 205 | + def composeBom = platform(libs.androidx.compose.bom) |
| 206 | + implementation(composeBom) |
| 207 | + androidTestImplementation(composeBom) |
| 208 | + implementation libs.androidx.material3 |
| 209 | + // Android Studio Preview support |
| 210 | + implementation libs.androidx.ui.tooling.preview |
| 211 | + debugImplementation libs.androidx.ui.tooling |
| 212 | + // UI Tests |
| 213 | + androidTestImplementation libs.androidx.ui.test.junit4 |
| 214 | + debugImplementation libs.androidx.ui.test.manifest |
| 215 | + // Optional - Add full set of material icons |
| 216 | + implementation libs.androidx.material.icons.extended |
| 217 | + // Optional - Add window size utils |
| 218 | + implementation 'androidx.compose.material3:material3-window-size-class' |
| 219 | + // Optional - Integration with activities |
| 220 | + implementation libs.androidx.activity.compose |
| 221 | + // Optional - Integration with ViewModels |
| 222 | + implementation libs.androidx.lifecycle.viewmodel.compose |
155 | 223 |
|
156 | 224 | // Color Picker
|
157 |
| - implementation "com.github.dhaval2404:colorpicker:2.0" |
| 225 | + implementation libs.colorpicker |
158 | 226 |
|
159 |
| - // Dagger |
160 |
| - implementation Libs.daggerHiltAndroid |
161 |
| - kapt Libs.daggerHiltAndroidCompiler |
| 227 | + // Compose Destinations |
| 228 | + implementation libs.compose.destinations.core |
| 229 | + ksp libs.compose.destinations.ksp |
162 | 230 |
|
163 | 231 | // Firebase
|
164 |
| - implementation "com.google.firebase:firebase-analytics-ktx" |
165 |
| - implementation "com.google.firebase:firebase-config-ktx" |
166 |
| - implementation "com.google.firebase:firebase-crashlytics-ktx" |
167 |
| - implementation "com.google.firebase:firebase-perf-ktx" |
| 232 | + implementation libs.firebase.analytics |
| 233 | + implementation libs.firebase.config |
| 234 | + implementation libs.firebase.crashlytics |
| 235 | + implementation libs.firebase.perf |
168 | 236 |
|
169 | 237 | // FlowBinding
|
170 |
| - implementation Libs.flowBindingAndroid |
171 |
| - implementation Libs.flowBindingCommon |
172 |
| - implementation Libs.flowBindingMaterial |
| 238 | + implementation libs.flowbinding.android |
| 239 | + implementation libs.flowbinding.material |
173 | 240 |
|
174 | 241 | // Google Play
|
175 |
| - implementation Libs.googlePlayCore |
176 |
| - implementation Libs.googlePlayCoreKtx |
| 242 | + def playReview = "2.0.1" |
| 243 | + implementation libs.review |
| 244 | + implementation libs.review.ktx |
| 245 | + def playUpdate = "2.1.0" |
| 246 | + implementation libs.app.update |
| 247 | + implementation libs.app.update.ktx |
177 | 248 |
|
178 | 249 | // Kotlin
|
179 |
| - implementation Libs.kotlinStdlib |
| 250 | + implementation "org.jetbrains.kotlin:kotlin-stdlib" |
180 | 251 |
|
181 | 252 | // Kotlin Coroutines
|
182 |
| - implementation Libs.kotlinCoroutinesAndroid |
| 253 | + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3' |
183 | 254 |
|
184 | 255 | // LeakCanary
|
185 |
| - debugImplementation Libs.leakCanary |
186 |
| - implementation Libs.leakCanaryPlumberAndroid |
| 256 | +// debugImplementation Libs.leakCanary |
| 257 | +// implementation Libs.leakCanaryPlumberAndroid |
187 | 258 |
|
188 | 259 | // Logging
|
189 |
| - implementation Libs.slf4jAndroidLogger |
190 |
| - implementation Libs.kotlinLogging |
| 260 | + implementation libs.slf4j.android.logger |
| 261 | + implementation libs.kotlin.logging |
191 | 262 |
|
192 | 263 | // OkHttp
|
193 |
| - implementation Libs.okhttp |
| 264 | + implementation(libs.okhttp) |
194 | 265 |
|
195 | 266 | // Okio
|
196 |
| - implementation Libs.okio |
| 267 | + implementation(libs.okio) |
197 | 268 | }
|
198 | 269 |
|
199 |
| -kapt { |
200 |
| - correctErrorTypes true |
| 270 | +jacoco { |
| 271 | + toolVersion = "0.8.7" |
201 | 272 | }
|
202 | 273 |
|
203 | 274 | play {
|
|
0 commit comments