From 8a6c358257929398824bf4554ccc334d3958de36 Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Sat, 24 Oct 2026 14:24:28 -0700 Subject: [PATCH] build: copy the APK to build/ instead of moving it, so incremental builds come out whole --- gearslip/build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gearslip/build.gradle.kts b/gearslip/build.gradle.kts index 725fb06..f9d217a 100644 --- a/gearslip/build.gradle.kts +++ b/gearslip/build.gradle.kts @@ -106,9 +106,10 @@ android { } -// Renames the produced APK and moves it to the root build/ folder (/build/Gearslip-debug.apk) -// after the fact rather than fighting AGP's variant-output API across versions - simpler and -// doesn't break when that API moves again. +// Copies the produced APK to the root build/ folder (/build/Gearslip-debug.apk) after the +// fact rather than fighting AGP's variant-output API across versions - simpler and doesn't break +// when that API moves again. A copy, not a move: AGP packages incrementally into the APK it left +// last time, and with that file gone a build came out holding nothing but classes.dex. tasks.register("renameApk") { doLast { val rootBuildDir = rootProject.layout.buildDirectory.get().asFile @@ -118,7 +119,6 @@ tasks.register("renameApk") { .forEach { apk -> val renamed = File(rootBuildDir, "Gearslip-${apk.parentFile.name}.apk") apk.copyTo(renamed, overwrite = true) - apk.delete() } } }