Skip to content

Configurations

Philipp Schulz edited this page Sep 27, 2022 · 1 revision

Configurations

Shipectral can be customized using JSON configuration files. To use a specific configuration, set the environment variable SHIPECTRAL_CONFIG_FILE to the relative path to the config file.

For example, to use the raw configuration example, simply set SHIPECTRAL_CONFIG_FILÈ to configs/raw.json.

Configuration options

The following configuration options are available:

  • executable_name: The name of the final executable
  • build_path_name: The relative path to the build directory
  • anyolite_config_file: The relative path to the Anyolite configuration file
  • use_sfml: A flag whether to use SFML as the engine
  • use_sdl: A flag whether to use SDL as the engine
  • use_rl: A flag whether to use raylib as the engine
  • use_imgui: A flag whether to use imgui
  • use_collishi: A flag whether to use the Collishi library
  • frontend: The relative path to the frontend directory
  • frontend_crystal: The filename of the Crystal frontend file (can be false)
  • frontend_project: The filename of the frontend project file
  • compile_frontend: A flag whether to compile the frontend project into the executable
  • frontend_asset_directory: The relative path to the frontend asset files
  • copy_frontend_assets_to_build_directory: A flag whether to copy the frontend assets file to the final build directory
  • engine_library: The relative path to the engine library directory (can be false)
  • engine_library_crystal: The filename of the Crystal engine library file (can be false)
  • engine_library_project: The filename of the engine library project file
  • compile_engine_library: A flag whether to compile the engine library project into the executable
  • add_demos: A flag whether to add the demo projects to the final build directory
  • add_project_directory: A flag whether to add a projects directory to the final build directory
  • debug: A flag whether to compile in debug mode

General execution flow

Shipectral executes its parts in the following order:

Shipectral core -> Engine -> Engine library -> Frontend

The engine library and frontend are both split into a Crystal part and a project part (written in Ruby) and are executed in this specific order. The project options have to point to either a JSON file with project information or a Ruby script file.

An engine library is optional, but at least a frontend project has to be provided (otherwise there's no reason to actually start Shipectral).

Project file options

Since mruby doesn't allow for the require instruction, the project files allow for specifying in which order the script files should be loaded. It should provide the following options:

  • scripts: An array of paths and script filenames
  • required_features: An array of feature names

The elements of the scripts option can be paths (in which case all files in the path will be loaded recursively in an undefined order) or filenames. All elements are loaded in the same order as provided.

The given features (for example "sdl") are checked when the respective project file is loaded. If a feature is not defined in Shipectral at the time the project is loaded, the compilation process will fail.

Clone this wiki locally