fix(build): decide GPlay plugins before the plugins blocks run

Gradle runs a build script's plugins {} block before the rest of the
script, so the flavor property set in app/build.gradle.kts was only seen
by the next build in the same daemon. A fresh daemon skipped the Sentry
plugin and then failed configuring the missing 'sentry' extension; a
FOSS build after a GPlay one got the Google plugins. Set it in
settings.gradle.kts, which is evaluated before any project script.
This commit is contained in:
Davide Depau committed 2026-11-04 19:06:22 +01:00
1 parent 4e821e4ea4
commit c3478e86c3
2 files changed
+5 -3

No files matched your search

-3
View File
@@ -1,8 +1,5 @@
@file:Suppress("UnstableApiUsage")
val isGPlayFlavor = gradle.startParameter.taskNames.any { it.lowercase().contains("gplay") }
System.setProperty("etchdroid.isGPlayFlavor", isGPlayFlavor.toString())
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.parcelize)
+5
View File
@@ -18,5 +18,10 @@ dependencyResolutionManagement {
}
}
// Read by the build scripts' plugins {} blocks, which Gradle runs before any other code in those
// scripts, so it must be set here. Setting it on every run also overwrites the daemon's stale value.
val isGPlayFlavor = gradle.startParameter.taskNames.any { it.lowercase().contains("gplay") }
System.setProperty("etchdroid.isGPlayFlavor", isGPlayFlavor.toString())
rootProject.name = "EtchDroid"
include(":app")