<commit_before>#!/bin/bash

if hash nproc 2>/dev/null; then
    JOBS=$(nproc)
else
    JOBS=1
fi

error () {
[ "$1" != "0" ] &&  exit 1 || :
}

log () {
echo ""
echo "========================================"
echo "= $1"
echo "========================================"
echo ""
}

function usage
{
    echo "usage: joynr-build-cpp.sh [--jobs X]"
    echo "default jobs is $JOBS"
}

while [ "$1" != "" ]; do
    case $1 in
        --jobs )                 shift
                                 JOBS=$1
                                 ;;
        * )                      usage
                                 exit 1
    esac
    shift
done

START=$(date +%s)

# fail on first error
set -e

log "INSTALL REQUIRED MODULES AND GENERATE SOURCES"
mvn clean install -P no-license-and-notice,no-java-formatter,no-checkstyle -DskipTests

END=$(date +%s)
DIFF=$(( $END - $START ))
log "c++ generate sources took $DIFF seconds"

mkdir -p build
cd build

log "RUN CMAKE"

cmake -DUSE_DBUS_COMMONAPI_COMMUNICATION=OFF \
      -DENABLE_GCOV=OFF \
      -DENABLE_DOXYGEN=OFF \
      -DENABLE_CLANG_FORMATTER=OFF \
      -DBUILD_TESTS=OFF \
      -DJOYNR_SERVER_HOST=localhost \
      -DJOYNR_SERVER_HTTP_PORT=8080 \
      -DJOYNR_SERVER_MQTT_PORT=1883 \
      -DCMAKE_BUILD_TYPE=Debug ../cpp


log "BUILD C++ JOYNR"
make -j $JOBS

END=$(date +%s)
DIFF=$(( $END - $START ))
log "C++ build time: $DIFF seconds"<commit_msg>[C++] fix joynr-build-cpp script<commit_after>#!/bin/bash

if hash nproc 2>/dev/null; then
    JOBS=$(nproc)
else
    JOBS=1
fi

error () {
[ "$1" != "0" ] &&  exit 1 || :
}

log () {
echo ""
echo "========================================"
echo "= $1"
echo "========================================"
echo ""
}

function usage
{
    echo "usage: joynr-build-cpp.sh [--jobs X]"
    echo "default jobs is $JOBS"
}

while [ "$1" != "" ]; do
    case $1 in
        --jobs )                 shift
                                 JOBS=$1
                                 ;;
        * )                      usage
                                 exit 1
    esac
    shift
done

START=$(date +%s)

# fail on first error
set -e

log "INSTALL REQUIRED MODULES AND GENERATE SOURCES"
mvn clean install -P no-license-and-notice,no-java-formatter,no-checkstyle -DskipTests

END=$(date +%s)
DIFF=$(( $END - $START ))
log "c++ generate sources took $DIFF seconds"

mkdir -p build
cd build

log "RUN CMAKE"

cmake -DUSE_DBUS_COMMONAPI_COMMUNICATION=OFF \
      -DUSE_PLATFORM_SPDLOG=OFF \
      -DUSE_PLATFORM_JSMN=OFF \
      -DUSE_PLATFORM_WEBSOCKETPP=OFF \
      -DENABLE_GCOV=OFF \
      -DENABLE_DOXYGEN=OFF \
      -DENABLE_CLANG_FORMATTER=OFF \
      -DBUILD_TESTS=OFF \
      -DJOYNR_SERVER_HOST=localhost \
      -DJOYNR_SERVER_HTTP_PORT=8080 \
      -DJOYNR_SERVER_MQTT_PORT=1883 \
      -DCMAKE_BUILD_TYPE=Debug ../cpp


log "BUILD C++ JOYNR"
make -j $JOBS

END=$(date +%s)
DIFF=$(( $END - $START ))
log "C++ build time: $DIFF seconds"
{'fraction_non_alphanumeric': 0.18494550408719346, 'fraction_numerical': 0.01226158038147139, 'mean_word_length': 2.1648706896551726, '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': '1830093', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1043, 'n_words': 243}