Skip to content

Commit

Permalink
Fixed r8minify errors, need to fix "dagger.spi.internal.shaded.androi…
Browse files Browse the repository at this point in the history
…dx.room.compiler.processing.XAnnotation.getAnnotationValue(String)" error
goldy1992 committed Jun 24, 2024
1 parent 7a0229c commit a97a653
Showing 14 changed files with 35 additions and 27 deletions.
7 changes: 6 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -30,4 +30,9 @@
public static *** i(...);
public static *** w(...);
public static *** e(...);
}
}

-keep public class com.github.goldy1992.mp3player.**
-keep public interface com.github.goldy1992.mp3player.**
-keep public class hilt_aggregated_deps.**
-keep public class dagger.**
1 change: 1 addition & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@ tasks.withType<KotlinCompile>().configureEach {
}

dependencies {
implementation(libs.androidx.room.gradle.plugin)
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
Original file line number Diff line number Diff line change
@@ -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<Project> {

override fun apply(target: Project) {
with(target) {
pluginManager.apply("androidx.room")
pluginManager.apply("com.google.devtools.ksp")

extensions.configure<KspExtension> {
arg("room.generateKotlin", "true")
}

extensions.configure<RoomExtension> {
// 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 {
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
}

2 changes: 1 addition & 1 deletion client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 2 additions & 7 deletions client/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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.**
3 changes: 3 additions & 0 deletions commons/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
15 changes: 5 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
1 change: 1 addition & 0 deletions service/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ android {
"-opt-in=androidx.media3.common.util.UnstableApi"
)
}
namespace = "com.github.goldy1992.mp3player.service"

buildTypes {
getByName("release") {
3 changes: 2 additions & 1 deletion service/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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.**
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -21,5 +21,5 @@ interface AlbumDao : SearchDao<Album> {
override fun deleteOld(ids: List<String?>?)

@Query("SELECT * FROM albums WHERE value like '%' || :value || '%'")
override fun query(value: String?): List<Album>?
override fun query(value: String?): List<Album>
}
Original file line number Diff line number Diff line change
@@ -21,5 +21,5 @@ interface FolderDao : SearchDao<Folder> {
override fun deleteOld(ids: List<String?>?)

@Query("SELECT * FROM folders WHERE value like '%' || :value || '%'")
override fun query(value: String?): List<Folder>?
override fun query(value: String?): List<Folder>
}
Original file line number Diff line number Diff line change
@@ -20,5 +20,5 @@ interface SongDao : SearchDao<Song> {
override fun deleteOld(ids: List<String?>?)

@Query("SELECT * FROM songs WHERE value like '%' || :value || '%'")
override fun query(value: String?): List<Song>?
override fun query(value: String?): List<Song>
}

0 comments on commit a97a653

Please sign in to comment.