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