<commit_before>#!/bin/bash -x
if (( $# != 2 )); then
    echo "Improper usage of this script. Please invoke with arguments <OLD_VERSION> <NEW_VERSION> "
    exit 1
fi

os=`uname`

function _sed {
    if [[ "$os" =~ "Linux" ]]; then
        sed -i -e "$1" ${@:2}
    else
        sed -i '' -e "$1" ${@:2}
    fi
}

oldVersion=$1
newVersion=$2
oldVersionWithoutSuffix=`echo $oldVersion | sed -e "s/-.*//g"`
newVersionWithoutSuffix=`echo $newVersion | sed -e "s/-.*//g"`

## CPP version change
_sed 's/'$oldVersionWithoutSuffix'/'$newVersionWithoutSuffix'/g' \
CMakeLists.txt

## Java version change
mvn versions:set -DnewVersion=$2
mvn versions:commit

## JavaScript version change
_sed 's/'$oldVersion'/'$newVersion'/g' \
node/package.json \
node/NOTICE-JS

echo "prepare git patch"

countFoundOldVersions=$(git grep -F ${oldVersion} * | grep -v ReleaseNotes | wc -l)
if (($countFoundOldVersions > 0)); then
    echo "WARNING: a grep over your workspace emphasised that the oldVersion is still present in some of your resources. Please check manually!"
    git grep -F ${oldVersion} * | grep -v ReleaseNotes
else
    git add -A && git commit -m "[Release] set version to $newVersion"
fi<commit_msg>[build] Also change RPM package version with setVersion.sh<commit_after>#!/bin/bash -x
if (( $# != 2 )); then
    echo "Improper usage of this script. Please invoke with arguments <OLD_VERSION> <NEW_VERSION> "
    exit 1
fi

os=`uname`

function _sed {
    if [[ "$os" =~ "Linux" ]]; then
        sed -i -e "$1" ${@:2}
    else
        sed -i '' -e "$1" ${@:2}
    fi
}

oldVersion=$1
newVersion=$2
oldVersionWithoutSuffix=`echo $oldVersion | sed -e "s/-.*//g"`
newVersionWithoutSuffix=`echo $newVersion | sed -e "s/-.*//g"`

## CPP and RPM version change
_sed 's/'$oldVersionWithoutSuffix'/'$newVersionWithoutSuffix'/g' \
CMakeLists.txt \
cpp/distribution/smrf.spec

## Java version change
mvn versions:set -DnewVersion=$2
mvn versions:commit

## JavaScript version change
_sed 's/'$oldVersion'/'$newVersion'/g' \
node/package.json \
node/NOTICE-JS

echo "prepare git patch"

countFoundOldVersions=$(git grep -F ${oldVersion} * | grep -v ReleaseNotes | wc -l)
if (($countFoundOldVersions > 0)); then
    echo "WARNING: a grep over your workspace emphasised that the oldVersion is still present in some of your resources. Please check manually!"
    git grep -F ${oldVersion} * | grep -v ReleaseNotes
else
    git add -A && git commit -m "[Release] set version to $newVersion"
fi
{'fraction_non_alphanumeric': 0.1474151857835218, 'fraction_numerical': 0.008077544426494346, 'mean_word_length': 3.700189753320683, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1852216', 'n_tokens_mistral': 872, 'n_tokens_neox': 821, 'n_words': 271}