Skip to main content

A utility script for automatically building Ren'Py applications for multiple platforms.

Project description

renConstruct

CircleCI Downloads

A utility script to automatically build Ren'Py applications for multiple platforms.

renConstruct can build distributions for Windows, Linux, macOS and Android, including extra processing steps pre- and post-build. By default it supports notarization for macOS distributions, a memory limit increase for Windows distributions (using LARGEADDRESSAWARE) and cleanup of temporary build artifacts.

Custom pre- and post-build steps can easily be added.

Installation

renConstruct can be installed via pip:

$ pip install renconstruct

Please note that renConstruct requires Python 3 and will not provide backwards compatibility for Python 2 for the foreseeable future.

Usage

renConstruct operates based on the following process flow:

  • Ensure dependencies are installed
  • Validate configuration file
  • Install specific Ren'Py if necessary
  • Run the pre-build stage of all active tasks
  • Build the Android distribution if enabled
  • Build the macOS and Windows/Linux distributions if enabled
  • Run the post-build stage of all active tasks

In the default configuration, the following tasks are executed at the respective build stage:

  • pre-build:
    • None
  • post-build:
    • set_extended_memory_limit
    • clean

Configuration

renConstruct requires a configuration file to be supplied containing the information required to complete the build process for the various platforms. An empty template is provided in this repository under the name config.empty.yml

It consists of the following sections:

tasks

  • path: An optional path to a directory containing Python files with custom tasks
  • convert_images: A value of true or false determining whether to run this task or not
  • set_extended_memory_limit: A value of true or false determining whether to run this task or not
  • notarize: A value of true or false determining whether to run this task or not
  • clean: A value of true or false determining whether to run this task or not
Custom Tasks

Custom tasks can easily be added using the path value. It should point to a directory containing Python files. Each file can contain one or more task, which will be picked up by renConstruct.

A task is an object that looks like this:

class DoSomethingTask():

    PRIORITY = -100

    def __init__(self, config):
        self.config = config

    def pre_build(self):
        pass

    def post_build(self):
        pass

The name of the class must end with Task for it to be picked up by renConstruct. Every custom task will automatically receive a setting in the config file based on the class name split on uppercase letters, converted to lowercase and joined by underscores. The example task above would receive the config variable do_something.

A task can have two methods pre_build and post_build (either or both is possible). They will be called with the validated config object at the specified build stage. At that point they can do whatever they want. As an example, a custom task could be built to automatically optimize image assets in the game directory before every build.

Each task also has a PRIORITY class attribute which has a default value of 0 and determines the order in which to run the tasks. A higher priority means that task will be executed earlier than others with a lower value. Both positive and negative values are possible.

As an example, the built-in clean task runs at PRIORITY = -1000 to ensure it's always the last task to be run.

build

  • win: A value of true or false determining whether to build the Windows/Linux distribution or not
  • mac: A value of true or false determining whether to build the macOS distribution or not
  • android: A value of true or false determining whether to build the Android distribution or not

renutil

  • version: The version of Ren'Py to use while building the distributions

renotize

  • apple_id: The e-Mail address belonging to the Apple ID you want to use for signing applications.
  • password: An app-specific password generated through the management portal of your Apple ID.
  • identity: The identity associated with your Developer Certificate which can be found in Keychain Access under the category "My Certificates". It starts with Developer ID Application:, however it suffices to provide the 10-character code in the title of the certificate.
  • bundle: The internal name for your app. This is typically the reverse domain notation of your website plus your application name, i.e. com.example.mygame.
  • altool_extra: An optional string that will be passed on to all altool runs in all commands. Useful for selecting an organization when your Apple ID belongs to multiple, for example. Typically you will not have to touch this and you can leave it empty.

Example

renconstruct -c config.yml -i path/to/my-game/ -o out/

Command Line Interface

Usage: renconstruct.py [OPTIONS]

  A utility script to automatically build Ren'Py applications for multiple
  platforms.

Options:
  -i, --input TEXT   The path to the Ren'Py project to build  [required]
  -o, --output TEXT  The directory to output build artifacts to  [required]
  -c, --config TEXT  The configuration file for this run  [required]
  -d, --debug        If given, shows debug information if
  --help             Show this message and exit.

Disclaimer

renConstruct is a hobby project and not in any way affiliated with Ren'Py. This means that there is no way I can guarantee that it will work at all, or continue to work once it does.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

renconstruct-1.0.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

renconstruct-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file renconstruct-1.0.0.tar.gz.

File metadata

  • Download URL: renconstruct-1.0.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/4.15.0-1052-aws

File hashes

Hashes for renconstruct-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ba29a5663fbfaf3b5d8f5fca3b5e20a7160c7321e7ecf73e020c131125484db9
MD5 60a7ea900f38e330c2b78282c278b5ad
BLAKE2b-256 26cb4e0cd67592e51ae1df4c31390c0d50d2428cac977e354ba517d0bc662dbc

See more details on using hashes here.

File details

Details for the file renconstruct-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: renconstruct-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.7 Linux/4.15.0-1052-aws

File hashes

Hashes for renconstruct-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 681e5acbbec1fc43461dd719bd1b71139add8e968eda992cdb4ab17e306a7af5
MD5 e12691dd9bdd946c9d0f99309a73cc09
BLAKE2b-256 585d670cc2b18630edd6d3c62968ad7483097fea4324a9f8b3b6fdbc11aa97a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page