Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 14 additions & 19 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
@file:Suppress("UnstableApiUsage")
import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode

import org.jetbrains.kotlin.gradle.dsl.JvmTarget


plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.devtools.ksp")
id("androidx.baselineprofile")
id("org.jetbrains.kotlin.plugin.compose") version "2.4.0"
Expand All @@ -18,7 +17,8 @@ plugins {
kotlin {
compilerOptions {
jvmTarget = JvmTarget.fromTarget("17")
freeCompilerArgs = listOf("-Xjvm-default=all-compatibility", "-opt-in=kotlin.RequiresOptIn")
optIn.add("kotlin.RequiresOptIn")
jvmDefault.set(JvmDefaultMode.ENABLE)
}
}

Expand Down Expand Up @@ -67,7 +67,7 @@ android {

sourceSets {
// Adds exported schema location as test app assets.
getByName("androidTest").assets.srcDir("$projectDir/schemas")
getByName("androidTest").assets.directories.add("$projectDir/schemas")
}

if (project.hasProperty("RELEASE_STORE_FILE")) {
Expand All @@ -91,14 +91,9 @@ android {
signingConfig = signingConfigs.getByName("release")
}

// Keep using until AGP 9.0 then research proguard rules to retain debug info for stack traces
postprocessing {
isRemoveUnusedCode = true
isObfuscate = false
isOptimizeCode = true
isRemoveUnusedResources = true
proguardFiles("proguard-rules.pro")
}
isMinifyEnabled = true
isShrinkResources = true
proguardFiles("proguard-rules.pro")
}
debug {
applicationIdSuffix = ".debug"
Expand Down Expand Up @@ -131,13 +126,14 @@ dependencies {
// Exporting / importing DB helper
implementation("com.github.dessalines:room-db-export-import:0.1.1")

val composeBom = platform("androidx.compose:compose-bom:2026.06.00")
val composeBom = platform("androidx.compose:compose-bom:2026.06.01")

implementation(composeBom)
androidTestImplementation(composeBom)

api(composeBom)
implementation("androidx.activity:activity-ktx")
implementation("androidx.activity:activity-compose")
implementation("androidx.appcompat:appcompat:1.7.1")
androidTestApi(composeBom)
testImplementation("androidx.arch.core:core-testing:2.2.0")

implementation("me.zhanghai.compose.preference:library:1.1.1")
Expand Down Expand Up @@ -188,7 +184,6 @@ dependencies {
implementation("androidx.room:room-ktx:2.8.4")

// optional - Test helpers
testImplementation("androidx.room:room-testing:2.8.4")
testImplementation("pl.pragmatists:JUnitParams:1.1.1")
androidTestImplementation("androidx.room:room-testing:2.8.4")

Expand All @@ -209,15 +204,15 @@ dependencies {
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.11.0")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit")
androidTestImplementation("androidx.test.espresso:espresso-core")
androidTestImplementation("androidx.test.ext:junit:1.3.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")

testImplementation("org.mockito:mockito-core:5.23.0")
testImplementation("org.mockito.kotlin:mockito-kotlin:6.3.0")

implementation("androidx.browser:browser:1.10.0")

implementation("androidx.profileinstaller:profileinstaller")
implementation("androidx.profileinstaller:profileinstaller:1.4.1")
baselineProfile(project(":benchmarks"))

implementation("it.vercruysse.lemmyapi:lemmy-api:0.4.1")
Expand Down
15 changes: 11 additions & 4 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,23 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

# AGP 9 removed the build type postprocessing DSL. Keep the previous release
# behavior by configuring the equivalent R8 option here.
-dontobfuscate

# Optional Jetpack Window extensions are supplied by the platform on supported
# devices and are intentionally absent from the application dependency graph.
-dontwarn androidx.window.extensions.**
-dontwarn androidx.window.sidecar.**

# With R8 full mode generic signatures are stripped for classes that are not
# kept. Suspend functions are wrapped in continuations where the type argument
# is used.
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation


# Some prettytime stuff
-keep class com.ocpsoft.pretty.time.i18n.**
-keep class org.ocpsoft.prettytime.i18n.**
-keepnames class ** implements org.ocpsoft.prettytime.TimeUnit
# PrettyTime needed
-keep class org.ocpsoft.prettytime.i18n.** { *; }

# Ktor needs this
-dontwarn org.slf4j.impl.StaticLoggerBinder
Expand Down
11 changes: 7 additions & 4 deletions benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
@file:Suppress("UnstableApiUsage")
import com.android.build.api.dsl.ManagedVirtualDevice
import org.jetbrains.kotlin.gradle.dsl.JvmDefaultMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.test")
id("org.jetbrains.kotlin.android")
id("androidx.baselineprofile")
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.fromTarget("17")
freeCompilerArgs = listOf("-Xjvm-default=all-compatibility", "-opt-in=kotlin.RequiresOptIn")
jvmDefault.set(JvmDefaultMode.ENABLE)
}
}

Expand All @@ -30,6 +29,10 @@ android {
targetSdk = 36

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

// The :app module declares a "version" flavor dimension (fdroid/gplay).
// The test module must pick one so Gradle can resolve the :app variant.
missingDimensionStrategy("version", "fdroid")
}

targetProjectPath = ":app"
Expand Down Expand Up @@ -65,7 +68,7 @@ baselineProfile {
dependencies {
implementation("androidx.test.ext:junit:1.3.0")
implementation("androidx.test.espresso:espresso-core:3.7.0")
implementation("androidx.test.uiautomator:uiautomator:2.3.0")
implementation("androidx.test.uiautomator:uiautomator:2.4.0")
implementation("androidx.benchmark:benchmark-macro-junit4:1.4.1")
}

Expand Down
25 changes: 19 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("com.android.application") version "8.13.2" apply false
id("com.android.library") version "8.13.2" apply false
id("com.android.test") version "8.13.2" apply false
id("org.jetbrains.kotlin.android") version "2.4.0" apply false
id("com.android.application") version "9.2.1" apply false
id("com.android.library") version "9.2.1" apply false
id("com.android.test") version "9.2.1" apply false
id("org.jmailen.kotlinter") version "5.5.0" apply false
id("com.google.devtools.ksp") version "2.3.9" apply false
id("androidx.baselineprofile") version "1.4.1" apply false
id("com.google.devtools.ksp") version "2.3.10" apply false
id("androidx.baselineprofile") version "1.5.0-alpha07" apply false
}

subprojects {
apply(plugin = "org.jmailen.kotlinter") // Version should be inherited from parent
}

// AGP 9.0 has a runtime dependency on the Kotlin Gradle plugin (KGP), defaulting to 2.2.10.
// To use a higher KGP version, declare it here on the top-level buildscript classpath.
// see https://developer.android.com/build/releases/agp-9-0-0-release-notes

// If not forced to 2.4.0, ComposeMappingFile task fails since it will try to get 2.2.10 dependency
// But that was only added in 2.3.0
// https://kotlinlang.org/docs/whatsnew23.html#compose-compiler-stack-traces-for-minified-android-applications
buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.4.0")
}
}


// Enables compose compiler metrics
// Generate them with `./gradlew assembleRelease --rerun-tasks -P enableComposeCompilerReports=true`
// see https://github.com/androidx/androidx/blob/androidx-main/compose/compiler/design/compiler-metrics.md
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache=true
8 changes: 2 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#Fri Jul 10 01:01:31 CEST 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=bafc141b619ad6350fd975fc903156dd5c151998cc8b058e8c1044ab5f7b031f
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists