<commit_before>#!/bin/bash

# Helper functions
exit_abort () {
	[ ! -z "$1" ] && echo ERROR: "$1"
	echo
	echo 'ABORTED!'
	exit 1
}

ServerName=$1
[ ! -z "$ServerName" ] || ServerName=https://test.gaiaserve.net

echo Building SamplesServiceModelGenerator ...
dotnet build --configuration Release || exit_abort "Can't build SamplesServiceModelGenerator"

echo Creating new Samples service model from $ServerName ...
curl -f "$ServerName/api/v1/status" || exit_abort "Can't fetch API status from $ServerName"
echo
pushd Aquarius.Client/Samples/Client
./create_service_models.sh $ServerName || exit_abort "Can't create Samples service model"
popd

echo Rebuilding SDK ...
dotnet build --configuration Release || exit_abort "Can't rebuild SDK with regenerated Samples client"

echo Running unit tests ...
dotnet test --configuration Release `find . -iname *.UnitTests.csproj` || exit_abort "Unit tests failed."<commit_msg>PF-93 Tweaked the Samples regeneration script<commit_after>#!/bin/bash

# Helper functions
exit_abort () {
	[ ! -z "$1" ] && echo ERROR: "$1"
	echo
	echo 'ABORTED!'
	exit 1
}

[ -f "Aquarius.SDK.sln" ] || exit_abort "This script must be run from <repo>/src folder."

ServerName=$1
Configuration=$2
[ ! -z "$ServerName" ] || ServerName=https://test.gaiaserve.net
[ ! -z "$Configuration" ] || Configuration=Release

echo Building SamplesServiceModelGenerator ...
dotnet build --configuration $Configuration || exit_abort "Can't build SamplesServiceModelGenerator."

echo Creating new Samples service model from $ServerName ...
pushd Aquarius.Client/Samples/Client
./create_service_models.sh $ServerName || exit_abort "Can't create Samples service model."
popd

echo Rebuilding SDK ...
dotnet build --configuration $Configuration || exit_abort "Can't rebuild SDK with regenerated Samples client"

echo Running unit tests ...
dotnet test --configuration $Configuration `find . -iname *.UnitTests.csproj` || exit_abort "Unit tests failed."

exit 0
{'fraction_non_alphanumeric': 0.12353241449719245, 'fraction_numerical': 0.006636038795303726, 'mean_word_length': 4.648414985590778, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '7362631', 'n_tokens_mistral': 612, 'n_tokens_neox': 578, 'n_words': 188}