Skip to content

Commit

Permalink
Update to AGP 8.8.0 and fix launcher icon label with multiple flavor …
Browse files Browse the repository at this point in the history
…dimensions
  • Loading branch information
M-Wong committed Feb 4, 2025
1 parent c4c0710 commit a8ce784
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ abstract class AlpakaPlugin : Plugin<Project> {
}

private fun getLauncherIconLabel(applicationVariant: ApplicationVariant, androidExtension: AppExtension): String? {
val productFlavor = applicationVariant.productFlavors.firstOrNull()
return productFlavor?.flavorLauncherIconLabel ?: androidExtension.defaultConfig.launcherIconLabel
return applicationVariant.productFlavors.firstNotNullOfOrNull { it.flavorLauncherIconLabel }
?: androidExtension.defaultConfig.launcherIconLabel
}

}
19 changes: 19 additions & 0 deletions examplekts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,28 @@ android {
alpakaUploadKey = "defaultConfig upload key"
}

flavorDimensions += "app"
flavorDimensions += "default"

productFlavors {
create("mainApp") {
dimension = "app"
launcherIconLabel = null

if (launcherIconLabel != null) {
error("Expected launcherIconLabel null but was $launcherIconLabel")
}
}

create("previewApp") {
dimension = "app"
launcherIconLabel = null

if (launcherIconLabel != null) {
error("Expected launcherIconLabel null but was $launcherIconLabel")
}
}

create("dev") {
dimension = "default"
applicationIdSuffix = ".dev"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
agp = "8.7.0"
kotlin = "2.0.20"
agp = "8.8.0"
kotlin = "2.1.10"
pluginPublish = "1.2.2"
vanniktech = "0.29.0"

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit a8ce784

Please sign in to comment.