# This is a configuration file for fbcgen.pl
# Usage: fbcgen.pl myproject.cfg

# Root directory where the master branch checkout is located.
# (path is relative to the location of the configuration file itself).
# The local checkout should be initialized *before* fbcgen.pl is run.
# You can run `serge --initialize myproject.serge.tmpl`
# to do an initial checkout of the project data.
$data_dir = './data/myproject/master';

# Where to load Serge config template from.
# (path is relative to the location of the configuration file itself).
$template_file = "myproject.serge.tmpl";

# Where to save the localized Serge config file.
# (path is relative to the location of the configuration file itself).
$output_file = "myproject.local.serge";

# Filter out commits that match this mask when determining if branch is inactive.
$skip_commit_mask = '^l10n@example.com';

# Use an external text file to explicitly include or exclude branches.
# If commented out, this feature will be disabled.
#$branch_list_file = './myproject_branches.txt';

# This sub returns a hash map of additional parameters
# that can be referenced in template as `$FBCGEN_<VARIABLE_NAME>`.
# For example, `EXTRA_INCLUDE` parameter generated in the function below
# is referenced in `myproject.serge.tmpl` file as `$FBCGEN_EXTRA_INCLUDE`.
$calculate_params = sub {
    my ($branch) = @_;
    return {
        # for branch names starting with `release/`, return an empty string;
        # otherwise, return a string that will be used in the `@include` directive
        EXTRA_INCLUDE => $branch =~ m!^release/! ? '' : "myproject.inc#skip-saving-localized-files\n"
    }
}
