diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 4803f3854..bb9c2f35e 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -30,4 +30,9 @@ public static *** i(...); public static *** w(...); public static *** e(...); -} \ No newline at end of file +} + +-keep public class com.github.goldy1992.mp3player.** +-keep public interface com.github.goldy1992.mp3player.** +-keep public class hilt_aggregated_deps.** +-keep public class dagger.** \ No newline at end of file diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index c544daa5b..91ab56367 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -19,6 +19,7 @@ tasks.withType().configureEach { } dependencies { + implementation(libs.androidx.room.gradle.plugin) compileOnly(libs.android.gradlePlugin) compileOnly(libs.kotlin.gradlePlugin) compileOnly(libs.ksp.gradlePlugin) diff --git a/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt index a2a0276bb..bf9d4dbfe 100644 --- a/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt @@ -1,3 +1,4 @@ +import androidx.room.gradle.RoomExtension import com.github.goldy1992.mp3player.libs import com.google.devtools.ksp.gradle.KspExtension import org.gradle.api.Plugin @@ -14,13 +15,18 @@ class AndroidRoomConventionPlugin : Plugin { override fun apply(target: Project) { with(target) { + pluginManager.apply("androidx.room") pluginManager.apply("com.google.devtools.ksp") extensions.configure { + arg("room.generateKotlin", "true") + } + + extensions.configure { // The schemas directory contains a schema file for each version of the Room database. // This is required to enable Room auto migrations. // See https://developer.android.com/reference/kotlin/androidx/room/AutoMigration. - arg(RoomSchemaArgProvider(File(projectDir, "schemas"))) + schemaDirectory("$projectDir/schemas") } dependencies { diff --git a/build.gradle.kts b/build.gradle.kts index 1b4abeaf0..d6d3455e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,12 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false - alias(libs.plugins.org.jetbrains.kotlin.android) apply false + alias(libs.plugins.android.test) apply false alias(libs.plugins.compose.compiler) apply false alias(libs.plugins.hilt) apply false + alias(libs.plugins.org.jetbrains.kotlin.android) apply false alias(libs.plugins.ksp) apply false + alias(libs.plugins.room) apply false alias(libs.plugins.sonarqube) apply true } diff --git a/client/build.gradle.kts b/client/build.gradle.kts index df9e1a375..b97d5806e 100644 --- a/client/build.gradle.kts +++ b/client/build.gradle.kts @@ -98,7 +98,7 @@ android { } dependencies { - implementation(libs.androidx.core.ktx) + implementation(libs.androidx.core.kotlin) val composeBom = platform(libs.androidx.compose.bom) implementation(composeBom) diff --git a/client/proguard-rules.pro b/client/proguard-rules.pro index 6445de357..a951d027d 100644 --- a/client/proguard-rules.pro +++ b/client/proguard-rules.pro @@ -19,11 +19,6 @@ # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile --dontwarn com.github.goldy1992.mp3player.commons.LogTagger --dontwarn com.github.goldy1992.mp3player.commons.MediaItemType --dontwarn com.github.goldy1992.mp3player.commons.PermissionsUtils --dontwarn com.github.goldy1992.mp3player.commons.Screen --dontwarn com.github.goldy1992.mp3player.commons.TimerUtils --dontwarn com.github.goldy1992.mp3player.commons.VersionUtils --dontwarn com.github.goldy1992.mp3player.commons.data.repositories.permissions.IPermissionsRepository -dontwarn java.lang.invoke.StringConcatFactory +-keep public class com.github.goldy1992.mp3player.client.** +-keep public class hilt_aggregated_deps.** \ No newline at end of file diff --git a/commons/proguard-rules.pro b/commons/proguard-rules.pro index 2f9dc5a47..db7fbc23f 100644 --- a/commons/proguard-rules.pro +++ b/commons/proguard-rules.pro @@ -19,3 +19,6 @@ # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile +-keep public class com.github.goldy1992.mp3player.commons.** +-keep public class hilt_aggregated_deps.** +-dontwarn java.lang.invoke.StringConcatFactory \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c27d26a0a..dfaf78e08 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,13 +24,13 @@ composeAminationBeta = "1.7.0-beta03" composeBom = "2024.06.00" datastorePreferences = "1.1.1" googlePlayReview = "2.0.1" -hilt = "2.51" +hilt = "2.51.1" jacoco = "0.8.10" junit4 = "4.13.2" kotlin = "2.0.0" kotlinCoroutines = "1.7.3" media3 = "1.3.1" -ksp = "2.0.0-1.0.21" +ksp = "2.0.0-1.0.22" minSdk = "23" mockitoInline = "3.7.7" mockitoKotlin = "4.1.0" @@ -39,7 +39,7 @@ robolectric = "4.12.2" sonarqube = "4.2.1.3168" targetSdk= "34" uiAutomator = "2.3.0-beta01" -coreKtx = "1.13.1" +roomGradlePlugin = "2.6.1" [libraries] androidx-activity-kotlin = { group = "androidx.activity", name = "activity-ktx", version.ref = "androidxActivityKotlin" } @@ -109,7 +109,7 @@ ksp-gradlePlugin = { group = "com.google.devtools.ksp", name = "com.google.devto mockito-inline = { group = "org.mockito", name = "mockito-inline", version.ref = "mockitoInline" } mockito-kotlin = { group = "org.mockito.kotlin", name = "mockito-kotlin", version.ref = "mockitoKotlin" } robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" } -androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +androidx-room-gradle-plugin = { group = "androidx.room", name = "room-gradle-plugin", version.ref = "roomGradlePlugin" } [plugins] android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } @@ -118,11 +118,6 @@ android-test = { id = "com.android.test", version.ref = "androidGradlePlugin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } - - - -kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } -#protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" } +room = { id = "androidx.room", version.ref = "room" } sonarqube = { id = "org.sonarqube", version.ref="sonarqube" } \ No newline at end of file diff --git a/service/build.gradle.kts b/service/build.gradle.kts index d670771f6..e846603de 100644 --- a/service/build.gradle.kts +++ b/service/build.gradle.kts @@ -30,6 +30,7 @@ android { "-opt-in=androidx.media3.common.util.UnstableApi" ) } + namespace = "com.github.goldy1992.mp3player.service" buildTypes { getByName("release") { diff --git a/service/proguard-rules.pro b/service/proguard-rules.pro index 59c1de48a..1d588d535 100644 --- a/service/proguard-rules.pro +++ b/service/proguard-rules.pro @@ -19,5 +19,6 @@ # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile --dontwarn com.github.goldy1992.mp3player.commons.LogTagger -dontwarn java.lang.invoke.StringConcatFactory +-keep public class com.github.goldy1992.mp3player.service.** +-keep public class hilt_aggregated_deps.** \ No newline at end of file diff --git a/service/src/main/java/com/github/goldy1992/mp3player/service/MediaPlaybackService.kt b/service/src/main/java/com/github/goldy1992/mp3player/service/MediaPlaybackService.kt index 5f7a1d37e..fe9339afe 100644 --- a/service/src/main/java/com/github/goldy1992/mp3player/service/MediaPlaybackService.kt +++ b/service/src/main/java/com/github/goldy1992/mp3player/service/MediaPlaybackService.kt @@ -21,9 +21,8 @@ import androidx.annotation.OptIn as AndroidXOptIn * list, the service will continue to run in the background and only be destroyed by the operating * system. */ -@AndroidXOptIn(UnstableApi::class) @AndroidEntryPoint -open class MediaPlaybackService : MediaLibraryService(), +class MediaPlaybackService : MediaLibraryService(), LogTagger { @Inject diff --git a/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/AlbumDao.kt b/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/AlbumDao.kt index 8595dd2b5..c3a89727a 100644 --- a/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/AlbumDao.kt +++ b/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/AlbumDao.kt @@ -21,5 +21,5 @@ interface AlbumDao : SearchDao { override fun deleteOld(ids: List?) @Query("SELECT * FROM albums WHERE value like '%' || :value || '%'") - override fun query(value: String?): List? + override fun query(value: String?): List } \ No newline at end of file diff --git a/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/FolderDao.kt b/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/FolderDao.kt index 32535e946..ea97583d3 100644 --- a/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/FolderDao.kt +++ b/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/FolderDao.kt @@ -21,5 +21,5 @@ interface FolderDao : SearchDao { override fun deleteOld(ids: List?) @Query("SELECT * FROM folders WHERE value like '%' || :value || '%'") - override fun query(value: String?): List? + override fun query(value: String?): List } \ No newline at end of file diff --git a/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/SongDao.kt b/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/SongDao.kt index 2a09ce046..eecc31d25 100644 --- a/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/SongDao.kt +++ b/service/src/main/java/com/github/goldy1992/mp3player/service/library/data/search/SongDao.kt @@ -20,5 +20,5 @@ interface SongDao : SearchDao { override fun deleteOld(ids: List?) @Query("SELECT * FROM songs WHERE value like '%' || :value || '%'") - override fun query(value: String?): List? + override fun query(value: String?): List } \ No newline at end of file