<commit_before>#!/bin/bash

SRC_ROOT_DIR=`pwd`            # full path to the src directory
BUILD_ROOT_DIR="`pwd`/build"  # path to the build directory. See `-b' option
BUILDTYPE="debug"             # determines which target(s) has to be built. See `-t' option
CLEAN=0                       # clean the target build directory before build it. See `-c' option
VERBOSE=0                     # make the build process verbose if 1. See `-v' option

build_target () {

    target_build=$1;
    target_dir=$2
    clean_dir=$3;
    verbose=$4

    pushd .

    cd $BUILD_ROOT_DIR

    if [ $clean_dir -eq 1 ] ; then
        rm -rf $target_dir
    fi

    if [ ! -d $target_dir ] ; then
        mkdir $target_dir
    fi

    cd $target_dir

    cmake -DCMAKE_BUILD_TYPE=$target_build $SRC_ROOT_DIR

    if [ $verbose -eq 1 ] ; then
        export VERBOSE=1
    fi

    make

    popd
}

while getopts "hvct:b:" opt ; do
    case "${opt}" in
        v)
            VERBOSE=1
            ;;
        c)
            CLEAN=1
            ;;
        t)
            BUILDTYPE=${OPTARG}
            ;;
        b)
            BUILD_ROOT_DIR=${OPTARG}
            ;;
        h)
            echo "Usage: build.sh [-h] [-v] [-c] [-t <target>]"
            echo
            echo "-h             Display usage info"
            echo "-v             Make the build process verbose"
            echo "-c             Clean build directory first"
            echo "-t <target>    Target to build (release|debug|all)"
            echo "-b <build-dir> Path to the build directory. \`build' is used as default"
            echo
            echo "When no target is specified, debug will be build."
            echo<commit_msg>Build release target by default<commit_after>#!/bin/bash

SRC_ROOT_DIR=`pwd`            # full path to the src directory
BUILD_ROOT_DIR="`pwd`/build"  # path to the build directory. See `-b' option
BUILDTYPE="release"           # determines which target(s) has to be built. See `-t' option
CLEAN=0                       # clean the target build directory before build it. See `-c' option
VERBOSE=0                     # make the build process verbose if 1. See `-v' option

build_target () {

    target_build=$1;
    target_dir=$2
    clean_dir=$3;
    verbose=$4

    pushd .

    cd $BUILD_ROOT_DIR

    if [ $clean_dir -eq 1 ] ; then
        rm -rf $target_dir
    fi

    if [ ! -d $target_dir ] ; then
        mkdir $target_dir
    fi

    cd $target_dir

    cmake -DCMAKE_BUILD_TYPE=$target_build $SRC_ROOT_DIR

    if [ $verbose -eq 1 ] ; then
        export VERBOSE=1
    fi

    make

    popd
}

while getopts "hvct:b:" opt ; do
    case "${opt}" in
        v)
            VERBOSE=1
            ;;
        c)
            CLEAN=1
            ;;
        t)
            BUILDTYPE=${OPTARG}
            ;;
        b)
            BUILD_ROOT_DIR=${OPTARG}
            ;;
        h)
            echo "Usage: build.sh [-h] [-v] [-c] [-t <target>]"
            echo
            echo "-h             Display usage info"
            echo "-v             Make the build process verbose"
            echo "-c             Clean build directory first"
            echo "-t <target>    Target to build (release|debug|all)"
            echo "-b <build-dir> Path to the build directory. \`build' is used as default"
            echo
            echo "When no target is specified, release will be build."
            echo
{'fraction_non_alphanumeric': 0.09859154929577464, 'fraction_numerical': 0.007042253521126761, 'mean_word_length': 1.4792727272727273, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5943537', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1002, 'n_words': 335}