build: copy the APK to build/ instead of moving it, so incremental builds come out whole

This commit is contained in:
Seb3thehacker committed 2026-10-24 14:24:28 -07:00
1 parent de01448f1b
commit 8a6c358257
1 file changed
+4 -4
+4 -4
View File
@@ -106,9 +106,10 @@ android {
} }
// Renames the produced APK and moves it to the root build/ folder (<root>/build/Gearslip-debug.apk) // Copies the produced APK to the root build/ folder (<root>/build/Gearslip-debug.apk) after the
// after the fact rather than fighting AGP's variant-output API across versions - simpler and // fact rather than fighting AGP's variant-output API across versions - simpler and doesn't break
// doesn't break when that API moves again. // 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") { tasks.register("renameApk") {
doLast { doLast {
val rootBuildDir = rootProject.layout.buildDirectory.get().asFile val rootBuildDir = rootProject.layout.buildDirectory.get().asFile
@@ -118,7 +119,6 @@ tasks.register("renameApk") {
.forEach { apk -> .forEach { apk ->
val renamed = File(rootBuildDir, "Gearslip-${apk.parentFile.name}.apk") val renamed = File(rootBuildDir, "Gearslip-${apk.parentFile.name}.apk")
apk.copyTo(renamed, overwrite = true) apk.copyTo(renamed, overwrite = true)
apk.delete()
} }
} }
} }