Skip to content

Commit c9edfc7

Browse files
committed
chore: migrate to AGP 9.1.1 and Gradle 9.3.1
- Upgrade AGP from 8.9.3 to 9.1.1 and Gradle wrapper from 8.11.1 to 9.3.1 - Remove de.nanogiants.android-versioning plugin (incompatible with Gradle 9 due to removed convention API); replace with inline gitVersionCode() using providers.exec for the same git rev-list --count HEAD logic - Fix OpenCV proguard: use proguard-android-optimize.txt (AGP 9 removed support for the non-optimize variant) - Move resValues = true from global gradle.properties into the app module buildFeatures block (the global default property is deprecated) - Remove deprecated gradle.properties options no longer recognized: android.sdk.defaultTargetSdkToCompileSdkIfUnset, android.enableAppCompileTimeRClass, android.usesSdkInManifest.disallowed, android.r8.optimizedResourceShrinking Remaining deprecated options kept intentionally: - android.builtInKotlin=false and android.newDsl=false opt out of AGP 9 built-in Kotlin support. Removing them requires dropping org.jetbrains.kotlin.android from all 100+ modules and migrating to AGP built-in Kotlin compilation — planned as a follow-up. Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 12df3af commit c9edfc7

6 files changed

Lines changed: 18 additions & 16 deletions

File tree

apps/flipcash/app/build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ plugins {
1414
alias(libs.plugins.firebase.perf)
1515
alias(libs.plugins.bugsnag.gradle)
1616
alias(libs.plugins.secrets)
17-
alias(libs.plugins.versioning)
1817
id("org.jetbrains.kotlin.plugin.compose")
1918
alias(libs.plugins.kover)
2019
}
2120

21+
fun gitVersionCode(): Int {
22+
val result = providers.exec {
23+
commandLine("git", "rev-list", "--count", "HEAD")
24+
}.standardOutput.asText.get().trim()
25+
return result.toInt().also { println("VersionCode $it") }
26+
}
27+
2228
val contributorsSigningConfig = ContributorsSignatory(rootProject)
2329
val appNamespace = "${Gradle.flipcashNamespace}.app.android"
2430

@@ -28,7 +34,7 @@ android {
2834
compileSdk = Android.compileSdkVersion
2935

3036
defaultConfig {
31-
versionCode = Packaging.Flipcash.versionCode ?: versioning.getVersionCode()
37+
versionCode = Packaging.Flipcash.versionCode ?: gitVersionCode()
3238
versionName = Packaging.Flipcash.versionName
3339
applicationId = appNamespace
3440
minSdk = Android.minSdkVersion
@@ -54,6 +60,7 @@ android {
5460
buildFeatures {
5561
buildConfig = true
5662
compose = true
63+
resValues = true
5764
}
5865

5966
buildTypes {
@@ -101,11 +108,6 @@ configurations.all {
101108
exclude(group = "com.google.firebase", module = "firebase-crashlytics")
102109
}
103110

104-
versioning {
105-
excludeBuildTypes = "debug"
106-
keepOriginalBundleFile = true
107-
}
108-
109111
bugsnag {
110112
variants {
111113
release {

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ plugins {
2929
alias(libs.plugins.bugsnag.android) apply false
3030
alias(libs.plugins.bugsnag.gradle) apply false
3131
alias(libs.plugins.secrets) apply false
32-
alias(libs.plugins.versioning) apply false
3332
alias(libs.plugins.navigation.safeargs) apply false
3433
alias(libs.plugins.protobuf) apply false
3534
alias(libs.plugins.androidx.room) apply false

gradle.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,9 @@ android.nonTransitiveRClass=false
3636
android.defaults.buildfeatures.usestaticrclass=true
3737
# Enables Kotlin compilation for Android testFixtures source sets
3838
android.experimental.enableTestFixturesKotlinSupport=true
39-
android.suppressUnsupportedOptionWarnings=android.suppressUnsupportedOptionWarnings,android.experimental.enableTestFixturesKotlinSupport
39+
android.suppressUnsupportedOptionWarnings=android.suppressUnsupportedOptionWarnings,android.experimental.enableTestFixturesKotlinSupport
40+
android.uniquePackageNames=false
41+
android.dependency.useConstraints=true
42+
android.r8.strictFullModeForKeepRules=false
43+
android.builtInKotlin=false
44+
android.newDsl=false

gradle/libs.versions.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ kotlinx-serialization = "1.11.0"
66
kotlinx-datetime = "0.7.1"
77

88
kover = "0.9.8"
9-
agp = "8.9.3"
9+
agp = "9.1.1"
1010
google-services = "4.4.4"
1111

1212
androidx-appcompat = "1.7.1"
@@ -97,7 +97,6 @@ archCore = "2.2.0"
9797
screenshot = "0.0.1-alpha14"
9898

9999
secrets-gradle-plugin = "2.0.1"
100-
versioning-gradle-plugin = "2.4.0"
101100
firebase-perf-plugin = "2.0.2"
102101
uiToolingPreview = "1.11.0"
103102
uiTooling = "1.11.0"
@@ -334,7 +333,6 @@ firebase-perf = { id = "com.google.firebase.firebase-perf", version.ref = "fireb
334333
bugsnag-android = { id = "com.bugsnag.android.gradle", version.ref = "bugsnag-agp" }
335334
bugsnag-gradle = { id = "com.bugsnag.gradle", version.ref = "bugsnag-gradle-plugin" }
336335
secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets-gradle-plugin" }
337-
versioning = { id = "de.nanogiants.android-versioning", version.ref = "versioning-gradle-plugin" }
338336
navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "androidx-navigation" }
339337
protobuf = { id = "com.google.protobuf", version.ref = "protobuf-plugin" }
340338
androidx-room = { id = "androidx.room", version.ref = "androidx-room" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue May 13 10:46:03 EDT 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

vendor/opencv/sdk/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ android {
110110
minSdkVersion Android.minSdkVersion
111111
targetSdkVersion Android.targetSdkVersion
112112

113-
versionCode openCVersionCode
114-
versionName openCVersionName
115113

116114
externalNativeBuild {
117115
cmake {
@@ -142,7 +140,7 @@ android {
142140
doNotStrip '**/*.so' // controlled by OpenCV CMake scripts
143141
}
144142
minifyEnabled false
145-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
143+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.txt'
146144
}
147145
}
148146

0 commit comments

Comments
 (0)