From c3478e86c30bb80f8bb8b6ee1808067fe5bb1dcb Mon Sep 17 00:00:00 2001 From: Davide Depau Date: Wed, 4 Nov 2026 19:06:22 +0100 Subject: [PATCH] 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. --- app/build.gradle.kts | 3 --- settings.gradle.kts | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a0b103e..b5a4188 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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) diff --git a/settings.gradle.kts b/settings.gradle.kts index 58f7f6d..d2c736f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -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")