Skip to content

Commit 71d366a

Browse files
committed
Fix: Reduced commit sizes
1 parent a684833 commit 71d366a

3 files changed

Lines changed: 23 additions & 120659 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ Android-APP/.gradle/
1818
Android-APP/.kotlin/
1919
Android-APP/local.properties
2020
Android-APP/gradlew.bat
21+
# Generated server bundle (esbuild output) — CI/local builds regenerate it via
22+
# "bun run build:android-bundle" + copy; see Android-APP/AGENTS.md BUILD section.
23+
Android-APP/app/src/main/assets/server_bundle/server.cjs

‎Android-APP/app/build.gradle.kts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,23 @@ dependencies {
7777
implementation("androidx.browser:browser:1.8.0")
7878
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
7979
}
80+
81+
// server.cjs is build output (gitignored), generated from ../../src by
82+
// "bun run build:android-bundle" + copy — release CI regenerates it before
83+
// packaging; local builds must too. Fail at build time rather than shipping
84+
// an APK whose NodeRunner dies on first launch over a missing bundle.
85+
val serverBundleFile = file("src/main/assets/server_bundle/server.cjs")
86+
val checkServerBundle = tasks.register("checkServerBundle") {
87+
doLast {
88+
val size = if (serverBundleFile.exists()) serverBundleFile.length() else 0L
89+
if (size < 1_000_000L) {
90+
throw GradleException(
91+
"server_bundle/server.cjs is missing or implausible ($size bytes). " +
92+
"Generate it first:\n" +
93+
" bun run build:android-bundle\n" +
94+
" cp dist/android/server.cjs Android-APP/app/src/main/assets/server_bundle/server.cjs"
95+
)
96+
}
97+
}
98+
}
99+
tasks.named("preBuild") { dependsOn(checkServerBundle) }

0 commit comments

Comments
 (0)