<commit_before>#!/bin/bash

function die()
{
    echo " * " $@
    exit 1
}

function notify()
{
    echo " * " $@
}

function debug()
{
    echo $@ > /dev/stderr
}

function requires()
{
    for prog in $@; do
        local mute=$(which ${prog})
        if [[ ! "$?" = "0" ]]; then
            die "Could not find program: $prog"
        fi
    done
}

#######################################
# Build configuration
#######################################
TRAVIS_OS_NAME=${TRAVIS_OS_NAME:-linux}
TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-${PWD}}
TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG:-}
TRAVIS_COMMIT=${TRAVIS_COMMIT:-0000}


#######################################
# Optional build options
#######################################
GENERATE_PROGRAMS=${GENERATE_PROGRAMS:-ON}
CONFIGURATION=${CONFIGURATION:-Debug}
CMAKE_TARGET=${CMAKE_TARGET:-}


#######################################
# For build reports
#######################################
FIREBASE_ENDPOINT=${FIREBASE_ENDPOINT:-}


#######################################
# Dependencies
#######################################
# Dependency listing
DEPENDENCIES=${DEPENDENCIES:-}
# No dependency downloads
NODEPS=${NODEPS:-}
# For downloading dependencies
GITHUB_TOKEN=${GITHUB_TOKEN:-}


#######################################
# No deploy configuration
#######################################
NODEPLOY=${NODEPLOY:-}


#######################################
# Defined only for Travis CI builds, do not define locally!
#######################################
TRAVIS=${TRAVIS:-}


#######################################
# For potential issues with create directories
#######################################
#umask 000

#######################################
# General variables
#######################################
SOURCE_DIR="$PWD"
BUILD_DIR="$SOURCE_DIR/multi_build"


COFFEE_DIR="$BUILD_DIR/coffee_lib"

#######################################
# Export for scripts
#######################################
export BUILDVARIANT
export MANUAL_DEPLOY
export MANUAL_CONTEXT

QTHUB_DOCKER="hbirch/coffeecutie:qthub-client"
MAKEFILE="Makefile.linux"

INFOPY="$SOURCE_DIR/toolchain/buildinfo.py"

function buildinfo_() {
    case "$TRAVIS_OS_NAME" in
    "darwin")
        python3.7 "$INFOPY" $@
    ;;
    *)
        "$INFOPY" $@
    ;;
    esac
}

#######################################
# Retrieve script location relative to source dir
#######################################
SCRIPT_DIR="${SOURCE_DIR}/$(buildinfo_ --source-dir ${SOURCE_DIR} script_location)"
MAKEFILE_DIR="${SOURCE_DIR}/$(buildinfo_ --source-dir ${SOURCE_DIR} makefile_location)"

CI_DIR="$MAKEFILE_DIR"

HELPER="$SCRIPT_DIR/get_matching_release.py"
GITHUBPY="$SCRIPT_DIR/github_api.py"

function matching_release_() {
    case "$TRAVIS_OS_NAME" in
    "darwin")
        python3.7 "$HELPER" $@
    ;;
    *)
        "$HELPER" $@
    ;;
    esac
}

function github_py_() {
    case "$TRAVIS_OS_NAME" in
    "darwin")
        python3.7 "$GITHUBPY" $@
    ;;
    *)<commit_msg> - [toolchain] Try to fix macOS again<commit_after>#!/bin/bash

function die()
{
    echo " * " $@
    exit 1
}

function notify()
{
    echo " * " $@
}

function debug()
{
    echo $@ > /dev/stderr
}

function requires()
{
    for prog in $@; do
        local mute=$(which ${prog})
        if [[ ! "$?" = "0" ]]; then
            die "Could not find program: $prog"
        fi
    done
}

#######################################
# Build configuration
#######################################
TRAVIS_OS_NAME=${TRAVIS_OS_NAME:-linux}
TRAVIS_BUILD_DIR=${TRAVIS_BUILD_DIR:-${PWD}}
TRAVIS_REPO_SLUG=${TRAVIS_REPO_SLUG:-}
TRAVIS_COMMIT=${TRAVIS_COMMIT:-0000}


#######################################
# Optional build options
#######################################
GENERATE_PROGRAMS=${GENERATE_PROGRAMS:-ON}
CONFIGURATION=${CONFIGURATION:-Debug}
CMAKE_TARGET=${CMAKE_TARGET:-}


#######################################
# For build reports
#######################################
FIREBASE_ENDPOINT=${FIREBASE_ENDPOINT:-}


#######################################
# Dependencies
#######################################
# Dependency listing
DEPENDENCIES=${DEPENDENCIES:-}
# No dependency downloads
NODEPS=${NODEPS:-}
# For downloading dependencies
GITHUB_TOKEN=${GITHUB_TOKEN:-}


#######################################
# No deploy configuration
#######################################
NODEPLOY=${NODEPLOY:-}


#######################################
# Defined only for Travis CI builds, do not define locally!
#######################################
TRAVIS=${TRAVIS:-}


#######################################
# For potential issues with create directories
#######################################
#umask 000

#######################################
# General variables
#######################################
SOURCE_DIR="$PWD"
BUILD_DIR="$SOURCE_DIR/multi_build"


COFFEE_DIR="$BUILD_DIR/coffee_lib"

#######################################
# Export for scripts
#######################################
export BUILDVARIANT
export MANUAL_DEPLOY
export MANUAL_CONTEXT

QTHUB_DOCKER="hbirch/coffeecutie:qthub-client"
MAKEFILE="Makefile.linux"

INFOPY="$SOURCE_DIR/toolchain/buildinfo.py"

function buildinfo_() {
    case "$TRAVIS_OS_NAME" in
    "osx")
        python3.7 "$INFOPY" $@
    ;;
    *)
        "$INFOPY" $@
    ;;
    esac
}

#######################################
# Retrieve script location relative to source dir
#######################################
SCRIPT_DIR="${SOURCE_DIR}/$(buildinfo_ --source-dir ${SOURCE_DIR} script_location)"
MAKEFILE_DIR="${SOURCE_DIR}/$(buildinfo_ --source-dir ${SOURCE_DIR} makefile_location)"

CI_DIR="$MAKEFILE_DIR"

HELPER="$SCRIPT_DIR/get_matching_release.py"
GITHUBPY="$SCRIPT_DIR/github_api.py"

function matching_release_() {
    case "$TRAVIS_OS_NAME" in
    "osx")
        python3.7 "$HELPER" $@
    ;;
    *)
        "$HELPER" $@
    ;;
    esac
}

function github_py_() {
    case "$TRAVIS_OS_NAME" in
    "osx")
        python3.7 "$GITHUBPY" $@
    ;;
    *)
{'fraction_non_alphanumeric': 0.36510581569738376, 'fraction_numerical': 0.004999166805532411, 'mean_word_length': 5.54525627044711, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1337523', 'n_tokens_mistral': 1933, 'n_tokens_neox': 1772, 'n_words': 300}