List of Build Options

This page lists the full set of options that can be used with the build_apps and bdist_apps commands of a Python game. They go into the options of setup.py (or a section of setup.cfg), or, with acronmanager, into the [tool.acron.build_apps] table of pyproject.toml, with the same names and values:

[tool.acron.build_apps]
platforms = ["win_amd64", "macosx_11_0_arm64", "linux_x86_64"]
plugins = ["acrongl", "p3openal_audio"]
include_patterns = ["data/**"]
exclude_patterns = ["data/**/*.blend"]

build_apps

Applications and files

gui_apps

A dictionary of applications that can open a window with executable names as keys and the path to the main/entry-point script as the value. acronmanager adds the project’s main_file under the project’s name.

console_apps

A dictionary of applications that do not open a window with executable names as keys and the path to the main/entry-point script as the value

macos_main_app

The app whose executable is the macOS app bundle’s, when gui_apps names more than one (default: the only one).

include_patterns

A list of patterns of files to include in the built applications

exclude_patterns

A list of patterns of files to not include in the build application (takes precedence over include_patterns)

rename_paths

A dictionary with keys being a path to match and the value being the path to replace it with

include_modules

A dictionary with keys being an application (use '*' to denote all applications) and values being lists of Python modules to freeze into the application regardless of whether FreezeTool detects it as a dependency (useful for “hidden” imports that FreezeTool may not be able to follow)

exclude_modules

A dictionary with keys being an applications (use '*' to denote all applications) and values being lists of Python modules to not freeze into the application regardless of whether FreezeTool detects it as a dependency

file_handlers

A dictionary with keys matching extensions and values being functions of the form:

def func(build_cmd, srcpath, dstpath):

The function is run when encountering a file with the given extension. User-defined file handlers for an extension override the default handler. (A function cannot be written in pyproject.toml: use a setup.py for this one.)

bam_model_extensions

A list of model extensions that are automatically converted to .bam during build. By default, this includes .egg, .gltf and .glb. Change this if you wish to use other file formats than these, or if you don’t want these models to be converted to .bam during build.

bam_embed_textures

If true, the textures of a converted model are stored inside its .bam file rather than referred to by their paths (default false).

strip_docstrings

If true, which is the default, all docstrings will be removed as an optimization, and any use of __doc__ will return None. Set this to false if you need to keep these docstrings for some reason.

Platforms and dependencies

build_base

The directory to build the applications in (defaults to “build” in the current working directory)

platforms

A list of PEP 425 platform tags to build applications for (default: the platforms Acron publishes desktop wheels for, linux_x86_64, macosx_11_0_arm64 and win_amd64). See Building Python Games.

requirements_path

A path to a requirements.txt file to use with PIP when fetching wheels (defaults to ./requirements.txt; acronmanager writes one from [project] dependencies when the project has none)

use_optimized_wheels, optimized_wheel_index

Select separately optimized engine builds on an index of their own. Acron publishes no such builds, so use_optimized_wheels is off by default: the acron wheel a game is frozen with is the one it is developed with.

plugins

A list of dynamically loaded Acron plug-ins included with the built applications. A list is available on Building Python Games. acronmanager uses ["acrongl", "p3openal_audio"] when the project names none (["acrongles2", "p3openal_audio"] for Android; none for the web, whose runtime has them built in).

Configuration and logging

log_filename

If specifies, all of the output (such as print statements and error messages) is written to a file. The $USER_APPDATA/ prefix can be used to write refer to the AppData directory of the current user.

This string may contain additional formatting parameters containing the current date or time, such as $USER_APPDATA/My Game/logs/%Y-%m-%d.log (log_filename_strftime, true by default, turns this off).

log_append

The default is to erase the log file every time the application is re-run. If this is set to True, it will instead preserve the existing contents and instead append to the end of the log file.

extra_prc_data, extra_prc_files

Configuration for the built application: a string of PRC data, or a list of .prc files, added to the engine’s default configuration.

embed_prc_data

If true, which is the default, the configuration is compiled into the executable. If false, it is written to a .prc file in the directory named by default_prc_dir (default etc), where it can be changed after the build.

prefer_discrete_gpu

On systems with both an integrated and dedicated GPUs, tells the driver that the application prefers to use the dedicated GPU, which usually provides higher performance. At the moment, this option is only implemented on Windows, and only for NVIDIA and AMD graphics cards.

Icons

icons

A dictionary mapping gui_apps/console_apps keys to a list of images from which an icon file is generated. This list should contain versions the same image at different resolutions. Acron will automatically resize the image to provide for missing resolutions if necessary, so it is possible (but not recommended) to specify only one high-resolution image.

If “*” is used as key, sets the icons for all included apps. acronmanager sets this from [tool.acron.app] icon.

adaptive_icons

A dictionary mapping gui_apps keys (or “*”) to the layers of an Android adaptive icon (Android 8 and later): {"foreground": path, "background": path or "#rrggbb", "monochrome": path}, each a square of 108 dp (432 × 432 pixels or larger). The app needs icons too, the icon on older Android. See App Icons and Store Art.

The web

These options apply to the platform emscripten_wasm32 (see The Web).

web_main_app

The app the page runs, when gui_apps names more than one.

web_title

The page title (default: the app’s name).

web_shell

Your own page, instead of the engine’s (see Your own page).

web_persist_dirs

The directories the browser keeps between visits (default ['/home/web_user'], the home directory).

web_packs

Content packs: a dictionary of pack names and the file patterns they hold, which the page downloads while the game runs (see Starting before everything has arrived).

web_background_packs

The packs that are fetched as soon as the game runs.

Android

These options apply to the platform android (see Building for Android). acronmanager dist --android sets application_id from [tool.acron.app] id, and android_abis and android_min_sdk_version from [tool.acron.android].

application_id

This field is required by Android and uniquely identifies the application. It is usually based on the inverse of the developer’s domain name (e.g. “gamestudio.com” becomes “com.gamestudio”), followed by any other components as needed to further identify the application, such as com.gamestudio.asteroids.

Caution

Once the application has been uploaded to the Google Play Store, it is no longer possible to change the identifier.

android_version_code

This should be an integer that starts at 1 and is incremented with every app update. This is just internal, whereas the version metadata field is used to show an arbitrary dot-separated version string to the user. Every time you upload a new release to the Play Console, this number must be increased.

android_app_category

How the app is categorized, should be one of “accessibility”, “audio”, “game”, “image”, “maps”, “news”, “productivity”, “social”, or “video”.

android_debuggable

A boolean indicating whether the app can be debugged. It is recommended to set this to True during testing.

android_abis

A list of Android ABIs to target with the build (default ['arm64-v8a'], the one the Acron wheel for Android is built for).

android_min_sdk_version

The lowest version of Android that the game will still operate on (default 24, Android 7.0, which the Acron wheel needs).

android_max_sdk_version

Overrides the highest version of Android that the game will still operate on. There is normally no need to set this.

android_target_sdk_version

The version of Android targeted by the application (default 35). This affects various behaviors and optimizations applied by Android, but does not affect the minimum version of Android supported by the application. Google Play requires a recent one.

android_screen_orientation

Fixes the orientation of the screen: "landscape", "portrait", "sensorLandscape" or any other value of Android’s screenOrientation. By default the app turns with the device.

android_manifest_file

Path to an AndroidManifest.xml file that is included instead of the one generated by build_apps. This can be used to further customize the app beyond what these settings permit. The settings in the file will override those specified in the build options. However, it is easy to get something wrong and break the app. Very little checking is performed to determine whether the provided file is consistent with the supplied build options and will result in a working build. It is recommended to first use build_apps to generate a working AndroidManifest.xml and then modify it further to suit your needs.

bdist_apps

bdist_apps takes the options of build_apps as well as these:

installers

A dictionary of the archives or installers to make for each platform: see Packaging Binaries.

dist_dir

Where the archives go (default dist in the current working directory).

skip_build

Pack the existing builds in build_base without running build_apps first.

signing_certificate

Path to a .pem file that is used to sign the package. Currently, this is only used for the Android app bundle (see Signing).

signing_private_key

Path to a .pem file that contains the private key matching the certificate specified with signing_certificate.

signing_passphrase

If the private key is encrypted, sets the password necessary to decrypt it. If no password is provided, it will be prompted on the command-line.