Skip to content

Commit 1f50a65

Browse files
build: update dependencies and modernize Gradle configuration
This commit updates several build dependencies, configures the Gradle toolchain with Foojay, and refactors build scripts for better maintainability. Key changes: - **Dependency Updates**: - Android Gradle Plugin (AGP) upgraded from `9.0.0` to `9.1.0`. - Kotlin version bumped from `2.3.0` to `2.3.20`. - Gradle wrapper updated to `9.3.1`. - Compose BOM updated to `2026.03.01`. - activityCompose updated to `1.13.0`. - Landscapist BOM updated to `2.9.6`. - spotless updated to `8.4.0`. - **Build & Tooling**: - Added Foojay resolver convention plugin and generated `gradle-daemon-jvm.properties` for Java 21 toolchain management. - Refactored `build.gradle.kts` to extract `configureDetektAndSpotless` into a separate function for better code organization. - Removed `android.r8.strictFullModeForKeepRules=false` from `gradle.properties`. - **Code Style**: - Updated `.editorconfig` with global settings for `insert_final_newline`, `max_line_length`, and explicit indentation rules for Kotlin files.
1 parent 9112635 commit 1f50a65

7 files changed

Lines changed: 54 additions & 22 deletions

File tree

.editorconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
insert_final_newline = true
6+
max_line_length = 120
7+
18
[*.{kt,kts}]
9+
indent_style = space
10+
indent_size = 4
211
ij_kotlin_allow_trailing_comma = false
312
ij_kotlin_allow_trailing_comma_on_call_site = false
4-
ktlint_function_naming_ignore_when_annotated_with = Composable, Test, Preview
13+
# ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 3
14+
ktlint_function_naming_ignore_when_annotated_with = Composable, Test, Preview

build.gradle.kts

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,24 @@ tasks.register("clean", Delete::class) {
2525
val detektVersion = libs.versions.detekt.get()
2626

2727
subprojects {
28-
// formatting code for all subprojects
28+
29+
configureDetektAndSpotless()
30+
31+
afterEvaluate {
32+
tasks.withType<KotlinCompile> {
33+
finalizedBy("spotlessApply")
34+
}
35+
36+
tasks.withType<KotlinCompile> {
37+
finalizedBy("detekt")
38+
}
39+
40+
}
41+
}
42+
43+
44+
// Function to configure Detekt and Spotless
45+
fun Project.configureDetektAndSpotless() {
2946
apply<SpotlessPlugin>()
3047
configure<SpotlessExtension> {
3148
kotlin {
@@ -39,29 +56,19 @@ subprojects {
3956
ktlint()
4057
}
4158
}
42-
// code analysis for all subprojects
59+
4360
apply<DetektPlugin>()
4461
configure<DetektExtension> {
4562
toolVersion = detektVersion
4663
config.from("$rootDir/config/detekt/detekt.yml")
4764
buildUponDefaultConfig = true
4865
}
66+
4967
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
5068
reports {
5169
xml.required.set(false)
5270
html.required.set(true)
5371
txt.required.set(false)
5472
}
5573
}
56-
57-
afterEvaluate {
58-
tasks.withType<KotlinCompile> {
59-
finalizedBy("spotlessApply")
60-
}
61-
62-
tasks.withType<KotlinCompile> {
63-
finalizedBy("detekt")
64-
}
65-
66-
}
6774
}

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ android.useAndroidX=true
33
kotlin.code.style=official
44

55
android.uniquePackageNames=false
6-
android.r8.strictFullModeForKeepRules=false
76
android.nonTransitiveRClass=true
87

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#This file is generated by updateDaemonJvm
2+
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
3+
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/ecd23fd7707c683afbcd6052998cb6a9/redirect
4+
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
5+
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect
6+
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/10fc3bf1ee0001078a473afe6e43cfdb/redirect
7+
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/9c55677aff3966382f3d853c0959bfb2/redirect
8+
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect
9+
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect
10+
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/23adb857f3cb3cbe28750bc7faa7abc0/redirect
11+
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/932015f6361ccaead0c6d9b8717ed96e/redirect
12+
toolchainVendor=JETBRAINS
13+
toolchainVersion=21

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[versions]
2-
agp = "9.0.0"
2+
agp = "9.1.0"
33
mavenPublish = "0.36.0"
4-
kotlin = "2.3.0"
4+
kotlin = "2.3.20"
55
detekt = "1.23.8"
6-
spotless = "8.2.1"
6+
spotless = "8.4.0"
77

88

99

@@ -17,11 +17,11 @@ jdkVersion = "VERSION_24"
1717
core-splashscreen = "1.2.0"
1818

1919
# compose
20-
activityCompose = "1.12.3"
21-
composeBom = "2026.01.01"
20+
activityCompose = "1.13.0"
21+
composeBom = "2026.03.01"
2222

2323
# landscapist
24-
landscapistBom = "2.9.3"
24+
landscapistBom = "2.9.6"
2525

2626
[libraries]
2727
# core
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Nov 22 15:17:24 IST 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ pluginManagement {
55
gradlePluginPortal()
66
}
77
}
8+
plugins {
9+
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
10+
}
811
dependencyResolutionManagement {
912
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
1013
repositories {

0 commit comments

Comments
 (0)