diff --git a/scripts/build_android.sh b/scripts/build_android.sh index 417ff535..bdb535ba 100755 --- a/scripts/build_android.sh +++ b/scripts/build_android.sh @@ -202,8 +202,12 @@ pack_game_love() { # APK, so the mod manager's Delete can't remove it and it reappears every # launch. Pokewalker ships as an importable .zip instead, which gives it # a real install/upgrade/delete lifecycle. + # libs/ carries the vendored FlexLove toolkit the launcher UI is built on + # (src/import/LauncherView.lua requires it at the top level, and RomImporter + # calls into that view from both update and draw), so an archive without it + # dies on the first frame with nothing left to fall back to. (cd "$ROOT" && zip -q -9 -r "$LOVE_FILE" \ - main.lua conf.lua src data assets tools/save-editor \ + main.lua conf.lua src libs data assets tools/save-editor \ tools/rom_manifest.json tools/rom_manifest_blue.json \ tools/rom_manifest_yellow.json \ -x '*.DS_Store' -x '*/.git/*' -x '*/.DS_Store' \ @@ -220,6 +224,12 @@ pack_game_love() { || fail "game.love is missing the save editor (Edit on a save row would crash)" grep -qx "$YELLOW_MANIFEST_RELATIVE" <<< "$archive_entries" \ || fail "game.love is missing the Yellow ROM import manifest" + # This gate exists because libs/ was added to scripts/build.sh's payload and + # to no other packager, so Android and iOS built an APK/IPA whose launcher + # threw on require("libs.flexlove.FlexLove") before drawing anything. Source + # runs read libs/ off the working tree, so only a build can catch it. + grep -qx 'libs/flexlove/FlexLove.lua' <<< "$archive_entries" \ + || fail "game.love is missing the FlexLove UI toolkit (launcher dies on frame 1)" say "game.love: $(du -h "$LOVE_FILE" | cut -f1) -> $LOVE_FILE" # This script packs its own game.love (it does not reuse build.sh's), so it diff --git a/scripts/build_ios.sh b/scripts/build_ios.sh index d3fc2d77..ddc6fb1b 100755 --- a/scripts/build_ios.sh +++ b/scripts/build_ios.sh @@ -315,9 +315,13 @@ pack_game_love() { # it reappears every launch. Mods install as .zips at runtime instead # (launcher -> MODS -> Import mod .zip), the same lifecycle as every # other platform. + # libs/ carries the vendored FlexLove toolkit the launcher UI is built on + # (src/import/LauncherView.lua requires it at the top level, and RomImporter + # calls into that view from both update and draw), so an archive without it + # dies on the first frame with nothing left to fall back to. # shellcheck disable=SC2086 # MANIFESTS is a deliberate word list (cd "$ROOT" && zip -q -9 -r "$LOVE_FILE" \ - main.lua conf.lua src data assets tools/save-editor \ + main.lua conf.lua src libs data assets tools/save-editor \ $MANIFESTS \ -x '*.DS_Store' -x '*/.git/*' -x '*/.DS_Store' \ -x 'data/generated/*' -x 'assets/generated/*') @@ -333,10 +337,14 @@ pack_game_love() { # in 0.1.45 through 0.1.47: decodeManifest (src/import/RomImporter.lua) errors # outright when a version's manifest is absent, so Import ROM on Yellow died # in the built app while dev, which reads the source tree, stayed green. + # libs/flexlove/FlexLove.lua is on the list for the same reason: it was added + # to build.sh's payload and to no other packager, so the mobile builds shipped + # a launcher that threw before drawing its first frame. archive_entries="$(unzip -Z1 "$LOVE_FILE")" # shellcheck disable=SC2086 # MANIFESTS is a deliberate word list for required in src/update/Boot.lua tools/save-editor/App.lua \ tools/save-editor/Kit.lua tools/save-editor/panels/Party.lua \ + libs/flexlove/FlexLove.lua \ $MANIFESTS; do printf '%s\n' "$archive_entries" | grep -qx "$required" \ || fail "game.love is missing $required"