From 44860a27245cb6d204b15b9cd2c4dd68a28232a4 Mon Sep 17 00:00:00 2001 From: "bramha.dev" Date: Sat, 31 Oct 2026 15:10:33 +0530 Subject: [PATCH] fix(build): the daemon-payload guard runs only on the tasks that produce the app The guard was attached to every task starting with "bundle" or "assemble", including AGP's intermediate bundleReleaseResources, which runs before mergeReleaseAssets stages the daemon. On a clean checkout the guard failed a build that was fine: the first main run of the beta workflow died with "Daemon payload missing". Locally the staged folder is left from earlier builds, so it never showed. --- composeApp/build.gradle.kts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 45e78f3..49b4666 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -429,7 +429,12 @@ tasks.matching { it.name.startsWith("merge") && it.name.endsWith("Assets") }.con // A build that produced no payload would ship a broken app, so fail loudly at assemble time // rather than at the user's first launch. -tasks.matching { it.name.startsWith("assemble") || it.name.startsWith("bundle") }.configureEach { +// +// Only the tasks that PRODUCE the app. A `startsWith("bundle")` match also caught AGP's intermediate +// bundleReleaseResources, which runs BEFORE mergeReleaseAssets stages the daemon: on a clean checkout (CI) the guard +// failed a build that was fine, and it never showed locally because the staged folder is left over from earlier builds. +val appPackagingTasks = Regex("(assemble|bundle)(Debug|Release)") +tasks.matching { appPackagingTasks.matches(it.name) }.configureEach { doLast { val cli = stagedDaemonAssets.file("dist/cli.js").asFile if (!cli.exists()) {