Skip to content

Latest commit

 

History

History
749 lines (636 loc) · 51.6 KB

shipping.md

File metadata and controls

749 lines (636 loc) · 51.6 KB

Shipping games

How a JasperEngine project becomes a game on every platform, and how a build becomes a release (docs/specs/S30-shipping.md). Agents: jasper://docs/shipping (docs/mcp/guide/shipping.md).

Two ways to build

Build Settings > Build (or jasperengine-editor build) makes a game for Windows, Linux, macOS, Android, iOS or the web. It picks one of two methods:

  • Prebuilt player (no compiler needed). The editor cooks the project's scenes and prefabs into a binary form (.jscn, .jpfb), writes game.json and content-manifest.json, and puts them next to a ready-made player executable, the player runtime of that platform. Seconds, with no C++ toolchain, Android NDK, Gradle or emsdk.

  • Compile from source. The editor exports the C++ project and compiles the engine with the game. The game is the prebuilt player's, compiled with the project's native code: it reads the same cooked scenes and prefabs and game.json (under the exported project's content/, put beside assets/ and lua/ by every platform's build), and the only C++ generated for it is the C++ scripts' entry points (main.cpp, scene_scripts.cpp), whatever the size of the scenes. It is needed when the project has

    • C++ scripts,
    • a ProjectBuild.cmake,
    • native plugins the prebuilt player cannot carry (Java/Kotlin, Gradle dependencies, C++ plugins: see "Native plugins in prebuilt builds" below),
    • or when Build Settings > Build Method says Compile.

    Content size is never a reason: meshes, sprites and tilemaps hold as many submeshes, bones, frames and tiles as they are given, in a prebuilt player as in the editor (there are no MAX_SUBMESHES-style capacities). A player runtime packaged before that change (only usable with the player-mismatch option) is refused with the reason "holds fixed array capacities". Compile builds drop the old capacity definitions, so each compile cache builds once more.

    Compiling makes builds for this computer's platform and for the web; other platforms are built from the exported source project (Export source, then Android Studio, Xcode or CMake).

The Build Method row of Build Settings shows the choice and why ("Compile from source: C++ scripts (Player.cpp)"); its combo forces Auto, Prebuilt or Compile (export.method in project.yaml). Both methods write the same content-manifest.json and licenses/, so releases treat them alike.

A build replaces its output folder only once it is complete, by either method: it is made in <folder>.staging-<pid> and swapped in at the end, so a failed or cancelled build leaves the previous one as it was, and a file the new build does not write is gone.

A build writes nothing in the project but its output folder and the editor's .jasperengine/ (the FBX imports it needs go to the import cache there). It cooks the scenes and prefabs as the editor holds them: an open scene or a Prefab Mode stage with unsaved changes ships as it is shown, its file stays as it was, and the build warns W-SCENE-UNSAVED naming it. Two builds of an unchanged project give the same bytes.

The project's own CMake build (its CMakeLists.txt opened in an IDE) reads what the editor cooks into .jasperengine/cooked/ whenever a scene is saved: game.json, scenes/ and prefabs/.

What a build checks

A build either ships what the project holds or fails and says why; it never reports success with something missing.

  • Every copy and write is checked. A file that can't be copied or written (the disk is full, a folder sits where the file goes) fails the build, naming the file and the reason. A folder that can't be read is left out with the warning W-UNREADABLE-FOLDER.
  • The output folder is never inside the project (or its assets or Lua folder): the editor would import the exported files as project assets. Build Settings marks such a folder in red and disables Build; the command line and MCP refuse it with the same text. Below a hidden folder (.jasperengine/builds, MCP's default) or the project's top-level build/ is fine. A path with a ; is refused too (CMake reads it as a list separator): rename the folder.
  • An earlier export left inside the project is left out of the next one (W-EXPORT-FOLDER-SKIPPED names it): a folder with jasperengine.py, content-manifest.json, the web player, the game's executable or its Android package. Its textures and models are not cooked either. Move it out of the project.
  • The engine workspaces' IDE output never ships (.gradle, .idea, local.properties, build/, xcuserdata, DerivedData, *.iml), and a re-export leaves the IDE state of an exported workspace alone: Android Studio keeps its local.properties and caches.
  • Shader variants: a scene's saved variants of a fork whose files were deleted go at its next save; one that only Build Settings or the warm-up list still names is left out with W-SHADER-FORK-MISSING. Stop adds the variants of what scripts made during Play (also in scenes a load replaced) to the warm-up list (ShaderWarmup.json), so the build ships them; it writes no scene file.
  • A scene never saved, or one with unsaved changes, ships as the editor holds it (W-SCENE-UNSAVED; Build Settings lists a never-saved one with a Save... button). A never-saved scene that is not open fails the build.
  • Build errors: a failed compile names its first error in the message ("Compiling failed with 2 error(s). First: scripts/Player.cpp:12: ..."), lists up to 20 in the Build dialog (each opens the file at the line; Copy Errors copies them) and repeats them at the end of the log. The Console counts compiler errors and warnings with its Error and Warning counters.
  • Warnings of every build are listed when it completes ("Build completed with 2 warning(s)"), by the command line, and in MCP's warnings[].

D3D11 shaders ship as bytecode when the build runs on Windows (the game skips compiling them); a Windows build made on Linux or macOS ships their HLSL source, which the game compiles when first used (the result's note says so).

Building an exported source project

Export source (Build Settings, jasperengine-editor export --project <dir> --out <dir>, MCP build_project mode: source) writes a CMake project with the engine, the game and two ways in. export --platform <windows|linux|macos|android|ios|web> compiles the shaders of that platform's backends only (Android and web: OpenGL ES 3), as the Build Settings preset does; --backend wins over it, and without either every backend is compiled.

  • cmake -S <dir> -B <dir>/build -DCMAKE_BUILD_TYPE=Release && cmake --build <dir>/build for this computer's platform.
  • ./jasperengine.py --platform <linux|windows|macos|web|macos-xcode|ios-xcode> (Python 3), which configures and builds; --dry-run prints the commands and runs nothing. For web it runs CMake with Emscripten's toolchain file (EMSDK set by emsdk_env, or emcc on PATH; Emscripten 6's Windows launchers work). On Windows a web build needs Ninja or mingw32-make: Ninja on PATH, else the one Visual Studio's C++ CMake tools install (found through vswhere), else mingw32-make; --generator picks one yourself.
  • Android: cd workspaces/androidstudio && ./gradlew assembleRelease (or open the folder in Android Studio). Android builds have OpenGL ES 3 only, so its Build Settings preset and export --platform android compile the GLES3 shaders alone.

The export keeps jasperengine.py and gradlew executable. A folder copied through Windows (NTFS has no execute bit) or an archive that drops modes needs chmod +x jasperengine.py workspaces/androidstudio/gradlew, or python3 jasperengine.py and bash ./gradlew.

Project Settings > Player > Window Title can hold any text: it reaches the game's compile as escaped bytes, so ;, #, quotes and every language build.

Toolchains

Native builds use pinned toolchains that the editor installs on demand under <user cache>/jasperengine/toolchains/ (JASPER_TOOLCHAINS_DIR moves it). Each download is checked against the SHA-256 compiled into the editor (tools/toolchains/*.json records where each one came from), unpacked into a temporary folder and renamed into place whole, so a refused, failed or cancelled install leaves nothing.

Tool Pinned Needed by
Temurin JDK 21.0.13.1+2 Android
Android SDK command-line tools, build-tools, platform, NDK, CMake 23.0, 35.0.0, android-34/35/36, r28c (28.2.13676358), 3.22.1 Android
Gradle 9.6.0 (the template's wrapper, with distributionSha256Sum) Android builds with SDK dependencies
emsdk 6.0.10 prebuilt web builds
Linux Clang toolchain and glibc 2.35 sysroot linux-x64-clang-23.1.6-r1 Linux C++ builds

Visual Studio and Xcode are not installed by the editor; it checks them against a floor: an MSVC toolset of 14.44 or newer (Visual Studio 2022 17.14), with Update Visual Studio or Install Visual Studio, and Xcode 26.1.1 or newer (a macOS game also takes the Command Line Tools of that version, Install Command Line Tools).

Preferences > External Tools > Toolchains lists each with its state and Install. From a shell:

jasperengine-editor toolchains list [--json]
jasperengine-editor toolchains install android | android-template | web | linux | <tool>...
jasperengine-editor toolchains remove <tool>

The Android SDK is Google's, under its licence: the install shows it, in a dialog or on the terminal, and only the user accepts it. A decline installs nothing of the SDK. A user's own SDK, JDK or Gradle (Preferences > External Tools) is used only when chosen there, and the Linux compiler is the pinned toolchain unless Preferences > External Tools > Linux Compiler says System compiler; the build reports either as unpinned.

Player runtimes

A runtime is named <platform>-<arch>-<backend>-<flavour>, for example linux-x64-glcore-release or web-wasm32-gles3-development. The flavour follows Development Build (profiler and --profile). The editor install ships the runtimes of its own platform and the web; Build Settings downloads the others ("Download (NN MB)"), checked against the SHA-256 values built into that editor release. Preferences > External Tools lists the installed ones, with Remove and Install from file.

Platform Backends Arch What the build makes
Windows d3d11, glcore, vulkan x64 <Game>.exe (its icon and version resource patched in), content/
Linux glcore, gles3, vulkan x64 <Game> (executable), <Game>.desktop, the content
macOS metal, glcore universal <Game>.app (Info.plist, icon, signed when codesign or rcodesign is set up; warning W-MAC-UNSIGNED otherwise)
Android gles3 universal (arm64-v8a, armeabi-v7a, x86_64; no 32-bit x86: an old project's x86 is dropped with a warning) <Game>.aab, <Game>-<abi>.apk or <Game>.apk, signed
iOS metal arm64 the Xcode project; on a Mac with Xcode the .ipa (or a simulator .app)
Web gles3 (WebGL 2), single-thread and pthreads wasm32 index.html, the two players, content.jpak, coi-serviceworker.js

From the command line:

jasperengine-editor players list
jasperengine-editor players download linux-x64-vulkan-release
jasperengine-editor players install jasperengine-player-<id>-<version>.zip
jasperengine-editor players remove <id>

An engine checkout builds its own runtimes: tools/build.sh players (Linux; PLAYER_PLATFORM=web and PLAYER_PLATFORM=android for those), into build/players/, or into the directory PLAYERS_OUT names (inside the checkout or outside it); point the editor at them with JASPER_PLAYERS_DIR=build/players or --players-dir. Its build trees stay in the checkout (build/players-build/, and Gradle's engine/workspaces/androidstudio/app/build/ for Android). A runtime is locked to the editor version it was built with, and reads the cooked content format of that version (contentFormatVersion, major.minor). A newer minor only adds what an older player skips: the editor does not use a runtime of an older minor than it cooks ("reads content format ..., older than the ... this editor writes: update the player runtime") unless the player-mismatch option asks for it (warning W-PLAYER-MISMATCH, and publish verify refuses the build). A build's minor is what its content uses: a build without a Build Profile is 1.5, which every 1.5 runtime serves; a profile's build is 1.6, and an older runtime is refused for it even with the player-mismatch option. A player runs content of a newer minor without what is newer, with one warning ("content ... was made by a newer editor; features newer than ... are skipped"), and refuses another major at start (exit 5).

Prebuilt engine library

A compiled build (C++ scripts, a native plugin, Build Method Compile) compiles only the game's own code and links the prebuilt engine library of the editor's release, instead of compiling the engine (docs/specs/S102-prebuilt-engine-library.md). Each one is named like a player runtime, enginelib-<id> (enginelib-linux-x64-glcore-release-ui); a build downloads the one it needs the first time, the smallest variant that holds the modules it compiles, checked against the SHA-256 values built into the editor, into <user cache>/jasperengine/enginelibs/<editor version>/.

The Engine Library row of Build Settings says what the build links: "Prebuilt (downloaded)", "Prebuilt (download NN MB)", or "Compiled locally: ". Its combo (Project Settings > Player, player.engine_library, build.engineLibrary in project.yaml) is Auto, Prebuilt (fail, listing every reason, when it cannot be used) or Compile Locally. Auto compiles the engine, and says why, when the editor is not a release, the project has a ProjectBuild.cmake, the build is not Release C++20, no variant holds its modules, or the archive's fingerprint is not this engine's.

A toolchain that cannot link the library stops the build instead: Android needs NDK r28c, the web the editor's emsdk 6.0.10, Linux the pinned Clang toolchain, Windows Visual Studio 2022 17.14 or newer, macOS and iOS Xcode 26.1.1 or newer (a macOS game: or its Command Line Tools). The row offers the fix (Install, Update Visual Studio, Install Command Line Tools) beside Compile Locally, the explicit choice to compile the engine with the tools you have.

jasperengine-editor build --project P --platform linux --out D [--engine-library auto|prebuilt|local]
jasperengine-editor players download enginelib-linux-x64-glcore-release
jasperengine-editor players install jasperengine-enginelib-<id>-<version>.zip

build prints engine_library: prebuilt <id> or engine_library: local (<reason>); MCP build_project returns engine_library and engine_library_reasons, with next naming the fix. An engine checkout points the editor at its own archives with --engine-libs-dir or JASPER_ENGINE_LIBS_DIR; JASPER_ENGINE_LIBRARY=local forces the engine's compile (the MCP tests of the compile path).

Player size: Strip Engine Code

A game ships only the engine modules it can use (docs/specs/S34-player-size.md). The optional modules are the HTML UI (UI Documents, their Lua API, anime, widgets, effects, on-screen controls), its <video>, the runtime shader compiler, 3D physics (Jolt), 2D physics (Box2D) and navigation meshes. The build finds what the project reaches:

  • a UI Document, Rigidbody, joint, character controller or Buoyancy in a scene or prefab, or a Spline Extrude with collision;
  • a Lua script naming a module's API (UIDocument, anime, getRigidbody, Joint3DType...), in code or in a string; a member's name counts after . or : or in a string, not as a local or a table key (local volume, {duration = 2}); comments do not count. In a project with the HTML UI, a member named like the video API (self.duration, "volume") keeps video;
  • a script property of one of their types;
  • a <video> element in a document, or a script naming video, with the HTML UI;
  • the runtime shader compiler: a script that can change what an object draws with (makes a mesh, a material or a light, changes a camera's target, the post-processing...), beyond what the build already cooks (moving, spawning prefabs, playing sounds and animations, physics, the light capacity, shadow and lit quality are all cooked);
  • a dynamic access that can reach anything (_G, _ENV, load, debug, package, a require of a computed name), or C++ scripts: every module. Such a name as a table key or in its declaration ({ load = true }, local debug = ...) is no access; its later uses are.

A prebuilt build then uses the smallest player variant with those modules: full, ui (no video), core (no HTML UI), lite3d (3D physics and navigation only) or lite2d (2D physics and navigation only); a release runtime's id ends with the variant (linux-x64-glcore-release-lite3d). When a variant of fewer modules than the one it uses would fit but is not installed, the build warns W-PLAYER-VARIANT with the id to download. A Compile build leaves the same modules out of what it compiles (a source export and a project with C++ scripts keep every module their settings allow). The player checks the modules its content needs when it starts (exit 5 when one is missing), and so does the build before it ships.

The Console, the CLI (modules:, left_out:, module: lines) and build_project (modules, module_reasons) say what was kept and why. A script that builds an engine name at runtime from pieces (obj["get" .. "Rigidbody"]) is the one use the build cannot see: turn Project Settings > Player > Strip Engine Code off for such a project (every module its settings allow ships).

The Build Report

Every export writes build-report.json next to what it builds and keeps a copy in the project's history, .jasperengine/build-reports/<platform>/<id>.json (the newest 10 per platform; the id is the UTC time and the method, 20261119-142233-prebuilt). Its sizes are the files on disk before packing (not the APK's or a web server's compression). It holds:

  • totals by category (models, textures, audio, scripts, scenes, engine, other) and every file with its category, size and, for a cooked or replaced file, its source asset and that asset's size;
  • Left Out: each source the build did not ship as itself, with its size and why (the texture or model cook replaced it, only sprites read it and it ships in an atlas's pages, a bitmap font's .jfont holds it, an .aseprite ships as its import, a Title Art document no title reads, a language the build leaves out, a Procedural Material that ships as what it baked, a Build Profile's exclusion);
  • Referenced By: for each asset the first reference that reached it from project.yaml (the scene list, standalone prefabs) or from a shipped script, walked through the dependency index at export time, so an old report still explains its own build. Unreferenced files are those no scene, prefab, material, project setting or script reaches. That is a lead, not a verdict: a script that loads a file by a path it builds at run time (loadSound("sfx/" .. name)) is invisible to the index (it sees require only), so nothing is left out automatically; a Build Profile's Exclude Paths is the place to drop what you are sure no script loads. When the index is still building, the report has no Referenced By data (W-BUILD-REPORT-INDEX): export again.
  • Budgets: each size budget the build met.

Window > Analysis > Build Report opens the last export's report (after a restart, the newest of the history). Report picks another from the history (same platform first); Compare With... picks the report to compare with (another platform is allowed: texture families differ by design), or Browse... for any build-report.json; Clear Comparison ends it. Comparing adds Before, After and Delta to the categories (green smaller, orange larger). The tabs are Files (search, category filter, sortable columns, Delta when comparing), Changes (Added, Removed, Grown, Shrunk; a cooked file is matched by its source asset, so a model whose cooked name changed is one Grown row), Unreferenced, Left Out and Budgets. Selecting a file shows its Referenced By chain; click a step to select that asset. A report from an older editor lists its 25 largest files only: its comparison is partial, and its Referenced By answers from the project as it is now.

The export's completion page shows the total and the change since the platform's previous report ("Build Report: 142.0 MB (+3.2 MB since 2026-11-18 10:15)") and each budget over its limit.

A report of 20,000 files is about 4 MB and sits beside the output: delete build-report.json before uploading a web folder, or export to a folder you upload from.

Size budgets

Project Settings > Player > Publishing Settings > Size Budgets holds rows of Platform (All, Desktop, or one), Category (Total or one) and Limit (MB, 1,048,576 bytes as the report shows it); When Over Budget is Warn (the default) or Fail Build. A row for the build's platform replaces a Desktop row, which replaces an All row, of the same category. Content categories are checked right after the content is measured, before any compile or packing; Engine and Total once the engine is measured. Over a limit the build warns W-SIZE-BUDGET naming the category's three largest files; with Fail Build it writes the report and its history entry, then fails (the output folder is kept). A content failure stops before the engine is measured, which the message says. Source exports are never checked. A Build Profile may override the rows (player.size_budgets) for its builds.

jasperengine-editor call get_build_report --compare-to previous
jasperengine-editor build --project MyGame --platform web --json   # build_report_id, size_budgets

What ships: Asset Stripping

Project Settings > Player > Build > Asset Stripping decides which assets a build carries (docs/specs/S98-editor-tooling-gaps.md REQ-8 to REQ-12):

  • Ship All Assets: every asset of the assets folder, as builds always did. A project whose project.yaml has no export.assetStripping key uses it, so an older project ships what it shipped before.
  • Referenced Only (new projects): what the build's scenes reference, followed through the prefabs, materials, shaders, models, UI documents and stylesheets, animation, particle and sound assets they use; what project settings name (the window icon, the audio mixer); every file a string literal in a Lua or C++ source, or a JSON data file, names by path (Texture("ui/logo.png") keeps ui/logo.png); and Always Include. An FBX ships its import only when something reaches it, and Play and the export import only those.

Lua scripts, shader sources, scenes and data files always ship whole. Always Include and Exclude From Build are lists of project-relative globs (* within a folder, ** across folders; a plain folder path names everything below it). Exclude From Build applies under both modes and wins over Always Include. The Project window's context menu adds or removes the selection with Exclude From Build and Always Include in Build (each one undo step).

A path a script builds at runtime ("level" .. n .. ".png") is the one reference the build cannot see: put those files in Always Include. The Build Report (Window > Analysis > Build Report, build-report.json next to the build) lists every asset left out with its size and its reason (unreferenced, or excluded: <glob>), and build_project gives stripped_count and stripped_bytes. A Development Build also lists them in content-manifest.json: when the game loads one, its log says "<path> was stripped from the build (Asset Stripping: Referenced Only): add it to Always Include" (or names the Exclude From Build glob). A release build carries no list.

A custom shader's .vert/.frag (and its .glsl includes with runtime shaders on) ships once, at the project-relative path a fork's customShader names.

The shaders a build ships

Build Settings lists the shader variants a build compiles: what each scene needs, what every build ships, the warm-up list and your additions, without what you excluded. Closed scenes count: each is read from its file as it is now (no GPU work) and remembered by the file's hash, so an unchanged project reads none of them. The list shows "Reading N closed scene(s)..." while that takes a moment, and names a scene whose file cannot be read: the list then holds what it last knew of it. Play's startup and every export use the same list.

Model limits

A model loads the same on a game's loading thread as on the main thread. Two limits of a model are real: a primitive's blend shapes (8; 4 when they have normals or tangents; 2 with both; the ones over it are left out) and a file's vertex and index buffers (the GPU buffer pool, 16384; what does not fit does not draw). The Console names the model, the count and the limit when the model is imported, and again when a game loads it.

Platforms

Project Settings > Player > Target Platforms records where the game ships; Build Settings and build_project default to those platforms and dim or note the others, which still build (Target Platforms).

  • Android needs the Android SDK's build-tools (35 or newer: aapt2, zipalign, apksigner), the target platform's android.jar and a JDK (keytool, jarsigner); an App Bundle also needs bundletool 1.17.2, which the first bundle build downloads from Google's GitHub releases into the user's cache (jasperengine/tools/). Its SHA-256 is pinned: a file that differs is not kept. A broken download is retried and resumed; offline, the build fails with the URL and where to put the file by hand. No NDK, CMake or Gradle. The SDK and JDK the editor installs (Toolchains) are used first; else set them in Preferences > External Tools when they are not in ANDROID_HOME / JAVA_HOME.

    Signing: without a keystore the debug key (~/.android/debug.keystore, made when missing) signs the build, fine for testing and refused by stores (a release build warns W-ANDROID-DEBUG-KEY). A release keystore is Project Settings > Android > Keystore and Key Alias, RSA or EC, JKS or PKCS12; its passwords are asked when building (or JASPER_ANDROID_KS_PASS and JASPER_ANDROID_KEY_PASS), go to the tools through owner-only files, and are never saved or logged. The key is checked before any packaging: a wrong store password, a wrong key password and an unknown alias each fail at once and say which.

    What Google Play refuses is a warning, from a release build and from a source export: a Target SDK below the level Play requires for new apps and updates (36 since 31 August 2026, W-ANDROID-TARGET-SDK), and armeabi-v7a without arm64-v8a under Architectures (W-ANDROID-64-BIT). The build goes on, for stores and sites outside Play.

    A source export is an Android Studio project (workspaces/androidstudio, ./gradlew assembleDebug, ./gradlew bundleRelease):

    • Its debug build type compiles the native code optimised with symbols (RelWithDebInfo) as a Development Build, so a debug APK plays at full speed. Project Settings > Android > Debug Package Suffix (android.debugPackageSuffix, for example .debug) is its applicationIdSuffix: the debug package installs beside the release one. A prebuilt build signed with the debug key takes the suffix too.
    • With a Keystore and Key Alias set, the release build type is signed with them; Gradle reads the passwords from JASPER_ANDROID_KS_PASS and JASPER_ANDROID_KEY_PASS, and the export writes no password. Without a keystore the release build is unsigned (the export says so) and Android Studio's Generate Signed Bundle / APK signs it; debug builds use the debug key.
    • The template pins the NDK (ndkVersion) and CMake (externalNativeBuild.cmake.version); docker/android.Dockerfile installs both, which tools/ci/check_android_image.sh checks.

    Both routes ship every asset folder, those starting with _ too: the asset filter is Android's default without <dir>_*, so only hidden and version control files (.gitkeep, Thumbs.db, CVS, *~) stay out; a prebuilt build warns W-ANDROID-ASSET-IGNORED naming them. After packaging, every content file is looked up in the APK or bundle, and a missing one fails the build with its name.

    An App Bundle carries the game's content in the install-time asset pack game_content (Play Asset Delivery): it installs with the app and the game reads it at the same paths, while the base module stays under Google Play's 200 MB. A prebuilt bundle always does. In a source export, Gradle puts asset packs in bundles only, so the pack holds the content when a Gradle run builds bundles and no APK (./gradlew bundleRelease, Android Studio's APK from app bundle); a run that builds an APK too keeps it in the base module and says so. APKs are one module.

    The Launcher Icon becomes mipmap-mdpi to mipmap-xxxhdpi icons (48 to 192 px) and a round ic_launcher_round (android:roundIcon); an Adaptive Foreground and Background become their 108 dp layers at every density with the mipmap-anydpi-v26 icon, and the legacy and round icons are composed from them when no Launcher Icon is set. The template's default icons then do not ship.

    Project Settings > Android > Package Format picks what Build makes:

    • App Bundle (aab, the default) is what Google Play takes. Play gives each device only its own ABI's libraries.
    • One APK per ABI (apk-per-abi) makes <Game>-arm64-v8a.apk and so on, for stores and sites outside Play. Give each device the APK of its ABI.
    • Universal APK (apk) is one installable file with every selected ABI's libraries. Every device downloads all of them, so choose it only on purpose.

    Build Settings shows each choice's download size, from the installed runtime's libraries. Unselect the ABIs a game does not need under Architectures (arm64-v8a covers nearly every device sold since 2017).

    Both routes declare the app a game (android:appCategory="game"): an app targeting API 36 or later that is not a game loses its orientation lock and fixed size on large screens (600 dp and wider: tablets, foldables), while a game keeps the orientation Player settings give it.

  • iOS needs a Mac with a full Xcode (the Command Line Tools have no xcodebuild). The build uses DEVELOPER_DIR when set, else the active developer directory, else the Xcode in /Applications (the Mac's xcode-select setting is not changed). On other computers, or without Xcode, the build is the Xcode project ("Open on a Mac with Xcode"). Project Settings > iOS holds the team id and the export method (development, ad-hoc, app-store).

    • --ios-simulator (ios_simulator in build_project): an unsigned .app for the simulator, no account needed. Build And Run on a simulator installs and launches it (Running on a device).
    • For a device, no Team ID: the project is compiled and linked for a device and stops before signing, with the warning W-IOS-NO-TEAM; the .app installs on nothing, and the Xcode project is there to open.
    • For a device, with a Team ID: xcodebuild archive and -exportArchive make the .ipa. This needs the team's account in Xcode > Settings > Accounts; without it the build fails and says so. What tools/ci/ios_packaging.sh runs is on the simulator, the device build up to signing and an unsigned archive; a signed .ipa has not been made in any test, as that needs an Apple developer account.
  • macOS: the bundle is signed ad hoc by codesign on a Mac, or by rcodesign anywhere (Preferences > External Tools); an unsigned arm64 build does not start on Apple silicon. With JASPER_MACOS_SIGN_IDENTITY set to a Developer ID Application identity, codesign signs with the hardened runtime and a secure timestamp, which is what notarization checks; then notarize and staple by hand (xcrun notarytool submit --wait, xcrun stapler staple).

  • Web: the page runs the pthreads player when the page is cross-origin isolated (COOP/COEP headers, _headers for hosts that read it). On a host that sends no such headers it installs coi-serviceworker.js once, reloads, and runs the pthreads player; when the browser does not let the worker isolate the page, it runs the single-thread player. Project Settings > Player > Threading > Web: Multithreaded decides whether the pthreads player ships at all. Serve the folder over HTTP (python3 tools/web/serve.py --root <folder>): file:// does not load WebAssembly. The page is always index.html (what web hosts such as itch.io open; a compiled build used to name it <app>.html, and a re-export removes that one). Its icon is Web > Favicon, else the Player icon (a PNG), else the JasperEngine logo. A source export built with jasperengine.py --platform web writes index.html next to <app>.export.html and names it at the end.

  • Windows: the editor and jasperengine-editor (CLI exports included) need Windows 10 version 1903 or later, which runs them in the UTF-8 code page so file names in any language work; on older Windows (Server 2019 too) they stop with a message. Windows games run on older Windows as well. See editor/text-and-languages.md.

Native plugins in prebuilt builds

A prebuilt build never drops plugins/native or a native setting silently. For the platform it builds, each one is either carried into the build (Build Settings > Native Plugins lists them, get_build_info and build_project say carried) or makes the build compile from source, with a reason that names the files:

Platform Carried by a prebuilt build Compiles from source
Linux, Windows (nothing native applies) C++ plugins (plugins/native/cpp)
macOS macos.plist_entries, the privacy manifest C++ plugins, Objective-C/Swift plugins and SDKs of apple/ and macos/, macos.frameworks
iOS Objective-C/Swift plugins and SDKs of apple/ and ios/, ios.swift_packages, ios.frameworks, ios.plist_entries, ios.plist_xml, ios.entitlements_xml, ios.deployment_target, the privacy manifest C++ plugins, ios.cocoapods (they need pod install), an iOS player runtime too old to take plugins
Android android.extra_permissions, android.manifest_xml, android.manifest_application_xml C++ plugins, Java/Kotlin, libs/ AARs and JARs, res/, the plugin AndroidManifest.xml, proguard-rules.pro, android.gradle_*, manifest XML with tools: merge rules
Web plugins/native/web/*.js, web.script_urls C++ plugins

The prebuilt iOS build is an Xcode project, so the game's Objective-C and Swift plugins are added to it as the source export adds them. Android and macOS players are finished packages: their native code needs Gradle or a compiler, so an Android or iOS build that must compile says to export the source project (File > Build Settings > Export source, then Android Studio or Xcode; Xcode on a Mac for macOS plugins).

A Lua mock (native_mocks/<Plugin>.lua) answers where a plugin has no code. When a build would ship one in place of real code (an Android-only ads plugin in a Windows build), the build warns W-NATIVE-MOCK, and the game logs once, the first time the mock answers. A macOS build without Xcode compiles no Swift: W-NATIVE-SWIFT-CMAKE says so. It links the SDKs of apple/ and macos/ as the Xcode project does (frameworks, the macOS library of an .xcframework, .a files) and puts the dynamic frameworks in Frameworks/ beside the executable and the resource .bundles beside it (Contents/Frameworks and Contents/Resources of a .app built with jasperengine.py --platform macos-xcode).

The editor's .meta files in plugins/native are neither listed, carried nor copied into a build.

Privacy manifest (iOS and macOS)

Every iOS and macOS build ships a privacy manifest, PrivacyInfo.xcprivacy (the app's root on iOS, Contents/Resources on macOS). App Store Connect refuses an app that calls a required-reason API without declaring it. The manifest is made at each build from three parts:

  1. The engine's entries, always there: UserDefaults CA92.1 (UserSettings: only the game reads what it saves), file timestamps C617.1 (the game's own files), system boot time 35F9.1 (frame and physics timers). The engine tracks nobody and collects no data. tools/check_apple_privacy.py (run by tools/check-changed) fails when engine code starts to use a category the manifest does not declare.
  2. The project's additions, in Project Settings > Player > iOS (or macOS) > Privacy Manifest, shared by both platforms: Tracking, Tracking Domains, Collected Data (type, linked, tracking, purposes) and Required Reason APIs your own native code adds. OK makes them one undoable step. Agents: set_project_settings apple.privacy_tracking, apple.privacy_tracking_domains, apple.privacy_collected_data, apple.privacy_accessed_apis.
  3. The plugins' manifests: every PrivacyInfo.xcprivacy in plugins/native/apple and plugins/native/ios (or macos), the one inside a static .framework or .xcframework, and the one inside an SDK's resource .bundle (the bundle is copied into the app). A dynamic framework is embedded with its own manifest and is left alone.

Lists are joined: tracking is on when any part tracks, and domains, data types, purposes and reasons are merged. Preview shows the result; native_plugins {action: "privacy_manifest"} gives it to agents with where each entry came from. The build warns W-PRIVACY-DOMAINS when tracking is on without a domain, and W-PRIVACY-ATT when iOS tracks without NSUserTrackingUsageDescription in Project Settings > Native Plugins > iOS > Info.plist Entries or Info.plist XML. Apple names iOS, iPadOS, tvOS, visionOS and watchOS for the required-reason rule; macOS builds ship the manifest too.

Ads and in-app purchases go through the native bridge: docs/mcp/guide/native-bridge.md, section 10, has a complete ads example.

Running a player from scripts and CI

Every player takes the same options (the web from its URL query, ?quit-after=30&fixed-fps=60):

Option Effect
--headless no window (Linux still needs an X server: Xvfb in CI)
--quit-after N quit after N drawn frames (a minimized or hidden window updates without drawing: use --headless in automation)
--after-ready count the frames from "Engine ready:" (every scene loaded, no shader being made, no texture loading)
--fixed-fps F a fixed time step of 1/F seconds
--screenshot file.png / --screenshot-frame N write that frame (the last one by default); a frame drawn with shaders still being made or textures still loading waits for them (the game held), up to 120 s, then exits 4 naming them
--fail-on-error exit 3 when an error is logged
--command "<line>" run a console command after "Engine ready:" (repeatable, one a frame; ?command=... on the web); each result is logged ([command] give gold 10: ok) and one that is not ok logs an error; development players, or Project Settings > Debug > Console Commands: Always, else exit 2; --quit-after counts from the last command
--ready-timeout S exit 6 when not ready after S seconds
--resolution WxH, --scene <name|id>, --content <dir>, --verify-content, --silent-audio, --log-level
--audio-capture <dir> A desktop development player writes one audio capture session into <dir>/<id>/, on the deterministic driver; any other player exits 2.
-- <args> the game's own arguments (Lua System.args)

Exit codes: 0 done, 2 bad arguments, 3 an error was logged, 4 the screenshot failed, 5 the content is not for this player, 6 not ready in time, 7 no display.

xvfb-run ./MyGame --headless --after-ready --quit-after 30 --fixed-fps 60 --screenshot game.png --fail-on-error

Running on a device

Build Settings' Run Device row (Android, iOS, Web) picks where Build And Run runs the game; for this computer's platform it says "This computer". The list is found off the editor's thread when Android or iOS shows, on Refresh, and every 3 seconds while it stays shown: nothing is probed while Build Settings is closed. An entry that cannot run (an unauthorized or offline device, an Android older than Minimum API Level) is greyed with what to do as its tooltip. The choice is yours, not the project's: it is kept in .jasperengine/user/devices.yaml, with no undo, as the selected platform is.

  • Android devices and running emulators come from adb devices -l. adb is Preferences > External Tools > adb, else <Android SDK>/platform-tools/adb, else PATH (the SDK Manager package platform-tools). Build And Run makes one APK of the device's first ABI the project builds, whatever Package Format says, installs it with adb install -r -t (permissions are asked as on a player's phone) and starts it. An APK signed with another key is not uninstalled for you (it would delete the player's saves): uninstall it (adb uninstall <package>) or sign with the same keystore. Starting an emulator and adb pair are yours to do.
  • iOS Simulator (a Mac with Xcode): a shut-down simulator is booted and shown, the simulator .app is built, installed and launched with the game's options as its arguments. Physical iPhones: build the .ipa and install it with Xcode.
  • Web: the editor serves the build's folder on 127.0.0.1 (the first free port from 8600 to 8699, never to other machines), with the cross-origin-isolation headers, and opens the default browser on index.html?editor-port=<port>. A headless editor opens nothing and gives the URL.
  • This computer: the player starts with its output through a pipe into the Console.

While a game runs, its log streams into the Console in the category device, each line after the device's name ([Pixel 7] ...): logcat of its process on Android, log stream and the app's output on the Simulator, the page's console on the web (a development page posts it back; a release page has no such code). The Console's strip shows each run's state (Installing, Pushing 3 files (2.1 MB), Running, Exited, Crashed), Stop and Screenshot (saved in Recordings/Device/, which is not an asset folder). A run is Crashed when Android logs FATAL EXCEPTION or Fatal signal, the web page reports the crash overlay's report, or this computer's player ends by a signal; clicking its "crashed" line selects the first fatal line.

Patch And Run (a Development Build, Android or the iOS Simulator) skips packaging: it cooks the content into the build cache, pushes only the files that changed since what the device runs (.jasperengine/user/devices.yaml keeps what each device runs) into the app's development content folder (files/je-dev-content on Android, written through adb shell run-as; Library/je-dev-content of the Simulator app's data container), writes content-manifest.json last and restarts the app. The installed package and its signature are untouched, so no keystore password is asked. A development player starts from that folder when its manifest names this very player (runtime id and binary), otherwise it warns once and runs its packaged content; --content wins over it, and a release player never looks. The first patch after an install pushes the whole content (the folder starts empty); a full install empties it again. A Development Build's APK is debuggable (android:debuggable) for run-as; a release target that is debuggable fails the payload check and publish prepare. Patch And Run is not offered, and Build And Run installs in full, when the player binary changed, no install of this project is recorded on the device, or the Android runtime predates Patch And Run. A game's debug overlay can show the patch: System.getBuildInfo().contentPatch (0 for packaged content) and contentPatched.

From the command line, jasperengine-editor build ... --run-device <id|auto|web> builds and runs (Patch And Run for a Development Build when it can; --no-patch installs in full) and prints device:, installed: and url:; --run-seconds S follows the log for S seconds (a web build is served until interrupted). Agents use get_build_info devices:true, build_project run_device and run_build device (docs/mcp/guide/shipping.md).

Build Profiles

A Build Profile is a named variant of the game for one platform (docs/specs/build-profiles.md), after Unity 6's: a demo, a store edition, a branded copy, a test build with cheats. Each is a file in EditorSettings/BuildProfiles/<Name>.buildprofile (committed, never shipped, YAML with formatVersion: 1). It stores only what the variant changes:

  • Identity: Product Name, Identifier, Version Suffix and Icon, written to the keys each platform's build reads (Android android.application_name, android.package_name, android.launcher_icon; iOS and macOS their application_name, bundle_identifier, icon; Windows windows.product_name; Linux linux.application_name; Web web.application_name and web.favicon; the others player.identifier and player.window_icon). Product Name also titles the window when the project has no Window Title. Version Suffix goes on the text version (android.version_name, game.json's version), never on Apple or Windows numeric versions (W-PROFILE-SUFFIX-NUMERIC).
  • Store and Store Title, checked against the stores' limits (Google Play and App Store titles 30 characters, labels warn above 12; editor/publish/StoreLimits.cpp holds the table): warnings at build, errors at publish prepare.
  • Graphics API, Development Build and Output Folder, which replace Build Settings' for its builds.
  • A Scene List (absent: the project's Scenes In Build) and its start scene. The scenes they involve ship too; a load of a scene the build left out logs "Scene 'Bonus' is not in this build (Build Profile 'Demo')", and in Play with the profile active it loads with a warning.
  • Scripting Define Symbols, which the game reads with System.isDefined("DEMO"), System.getDefines() and System.getBuildInfo(). They are values, not a preprocessor: code behind them still ships. Code that must not ship goes under an Exclude Path.
  • Exclude Labels (asset labels) and Exclude Paths (project-relative folders ending in /, or files): what they name is not copied, cooked or packed, Lua included. A shipped scene, prefab, material, UI Document or Sound Event that uses an excluded asset fails the build naming both; a literal require of an excluded module warns W-PROFILE-LUA-REQUIRE.
  • Player Settings overrides: any Project Settings key of the Player, Graphics and Quality pages and of the profile's platform, each checked by the setting's own validator.

A build resolves the profile once into a copy of the project's settings; the project and project.yaml never change. A build without a profile writes what it wrote before. game.json gains buildProfile and defines, content-manifest.json and build-report.json gain buildProfile (content format 1.6, for a profile's build only: an older runtime would ignore the defines, so the editor does not use one).

Build Settings lists the profiles under the platforms: Add Build Profile, and on a row Duplicate, Rename, Delete and Switch Profile. Every edit is one undo step. The active profile (per user, in .jasperengine/user/build.yaml) is what Build Settings opens on and what Play uses: its Product Name, Identifier, Version Suffix, defines and Scene List (the Game view shows "Profile: Demo"; Project Settings marks the rows it overrides in builds). Build and Build And Run build the selected profile; selecting a platform builds without one.

jasperengine-editor build --project MyGame --profile Demo [--out D]
jasperengine-editor call edit_build_profile --action list

A publishing.json target may name "profile": "Demo": publish prepare refuses a build of another profile, another platform, backend or flavour, or a store limit the profile breaks. A Build Profile is not S56's Device Profile (deviceProfile).

Releases

publishing.json at the project root (committed; Build Settings > Publish edits it) names the builds of a release:

{
  "schemaVersion": 1,
  "releasesDir": "releases",
  "targets": {
    "linux": {"platform": "linux", "arch": "x64", "backend": "vulkan", "flavour": "release",
              "buildDir": "../MyGame-linux", "executable": "MyGame", "depotId": "1001",
              "deviceProfile": "steamdeck", "requiredFiles": []},
    "windows": {"platform": "windows", "arch": "x64", "backend": "d3d11", "flavour": "release",
                "buildDir": "../MyGame-windows", "executable": "MyGame.exe", "depotId": "1002"}
  },
  "steam": {"appId": "480", "buildDescription": ""},
  "deck": {"host": "steamdeck.local", "user": "deck", "remoteDir": "Games/MyGame"}
}
jasperengine-editor publish init                      # a starting publishing.json
jasperengine-editor publish prepare --release 1.0.0   # validate, copy, split symbols, release.json
jasperengine-editor publish verify 1.0.0              # nothing changed since prepare
jasperengine-editor publish steam-vdf 1.0.0 --preview
jasperengine-editor publish steam-upload 1.0.0 --user <build account> [--branch beta]
jasperengine-editor publish deck-deploy 1.0.0 --target linux
jasperengine-editor publish deck-smoke
jasperengine-editor publish deck-rollback
  • prepare checks every build (each binary's format and architecture, exec bits, paths that differ only in case, symlinks that escape, Windows-reserved names and long paths, steam_appid.txt, the content the manifest lists, the notices, Android library alignment and apksigner verify, unsigned macOS arm64 code), copies it into <releasesDir>/<release>/content/<target>, moves debug symbols to symbols/<target> (.pdb, .dSYM, and on Linux the DWARF split off with objcopy/strip when binutils is installed), checks again and writes release.json. A release name is used once.

    Release builds of either method already ship stripped. A prebuilt player's symbols come from its runtime (symbols/<target>/player). A compiled build's link splits its own off; the build keeps them under .jasperengine/symbols/ and prepare copies them to symbols/<target>/game.

  • verify repeats the checks and compares every file with release.json.

  • steam-upload verifies, writes the SteamPipe scripts and runs steamcmd +login <user> +run_app_build <script> +quit. SteamCMD keeps its own login session (log in once interactively, Steam Guard included); the editor never sees credentials. SetLive is for beta branches: promote public builds in Steamworks.

  • deck-deploy copies the linux x64 target to the Deck (any ssh host: enable SSH in the Deck's desktop mode and add your key) into <remoteDir>/<release>-<target>.incoming, checks its checksums there, then makes it current/ and keeps the build before as previous/. deck-smoke runs current/<executable> --quit-after 600 --fail-on-error there and returns its exit code and log tail. Verify prints the newest GLIBC_x.y the build needs (glibc_floor), which the Deck's runtime must provide.

Notices

Every build has licenses/<library>-LICENSE for each library its player links and THIRD-PARTY-NOTICES.txt with their NOTICE.md entries. engine/notices.json says which games link each library (always, or with a player feature such as physics3d); tools/ci/check-notices.py keeps it complete.

What is tested where

The Linux and web prebuilt paths are built and run by tools/build.sh players, the player CLI test and the web gate; Android's prebuilt APK runs in the emulator check. tools/build.sh players does not build Windows, macOS or iOS runtimes, and nothing else in this repository does; Steam uploads and real Steam Deck deploys are tested with stand-ins only (a SteamCMD-shaped script, ssh to a local directory).