From c0017d2088b917749149bf973fc4e740887335b2 Mon Sep 17 00:00:00 2001 From: tsshadow Date: Sun, 19 Jan 2025 15:48:57 +0100 Subject: [PATCH] fix: build is now jdk 21 feat: added 2025 --- .idea/compiler.xml | 2 +- build.gradle | 2 +- core/domain/build.gradle | 14 ++++++++- gradle/libs.versions.toml | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- ultrasonic/build.gradle | 9 +++--- .../fragment/legacy/SelectGenreFragment.kt | 2 +- .../fragment/tsshadow/LandingPageFragment.kt | 1 + .../fragment/tsshadow/SelectSongFragment.kt | 1 + .../service/MediaLibrarySessionCallback.kt | 31 ++++++++++++++++--- ultrasonic/src/main/res/values/arrays.xml | 1 + ultrasonic/src/main/res/values/strings.xml | 8 +++-- 12 files changed, 58 insertions(+), 17 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index b589d56e9..b86273d94 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 1797e96b6..ebc6fa8bd 100644 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,7 @@ allprojects { // Set Kotlin JVM target to the same for all subprojects tasks.withType(KotlinCompile).configureEach { kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/core/domain/build.gradle b/core/domain/build.gradle index 069c9605a..280550b89 100644 --- a/core/domain/build.gradle +++ b/core/domain/build.gradle @@ -10,7 +10,19 @@ dependencies { implementation libs.roomKtx ksp libs.room } - android { namespace 'org.moire.ultrasonic.subsonic.domain' + compileOptions { + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 + } + + kotlinOptions { + jvmTarget = "21" + } + + ksp { + arg("ksp.jvmTarget", "21") // Ensure KSP targets JVM 21 + } } + diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c5414e9bc..653244ae0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ gradle = "8.1.1" navigation = "2.7.5" -gradlePlugin = "8.5.1" +gradlePlugin = "8.8.0" androidxcar = "1.2.0" androidxcore = "1.12.0" ktlint = "1.0.1" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 25c88fe71..71b861556 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ #Mon Jul 22 21:22:35 CEST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/ultrasonic/build.gradle b/ultrasonic/build.gradle index 15f1f6d7b..88f4a9712 100644 --- a/ultrasonic/build.gradle +++ b/ultrasonic/build.gradle @@ -36,8 +36,9 @@ android { debug { minifyEnabled false multiDexEnabled true - testCoverageEnabled true applicationIdSuffix '.debug' + enableUnitTestCoverage true + enableAndroidTestCoverage true } } @@ -53,7 +54,7 @@ android { } kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } buildFeatures { @@ -63,8 +64,8 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_21 + targetCompatibility JavaVersion.VERSION_21 } ksp { diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/legacy/SelectGenreFragment.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/legacy/SelectGenreFragment.kt index 9fdb6fa32..3a675fd84 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/legacy/SelectGenreFragment.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/legacy/SelectGenreFragment.kt @@ -93,7 +93,7 @@ class SelectGenreFragment : Fragment(), RefreshableFragment { ratingAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) - var years = arrayOf("All", "2024", "2023", "2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008", "2007", "2006", "2005", "2004", "2003", "2002", "2001", "2000", "1999", "1998", "1997", "1996", "1995", "1994", "1993", "1992"); + var years = arrayOf("All", "2025", "2024", "2023", "2022", "2021", "2020", "2019", "2018", "2017", "2016", "2015", "2014", "2013", "2012", "2011", "2010", "2009", "2008", "2007", "2006", "2005", "2004", "2003", "2002", "2001", "2000", "1999", "1998", "1997", "1996", "1995", "1994", "1993", "1992"); val yearAdapter = ArrayAdapter(requireContext(),android.R.layout.simple_spinner_item, years) yearAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item) diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/LandingPageFragment.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/LandingPageFragment.kt index 02239fef1..5282c32ce 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/LandingPageFragment.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/LandingPageFragment.kt @@ -98,6 +98,7 @@ class LandingPageFragment : Fragment(), KoinComponent { randomSongsButton = binding!!.findViewById(R.id.main_songs_button) randomSongsThisYearButton = binding!!.findViewById(R.id.main_songs_this_year_button) recentSongsButton = binding!!.findViewById(R.id.main_songs_recent) + // Livesets livesetsTitle = binding!!.findViewById(R.id.main_livesets) randomLivesetsButton = binding!!.findViewById(R.id.main_livesets_button) diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/SelectSongFragment.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/SelectSongFragment.kt index 5a1060601..1d0863bbc 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/SelectSongFragment.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/fragment/tsshadow/SelectSongFragment.kt @@ -101,6 +101,7 @@ class SelectSongFragment : Fragment(), RefreshableFragment { val years = arrayOf( "All", + "2025", "2024", "2023", "2022", diff --git a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/MediaLibrarySessionCallback.kt b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/MediaLibrarySessionCallback.kt index 55f4eba2a..1ffe7a2df 100644 --- a/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/MediaLibrarySessionCallback.kt +++ b/ultrasonic/src/main/kotlin/org/moire/ultrasonic/service/MediaLibrarySessionCallback.kt @@ -98,12 +98,16 @@ private const val MEDIA_SEARCH_SONG_ITEM = "MEDIA_SEARCH_SONG_ITEM" // Genres -> songs private const val MEDIA_GENRES_SONGS = "MEDIA_GENRES_SONGS" private const val MEDIA_GENRE_SONGS = "MEDIA_GENRE_SONGS" +private const val MEDIA_GENRES_SONGS_THIS_YEAR = "MEDIA_GENRES_SONGS_THIS_YEAR" private const val MEDIA_GENRES_SONGS_LAST_YEAR = "MEDIA_GENRES_SONGS_LAST_YEAR" +private const val MEDIA_GENRE_SONGS_THIS_YEAR = "MEDIA_GENRE_SONGS_THIS_YEAR" private const val MEDIA_GENRE_SONGS_LAST_YEAR = "MEDIA_GENRE_SONGS_LAST_YEAR" // Genres -> Livesets private const val MEDIA_GENRES_LIVESETS = "MEDIA_GENRES_LIVESETS" private const val MEDIA_GENRE_LIVESETS = "MEDIA_GENRE_LIVESETS" +private const val MEDIA_GENRES_LIVESETS_THIS_YEAR = "MEDIA_GENRES_LIVESETS_THIS_YEAR" private const val MEDIA_GENRES_LIVESETS_LAST_YEAR = "MEDIA_GENRES_LIVESETS_LAST_YEAR" +private const val MEDIA_GENRE_LIVESETS_THIS_YEAR = "MEDIA_GENRE_LIVESETS_THIS_YEAR" private const val MEDIA_GENRE_LIVESETS_LAST_YEAR = "MEDIA_GENRE_LIVESETS_LAST_YEAR" // Moods -> songs @@ -658,13 +662,18 @@ class MediaLibrarySessionCallback : // Genre -> songs MEDIA_GENRES_SONGS -> getGenres(null, "short") MEDIA_GENRE_SONGS -> getGenre(parentIdParts[1], null, "short") - MEDIA_GENRES_SONGS_LAST_YEAR -> getGenres(year, "short") - MEDIA_GENRE_SONGS_LAST_YEAR -> getGenre(parentIdParts[1],year, "short") + MEDIA_GENRES_SONGS_THIS_YEAR -> getGenres(year, "short") + MEDIA_GENRES_SONGS_LAST_YEAR -> getGenres(year-1, "short") + MEDIA_GENRE_SONGS_THIS_YEAR -> getGenre(parentIdParts[1],year, "short") + MEDIA_GENRE_SONGS_LAST_YEAR -> getGenre(parentIdParts[1],year-1, "short") + // Genre -> livesets MEDIA_GENRES_LIVESETS -> getGenres(null, "long") MEDIA_GENRE_LIVESETS -> getGenre(parentIdParts[1], null, "long") - MEDIA_GENRES_LIVESETS_LAST_YEAR -> getGenres(year, "long") - MEDIA_GENRE_LIVESETS_LAST_YEAR -> getGenre(parentIdParts[1],year, "long") + MEDIA_GENRES_LIVESETS_THIS_YEAR -> getGenres(year, "long") + MEDIA_GENRES_LIVESETS_LAST_YEAR -> getGenres(year-1, "long") + MEDIA_GENRE_LIVESETS_THIS_YEAR -> getGenre(parentIdParts[1],year, "long") + MEDIA_GENRE_LIVESETS_LAST_YEAR -> getGenre(parentIdParts[1],year-1, "long") // // Mood -> songs // MEDIA_MOODS_SONGS -> getMoods(null, "short") @@ -865,6 +874,13 @@ class MediaLibrarySessionCallback : isBrowsable = true, mediaType = MEDIA_TYPE_PLAYLIST ) + mediaItems.add( + R.string.main_title_songs_this_year, + MEDIA_GENRES_SONGS_THIS_YEAR, + R.string.main_genres_title, + isBrowsable = true, + mediaType = MEDIA_TYPE_PLAYLIST + ) mediaItems.add( R.string.main_title_songs_last_year, MEDIA_GENRES_SONGS_LAST_YEAR, @@ -879,6 +895,13 @@ class MediaLibrarySessionCallback : isBrowsable = true, mediaType = MEDIA_TYPE_PLAYLIST ) + mediaItems.add( + R.string.main_title_livesets_this_year, + MEDIA_GENRES_LIVESETS_THIS_YEAR, + R.string.main_genres_title, + isBrowsable = true, + mediaType = MEDIA_TYPE_PLAYLIST + ) mediaItems.add( R.string.main_title_livesets_last_year, MEDIA_GENRES_LIVESETS_LAST_YEAR, diff --git a/ultrasonic/src/main/res/values/arrays.xml b/ultrasonic/src/main/res/values/arrays.xml index 6adc1f8da..0fefc8124 100644 --- a/ultrasonic/src/main/res/values/arrays.xml +++ b/ultrasonic/src/main/res/values/arrays.xml @@ -282,6 +282,7 @@ + 2025 2024 2023 2022 diff --git a/ultrasonic/src/main/res/values/strings.xml b/ultrasonic/src/main/res/values/strings.xml index fa3b19b27..e68bf35b4 100644 --- a/ultrasonic/src/main/res/values/strings.xml +++ b/ultrasonic/src/main/res/values/strings.xml @@ -119,14 +119,16 @@ Years All (songs) All (livesets) - This year (songs) - This Year (livesets) + This year (songs) + Last year (songs) + This Year (livesets) + Last Year (livesets) Home Search Offline %s - Set up Server Random - Random (2024) + Random (2025) Recent Starred Songs