Config File

Every app and package has their own config.yml file which is used to configure the project. Most of the settings have default values and are optional.

Key

Values

Description

title*

string

The display name of the app.

version*

semver

The version of the app.

package-name*

string

Package name.

architecture

string

The targeted CPU architecture.

platform

string

The targeted platform.

definitions

[]string

Preprocessor defines.

build-type

[]string

The type of this build.

copyright

string

Copyright notice.

license

string

What license the packages is released under.

authors

[]string

List of package authors.

inherit

[]string

Inherit settings from other config.

packages

[]string

List of dependencies.

exclude-packages

[]string

List of packages to exclude.

repositories

[]string

Repositories from where packages can be found.

source-paths

[]string

Paths to where source code can be found.

include-paths

[]string

Paths to where header files can be found.

link-libraries

[]string

Libraries to link with.

library-paths

[]string

Paths to where libraries can be found.

screen-orientations

[]string

List of supported orientations.

pre-hook

string

Script called when a package or app has been prepared.

build-hook

string

Called for the app it has been built.

life-cycle

string

Name of the class that receives life-cycle events.

* is required.

Example

title: My Game
package-name: com.company.my-app
version: 1.0.0
packages:
- r8-core

Working With Configs

Every project will probably have multiple config files including different configurations depending on use-case. The config files are hierarchical meaning that you may have a base config that other can inherit from and override its settings. When creating a new project using r8 app --init you will automatically get a config.yml, config.linux.yml and a few others. If you open these two files you will see that config.linux.yml inherits the settings from config.yml and adds its own.

# config.yml
title: My Game
package-name: com.company.my-game
version: 0.1.0
life-cycle: App
packages:
- r8-core
# config.linux.yml
inherit:
- config.yml
packages:
- r8-glx
- r8-gles

In this example the config.linux.yml uses the exact same settings as in config.yml but also appends two values to the packages section.

To make changes to a config file you should use the r8 config command. This validates the entries entered into the file thus lowering the risk of adding invalid values. You may also validate the file manually by using r8 config --validate --filename ./config.yml.

$ r8 config --get title
My Game

$ r8 config --set title "Another Game"
$ r8 config --get title
Another Game

$ r8 config --add packages "i18n"
$ r8 config --get packages
['r8-core', 'i18n']

$ r8 config --remove packages "i18n"
$ r8 config --get packages
['r8-core']

Hooks

prepare-hook This hook is called for every package and the app when the package or app has been prepared. build-hook This hook is called for the app after a build. Remember to make the called file executable and with a proper shebang.

prepare-hook: post-prepare.py
build-hook: post-build.sh