fix: use doFirst instead of onlyIf for keystore validation task
dev / Build debug APK (push) Failing after 18s

This commit is contained in:
Incido Developer committed 2026-08-20 08:10:06 +12:00
1 parent 06d647cf72
commit 4bbe29851a
1 file changed
+2 -3
+2 -3
View File
@@ -73,10 +73,10 @@ android {
// Fail fast with an actionable message only when assembleRelease actually // Fail fast with an actionable message only when assembleRelease actually
// runs and the keystore is missing — not during project configuration. // runs and the keystore is missing — not during project configuration.
tasks.register<AbstractTask>("validateReleaseKeystore") { tasks.register("validateReleaseKeystore") {
group = "build" group = "build"
description = "Validates that keystore/release.jks exists before assembleRelease runs" description = "Validates that keystore/release.jks exists before assembleRelease runs"
onlyIf { doFirst {
val f = rootProject.file("keystore/release.jks") val f = rootProject.file("keystore/release.jks")
if (!f.exists()) { if (!f.exists()) {
throw GradleException( throw GradleException(
@@ -92,7 +92,6 @@ android {
"L=Local, ST=Local, C=NZ\"" "L=Local, ST=Local, C=NZ\""
) )
} }
true
} }
} }
tasks.named("assembleRelease") { dependsOn("validateReleaseKeystore") } tasks.named("assembleRelease") { dependsOn("validateReleaseKeystore") }