From 2ca4328fe6854597baff0f8ca587dcf57dd6235c Mon Sep 17 00:00:00 2001 From: Ash Date: Tue, 28 Apr 2026 15:38:29 -0300 Subject: [PATCH] chore: upgrade gradle and add compose dependencies --- app/build.gradle | 26 +++++++++++++++++++++--- app/src/main/AndroidManifest.xml | 3 +-- build.gradle | 1 + gradle.properties | 12 +++++++++-- gradle/libs.versions.toml | 21 +++++++++++++++++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 6 files changed, 56 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f6a008bd60..b0866de1e4 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,13 +10,12 @@ plugins { id 'org.jetbrains.kotlin.plugin.serialization' // enable if needed // id 'dev.reformator.stacktracedecoroutinator' - id 'io.sentry.android.gradle' version '6.1.0' + alias(libs.plugins.compose.compiler) } android { compileSdk = 36 - buildToolsVersion = '35.0.0' namespace = 'io.github.landwarderer.futon' dependenciesInfo { @@ -78,6 +77,7 @@ android { buildFeatures { viewBinding true buildConfig true + compose true } packagingOptions { resources { @@ -86,7 +86,10 @@ android { 'META-INF/NOTICE.md' ] } - } + jniLibs { + useLegacyPackaging true + } + } sourceSets { androidTest.assets.srcDirs += files("$projectDir/schemas".toString()) main.java.srcDirs += 'src/main/kotlin/' @@ -149,6 +152,10 @@ dependencies { exclude group: 'org.json', module: 'json' } + def composeBom = platform(libs.compose.bom) + implementation composeBom + androidTestImplementation composeBom + coreLibraryDesugaring libs.desugar.jdk.libs implementation libs.kotlin.stdlib implementation libs.kotlinx.coroutines.android @@ -217,9 +224,21 @@ dependencies { implementation libs.conscrypt.android implementation libs.sentry.android + implementation libs.compose.material3 + implementation libs.compose.foundation + implementation libs.compose.ui + implementation libs.compose.ui.tooling.preview + implementation libs.compose.material3.adaptive + implementation libs.androidx.activity.compose + implementation libs.androidx.lifecycle.viewmodel.compose + implementation libs.compose.runtime.livedata + implementation libs.compose.runtime.rxjava2 + debugImplementation libs.leakcanary.android nightlyImplementation libs.leakcanary.android debugImplementation libs.workinspector + debugImplementation libs.compose.ui.tooling + debugImplementation libs.compose.ui.test.manifest testImplementation libs.junit testImplementation libs.json @@ -229,6 +248,7 @@ dependencies { androidTestImplementation libs.androidx.rules androidTestImplementation libs.androidx.test.core androidTestImplementation libs.androidx.junit + androidTestImplementation libs.compose.ui.test.junit4 androidTestImplementation libs.kotlinx.coroutines.test diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d66f8a0578..62357e3251 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -52,8 +52,7 @@ android:backupAgent="io.github.landwarderer.futon.backups.domain.AppBackupAgent" android:dataExtractionRules="@xml/backup_rules" android:enableOnBackInvokedCallback="@bool/is_predictive_back_enabled" - android:extractNativeLibs="true" - android:fullBackupContent="@xml/backup_content" + android:fullBackupContent="@xml/backup_content" android:fullBackupOnly="true" android:hasFragileUserData="true" android:restoreAnyVersion="true" diff --git a/build.gradle b/build.gradle index 809d5a7310..0674c0b102 100644 --- a/build.gradle +++ b/build.gradle @@ -6,4 +6,5 @@ plugins { alias(libs.plugins.room) apply false alias(libs.plugins.kotlinx.serizliation) apply false // alias(libs.plugins.decoroutinator) apply false + alias(libs.plugins.compose.compiler) apply false } diff --git a/gradle.properties b/gradle.properties index 9e44c8cfca..c44e78122d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,8 +12,6 @@ # org.gradle.parallel=true #Thu Mar 26 21:41:29 IST 2026 android.enableJetifier=false -android.enableR8.fullMode=true -android.nonFinalResIds=true android.nonTransitiveRClass=true android.useAndroidX=true kotlin.code.style=official @@ -25,3 +23,13 @@ org.gradle.workers.max=8 org.gradle.caching=true org.gradle.configuration-cache=true kotlin.incremental=true +android.defaults.buildfeatures.resvalues=true +android.sdk.defaultTargetSdkToCompileSdkIfUnset=false +android.enableAppCompileTimeRClass=false +android.usesSdkInManifest.disallowed=false +android.uniquePackageNames=false +android.dependency.useConstraints=true +android.r8.strictFullModeForKeepRules=false +android.r8.optimizedResourceShrinking=false +android.builtInKotlin=false +android.newDsl=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b7013a404c..e8a81dbe26 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ desugar = "2.1.5" diskLruCache = "1.5" documentfile = "1.1.0" fragment = "1.8.9" -gradle = "8.13.2" +gradle = "9.1.1" guava = "33.4.8-android" hilt = "1.3.0" json = "20250517" @@ -26,7 +26,7 @@ junit = "4.13.2" junitKtx = "1.3.0" kotlin = "2.2.10" kizzyRpc = "ad8f2e32eb" -ksp = "2.2.10-2.0.2" +ksp = "2.3.2" leakcanary = "3.0-alpha-8" lifecycle = "2.9.4" markwon = "4.6.2" @@ -53,6 +53,9 @@ webkit = "1.14.0" workRuntime = "2.10.5" workinspector = "1.2" window = "1.3.0" +composeBom = "2026.03.00" +activityCompose = "1.13.0" +lifecycleViewmodelCompose = "2.10.0" [libraries] adapterdelegates = { module = "com.hannesdorfmann:adapterdelegates4-kotlin-dsl", version.ref = "adapterdelegates" } @@ -124,6 +127,19 @@ ssiv = { module = "com.github.AppFuton:subsampling-scale-image-view", version.re workinspector = { module = "com.github.Koitharu:WorkInspector", version.ref = "workinspector" } androidx-window = { module = "androidx.window:window", version.ref = "window" } injekt-core = { module = "uy.kohesive.injekt:injekt-core", version = "1.16.1" } +compose-bom = { module = "androidx.compose:compose-bom", version.ref = "composeBom" } +compose-ui = { module = "androidx.compose.ui:ui" } +compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } +compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } +compose-foundation = { module = "androidx.compose.foundation:foundation" } +compose-material3 = { module = "androidx.compose.material3:material3" } +compose-material3-adaptive = { module = "androidx.compose.material3.adaptive:adaptive" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" } +androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "lifecycleViewmodelCompose" } +compose-runtime-livedata = { module = "androidx.compose.runtime:runtime-livedata" } +compose-runtime-rxjava2 = { module = "androidx.compose.runtime:runtime-rxjava2" } +compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" } +compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest" } [plugins] android-application = { id = "com.android.application", version.ref = "gradle" } @@ -133,3 +149,4 @@ kotlinx-serizliation = { id = "org.jetbrains.kotlin.plugin.serialization", versi ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } room = { id = "androidx.room", version.ref = "room" } decoroutinator = { id = "dev.reformator.stacktracedecoroutinator", version.ref = "decoroutinator" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3e781fbad9..4146564934 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=8fad3d78296ca518113f3d29016617c7f9367dc005f932bd9d93bf45ba46072b -distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip +distributionSha256Sum=b266d5ff6b90eada6dc3b20cb090e3731302e553a27c5d3e4df1f0d76beaff06 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME