Skip to content

Commit 69ed3cc

Browse files
ADFA-4592: Stop wiping app/build every debug build to restore incremental compiles (#1492)
The debug.yml workflow wiped the whole :app module build dir on every run via two 'rm -rf app/build/' steps, forcing a full recompile+redex of the ~51K-LOC :app module each build and masking the build-time savings from migrating features into plugins. - Remove the pre-assembly 'Clean build cache before assembly' step (added as a workaround for stale-DEX D8 crashes from the now-removed llama/agent custom dexing path). - Narrow the post-upload cleanup from 'rm -rf app/build/' to 'rm -rf app/build/outputs/apk/' so a stale APK is never selected while the compiled :app intermediates are preserved for incremental builds. - Remove the dead registerD8Task function and its unused FileNotFoundException import / top-level isWindows helper from app/build.gradle.kts.
1 parent 2678552 commit 69ed3cc

2 files changed

Lines changed: 7 additions & 44 deletions

File tree

‎.github/workflows/debug.yml‎

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ jobs:
134134
run: |
135135
flox activate -d flox/base -- ./gradlew :plugin-api:apiCheck --no-daemon
136136
137-
- name: Clean build cache before assembly
138-
run: |
139-
echo "Cleaning stale build artifacts..."
140-
rm -rf app/build/
141-
echo "Build cache cleaned successfully"
142-
143137
- name: Assemble Universal APK
144138
run: |
145139
echo "gradle_time_start=$(date +%s)" >> $GITHUB_ENV
@@ -383,11 +377,14 @@ jobs:
383377
exit 1
384378
fi
385379
386-
- name: Clean up build folder after upload
380+
- name: Clean up APK output after upload
387381
run: |
388-
echo "Cleaning up build folder after Firebase upload..."
389-
rm -rf app/build/
390-
echo "Build folder cleanup completed"
382+
echo "Removing built APK(s) after Firebase upload..."
383+
# Only remove the packaged APKs (prevents 'Find APK file' from picking a
384+
# stale APK on the next run). Compiled intermediates are preserved so the
385+
# next build compiles :app incrementally instead of from scratch.
386+
rm -rf app/build/outputs/apk/
387+
echo "APK output cleanup completed"
391388
392389
- name: Send Rich Slack Notification
393390
env:

‎app/build.gradle.kts‎

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import org.json.JSONObject
99
import java.io.BufferedInputStream
1010
import java.io.BufferedOutputStream
1111
import java.io.FileInputStream
12-
import java.io.FileNotFoundException
1312
import java.io.FileOutputStream
1413
import java.net.HttpURLConnection
1514
import java.net.URI
@@ -27,39 +26,6 @@ import java.util.zip.ZipInputStream
2726
import java.util.zip.ZipOutputStream
2827
import kotlin.reflect.jvm.javaMethod
2928

30-
val isWindows = System.getProperty("os.name").lowercase().contains("windows")
31-
32-
fun TaskContainer.registerD8Task(
33-
taskName: String,
34-
inputJar: File,
35-
outputDex: File,
36-
): org.gradle.api.tasks.TaskProvider<Exec> {
37-
val androidSdkDir = android.sdkDirectory.absolutePath
38-
val buildToolsVersion = android.buildToolsVersion // Gets the version from your project
39-
val d8Executable =
40-
File(
41-
"$androidSdkDir/build-tools/$buildToolsVersion/" +
42-
if (isWindows) "d8.bat" else "d8",
43-
)
44-
45-
if (!d8Executable.exists()) {
46-
throw FileNotFoundException("D8 executable not found at: ${d8Executable.absolutePath}")
47-
}
48-
49-
return register<Exec>(taskName) {
50-
inputs.file(inputJar)
51-
outputs.file(outputDex)
52-
53-
commandLine(
54-
d8Executable.absolutePath,
55-
"--release", // Enables optimizations
56-
"--output",
57-
outputDex.parent, // D8 outputs to a directory
58-
inputJar.absolutePath,
59-
)
60-
}
61-
}
62-
6329
plugins {
6430
id("com.android.application")
6531
id("kotlin-android")

0 commit comments

Comments
 (0)