Skip to content

Commit c9002e9

Browse files
authored
Migrate to version catalogs (#160)
* Migrate to version catalogs, update versions * Fix some build warnings * Fixed an issue preventing build from completing
1 parent 883f2cf commit c9002e9

37 files changed

Lines changed: 496 additions & 297 deletions

File tree

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

android/app/build.gradle.kts

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ plugins {
1111

1212
android {
1313

14-
compileSdk = 34
14+
compileSdk = 35
1515

1616
defaultConfig {
1717
applicationId = "com.simplecityapps.shuttle"
1818
minSdk = 21
19-
targetSdk = 34
19+
targetSdk = 35
2020
versionName = versionName()
2121
versionCode = versionCode()
2222
vectorDrawables.useSupportLibrary = true
@@ -95,7 +95,7 @@ android {
9595
implementation(project(":android:networking"))
9696

9797
// TagLib
98-
implementation("com.github.timusus:ktaglib:1.4.1")
98+
implementation(libs.timusus.ktaglib)
9999

100100
// Shuttle
101101
implementation(project(":android:data"))
@@ -121,126 +121,126 @@ android {
121121
implementation(project(":android:trial"))
122122

123123
// RecyclerView FastScroll
124-
implementation("com.github.timusus:RecyclerView-FastScroll:dev-SNAPSHOT")
124+
implementation(libs.timusus.recyclerViewFastScroll)
125125

126126
// AppCompat
127-
implementation("androidx.appcompat:appcompat:1.6.1")
127+
implementation(libs.androidx.appcompat)
128128

129129
// Material
130-
implementation("com.google.android.material:material:1.10.0")
130+
implementation(libs.google.material)
131131

132132

133133
// Constraint Layout
134-
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
134+
implementation(libs.androidx.constraintlayout)
135135

136136
// Android Arch
137-
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
137+
implementation(libs.androidx.lifecycle.extensions)
138138

139139
// AndroidX Navigation
140-
implementation("androidx.navigation:navigation-fragment-ktx:2.7.5")
141-
implementation("androidx.navigation:navigation-ui-ktx:2.7.5")
140+
implementation(libs.androidx.navigation.fragment.ktx)
141+
implementation(libs.androidx.navigation.ui.ktx)
142142

143143
// Hilt
144-
implementation("com.google.dagger:hilt-android:2.48.1")
145-
ksp("com.google.dagger:hilt-compiler:2.48.1")
144+
implementation(libs.hilt)
145+
ksp(libs.hilt.compiler)
146146

147-
androidTestImplementation("com.google.dagger:hilt-android-testing:2.48.1")
148-
kspAndroidTest("com.google.dagger:hilt-android-compiler:2.48.1")
147+
androidTestImplementation(libs.hilt.android.testing)
148+
kspAndroidTest(libs.hilt.compiler)
149149

150150
// Leak Canary
151-
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.10")
151+
debugImplementation(libs.leakcanary.android)
152152

153153
// ViewPager 2
154-
implementation("androidx.viewpager2:viewpager2:1.1.0-beta02")
154+
implementation(libs.androidx.viewpager2)
155155

156156
// ViewPager Circle Indicator
157-
implementation("me.relex:circleindicator:2.1.4")
157+
implementation(libs.relex.circleindicator)
158158

159159
// AndroidX Media
160-
implementation("androidx.media:media:1.6.0")
160+
implementation(libs.androidx.media)
161161

162162
// AndroidX Preference
163-
implementation("androidx.preference:preference-ktx:1.2.1")
163+
implementation(libs.androidx.preference.ktx)
164164

165165
// ChromeCast
166-
implementation("com.google.android.gms:play-services-cast-framework:21.3.0")
166+
implementation(libs.google.play.services.cast.framework)
167167

168168
// NanoHttp
169-
implementation("org.nanohttpd:nanohttpd-webserver:2.3.1")
169+
implementation(libs.nanohttpd.webserver)
170170

171171
// Moshi
172-
ksp("com.squareup.moshi:moshi-kotlin-codegen:1.15.0")
172+
ksp(libs.moshi.kotlinCodegen)
173173

174174
// AndroidX Lifecycle
175-
implementation("androidx.lifecycle:lifecycle-common-java8:2.6.2")
175+
implementation(libs.androidx.lifecycle.common.java8)
176176

177177
// Noise
178-
implementation("com.github.paramsen:noise:2.0.0")
178+
implementation(libs.paramsen.noise)
179179

180180
// MpAndroidChart
181-
implementation("com.github.PhilJay:MPAndroidChart:3.1.0")
181+
implementation(libs.philjay.mpAndroidChart)
182182

183183
// AndroidX Lifecycle
184-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
184+
implementation(libs.androidx.lifecycle.runtime.ktx)
185185

186186
// ExoPlayer
187-
implementation("com.github.timusus.exoplayer:exoplayer-core:2.14.2-shuttle")
188-
implementation("com.github.timusus.exoplayer:exoplayer-hls:2.14.2-shuttle")
187+
implementation(libs.exoplayer.core)
188+
implementation(libs.exoplayer.hls)
189189

190-
implementation("androidx.drawerlayout:drawerlayout:1.2.0")
190+
implementation(libs.androidx.drawerlayout)
191191

192192
// New fragment manager
193-
implementation("androidx.fragment:fragment-ktx:1.6.2")
193+
implementation(libs.androidx.fragment.ktx)
194194

195195
// Glide
196-
implementation("com.github.bumptech.glide:glide:4.16.0")
197-
implementation("com.github.bumptech.glide:okhttp3-integration:4.16.0")
196+
implementation(libs.glide)
197+
implementation(libs.glide.okhttp3Integration)
198198
implementation("com.github.bumptech.glide:recyclerview-integration:4.14.2") {
199199
// Excludes the support library because it's already included by Glide.
200200
isTransitive = false
201201
}
202202

203203
// About Libraries
204-
implementation("com.mikepenz:aboutlibraries-core:10.9.2")
204+
implementation(libs.mikepenz.aboutlibrariesCore)
205205

206206
// Billing
207-
implementation("com.android.billingclient:billing-ktx:6.1.0")
207+
implementation(libs.billingclient.billingKtx)
208208

209209
// Play Core (review api)
210-
implementation("com.google.android.play:core:1.10.3")
211-
implementation("com.google.android.play:core-ktx:1.8.1")
210+
implementation(libs.google.review)
211+
implementation(libs.google.review.ktx)
212212

213213
// Semantic versioning
214-
implementation("com.vdurmont:semver4j:3.1.0")
214+
implementation(libs.vdurmont.semver4j)
215215

216-
implementation("com.microsoft.design:fluent-system-icons:1.1.137@aar")
216+
implementation(libs.design.fluentSystemIcons)
217217

218218
// KotlinX DateTime
219-
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
219+
implementation(libs.kotlinx.datetime)
220220
// Core Library Desugaring - Required for KotlinX DateTime on API < 27
221-
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
221+
coreLibraryDesugaring(libs.tools.desugar.jdk.libs)
222222

223223
// Firebase
224-
implementation(platform("com.google.firebase:firebase-bom:32.6.0"))
225-
implementation("com.google.firebase:firebase-crashlytics")
224+
implementation(platform(libs.firebase.bom))
225+
implementation(libs.firebase.crashlytics)
226226

227227

228228
// Testing
229-
androidTestImplementation("androidx.test:runner:1.5.2")
230-
androidTestImplementation("androidx.test:rules:1.5.0")
231-
androidTestImplementation("androidx.test:core-ktx:1.5.0")
232-
androidTestImplementation("org.hamcrest:hamcrest-library:1.3")
229+
androidTestImplementation(libs.androidx.runner)
230+
androidTestImplementation(libs.androidx.rules)
231+
androidTestImplementation(libs.androidx.core.ktx)
232+
androidTestImplementation(libs.hamcrest.library)
233233

234234
// Remote config
235235
implementation(project(":android:remote-config"))
236236

237237

238-
testImplementation("junit:junit:4.13.2")
238+
testImplementation(libs.junit)
239239

240240
// WorkManager
241-
implementation("androidx.work:work-runtime-ktx:2.9.0-rc01")
242-
implementation("androidx.hilt:hilt-work:1.1.0")
243-
ksp("androidx.hilt:hilt-compiler:1.1.0")
241+
implementation(libs.androidx.work.runtime.ktx)
242+
implementation(libs.androidx.hilt.work)
243+
ksp(libs.androidx.hilt.compiler)
244244
}
245245

246246
buildFeatures.buildConfig = true

android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/albumartists/AlbumArtistBinder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract class AlbumArtistBinder(
3535
}
3636

3737
override fun getSectionName(): String? {
38-
return albumArtist.groupKey.key?.firstOrNull()?.toUpperCase()?.toString()
38+
return albumArtist.groupKey.key?.firstOrNull()?.uppercaseChar()?.toString()
3939
}
4040

4141
override fun equals(other: Any?): Boolean {

android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/albumartists/detail/ExpandableAlbumBinder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ExpandableAlbumBinder(
7070
}
7171

7272
override fun getSectionName(): String? {
73-
return album.groupKey?.key?.firstOrNull()?.toString()?.toUpperCase(Locale.getDefault())
73+
return album.groupKey?.key?.firstOrNull()?.toString()?.uppercase(Locale.getDefault())
7474
}
7575

7676
override fun equals(other: Any?): Boolean {

android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/albums/AlbumBinder.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.simplecityapps.shuttle.ui.common.recyclerview.SectionViewBinder
99
import java.util.*
1010

1111
abstract class AlbumBinder(
12-
val album: com.simplecityapps.shuttle.model.Album,
12+
val album: Album,
1313
val imageLoader: ArtworkImageLoader,
1414
val listener: Listener? = null
1515
) : ViewBinder,
@@ -18,25 +18,25 @@ abstract class AlbumBinder(
1818

1919
interface Listener {
2020
fun onAlbumClicked(
21-
album: com.simplecityapps.shuttle.model.Album,
21+
album: Album,
2222
viewHolder: ViewHolder
2323
)
2424

2525
fun onAlbumLongClicked(
26-
album: com.simplecityapps.shuttle.model.Album,
26+
album: Album,
2727
viewHolder: ViewHolder
2828
)
2929

3030
fun onOverflowClicked(
3131
view: View,
32-
album: com.simplecityapps.shuttle.model.Album
32+
album: Album
3333
) {}
3434

3535
fun onViewHolderCreated(holder: ViewHolder) {}
3636
}
3737

3838
override fun getSectionName(): String? {
39-
return album.groupKey?.key?.firstOrNull()?.toString()?.toUpperCase(Locale.getDefault())
39+
return album.groupKey?.key?.firstOrNull()?.toString()?.uppercase(Locale.getDefault())
4040
}
4141

4242
override fun equals(other: Any?): Boolean {

android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/albums/AlbumListPresenter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ constructor(
275275

276276
override fun getFastscrollPrefix(album: Album): String? {
277277
return when (sortPreferenceManager.sortOrderAlbumList) {
278-
AlbumSortOrder.AlbumName -> album.groupKey?.key?.firstOrNull()?.toString()?.toUpperCase(Locale.getDefault())
279-
AlbumSortOrder.ArtistGroupKey -> album.groupKey?.albumArtistGroupKey?.key?.firstOrNull()?.toString()?.toUpperCase(Locale.getDefault())
278+
AlbumSortOrder.AlbumName -> album.groupKey?.key?.firstOrNull()?.toString()?.uppercase(Locale.getDefault())
279+
AlbumSortOrder.ArtistGroupKey -> album.groupKey?.albumArtistGroupKey?.key?.firstOrNull()?.toString()?.uppercase(Locale.getDefault())
280280
AlbumSortOrder.Year -> album.year.toString()
281281
else -> null
282282
}

android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/songs/SongListPresenter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ constructor(
219219
override fun getFastscrollPrefix(song: Song): String? {
220220
return when (sortPreferenceManager.sortOrderSongList) {
221221
SongSortOrder.SongName -> song.name?.firstOrNull()?.toString()
222-
SongSortOrder.ArtistGroupKey -> song.albumArtistGroupKey.key?.firstOrNull()?.toString()?.toUpperCase(Locale.getDefault())
223-
SongSortOrder.AlbumGroupKey -> song.albumGroupKey.key?.firstOrNull()?.toString()?.toUpperCase(Locale.getDefault())
222+
SongSortOrder.ArtistGroupKey -> song.albumArtistGroupKey.key?.firstOrNull()?.toString()?.uppercase(Locale.getDefault())
223+
SongSortOrder.AlbumGroupKey -> song.albumGroupKey.key?.firstOrNull()?.toString()?.uppercase(Locale.getDefault())
224224
SongSortOrder.Year -> song.date?.year?.toString()
225225
else -> null
226226
}

android/core/build.gradle

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'com.google.devtools.ksp'
44

55
android {
6-
compileSdk 34
6+
compileSdk 35
77

88
defaultConfig {
99
minSdkVersion 21
10-
targetSdkVersion 34
10+
targetSdkVersion 35
1111
buildConfigField("String", "PROXY_ADDR", "\"192.168.0.14\"")
1212
buildConfigField("Integer", "PROXY_PORT", "8888")
1313
}
@@ -40,52 +40,48 @@ dependencies {
4040
implementation fileTree(dir: 'libs', include: ['*.jar'])
4141

4242
// AndroidX Preferences
43-
implementation "androidx.preference:preference-ktx:1.2.1"
43+
implementation libs.androidx.preference.ktx
4444

4545
// OkHttp Logging Interceptor
46-
api 'com.squareup.okhttp3:logging-interceptor:4.12.0'
46+
api libs.okhttp3.loggingInterceptor
4747

4848
// Kotlin Standard Library
49-
api 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.20'
49+
api libs.kotlin.stdlib
5050

5151
// Kotlin Extensions
52-
api 'androidx.core:core-ktx:1.12.0'
52+
api libs.androidx.core.ktx
5353

5454
// AndroidX Annotations
55-
api "androidx.annotation:annotation:1.7.0"
55+
api libs.androidx.annotation
5656

5757
// Hilt core
58-
implementation 'com.google.dagger:hilt-android:2.48.1'
59-
ksp 'com.google.dagger:hilt-compiler:2.48.1'
58+
implementation libs.hilt
59+
ksp libs.hilt.compiler
6060

6161
// Timber
62-
api 'com.jakewharton.timber:timber:4.7.1'
62+
api libs.timber
6363

6464
// Coroutines
65-
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
66-
api("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
65+
api(libs.kotlinx.coroutinesCore)
66+
api(libs.kotlinx.coroutinesAndroid)
6767

6868
// OKHttp
69-
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
69+
implementation libs.okhttp3.okhttp
7070

7171
// Retrofit
72-
implementation 'com.squareup.retrofit2:converter-moshi:2.10.0-SNAPSHOT'
72+
implementation libs.retrofit2.converterMoshi
7373

7474
// Moshi
75-
implementation 'com.squareup.moshi:moshi:1.15.0'
76-
implementation 'com.squareup.moshi:moshi-kotlin:1.15.0'
77-
implementation 'com.squareup.moshi:moshi-adapters:1.15.0'
75+
implementation libs.moshi
76+
implementation libs.moshi.kotlin
77+
implementation libs.moshi.adapters
7878

7979
// Encrypted Shared Preferences
80-
api 'androidx.security:security-crypto:1.1.0-alpha06'
80+
api libs.androidx.security.crypto
8181

8282
// Material Design Components
83-
implementation 'com.google.android.material:material:1.10.0'
83+
implementation libs.google.material
8484

8585
// Phrase string formatting helper
86-
api 'com.github.square:phrase:master-SNAPSHOT'
86+
api libs.square.phrase
8787
}
88-
89-
repositories {
90-
mavenCentral()
91-
}

android/data/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
android {
8-
compileSdk = 34
8+
compileSdk = 35
99

1010
defaultConfig {
1111
minSdk = 21
@@ -22,6 +22,6 @@ android {
2222
}
2323

2424
dependencies {
25-
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
25+
implementation(libs.kotlinx.datetime)
2626
}
2727
}

0 commit comments

Comments
 (0)