From 6b4634746a4401aee0494f32e34728f5bcf759d5 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 31 Aug 2017 07:54:07 +0200 Subject: [PATCH] Update scripts So they match more what travis is doing. --- cc.sh | 22 +++++++++++++--------- run.sh | 7 +++++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/cc.sh b/cc.sh index 4c606a983..9f1fb5570 100755 --- a/cc.sh +++ b/cc.sh @@ -2,10 +2,11 @@ set -eu PROJECT="ArchiSteamFarm" -OUT="out" -MSBUILD_ARGS=("/nologo") +OUT="out/source" + +SOLUTION="${PROJECT}.sln" +CONFIGURATION="Release" -BUILD="Release" CLEAN=0 PRINT_USAGE() { @@ -15,8 +16,8 @@ PRINT_USAGE() { for ARG in "$@"; do case "$ARG" in - release|Release) BUILD="Release" ;; - debug|Debug) BUILD="Debug" ;; + release|Release) CONFIGURATION="Release" ;; + debug|Debug) CONFIGURATION="Debug" ;; --clean) CLEAN=1 ;; *) PRINT_USAGE esac @@ -27,6 +28,8 @@ if ! hash dotnet &>/dev/null; then exit 1 fi +dotnet --info + cd "$(dirname "$(readlink -f "$0")")" if [[ -d ".git" ]] && hash git &>/dev/null; then @@ -34,17 +37,18 @@ if [[ -d ".git" ]] && hash git &>/dev/null; then fi if [[ ! -f "${PROJECT}.sln" ]]; then - echo "ERROR: ${PROJECT}.sln could not be found!" exit 1 fi if [[ "$CLEAN" -eq 1 ]]; then - dotnet clean -c "$BUILD" -o "$OUT" - rm -rf "$OUT" + dotnet clean -c "$CONFIGURATION" -o "$OUT" + rm -rf "ArchiSteamFarm/${OUT}" "ArchiSteamFarm.Tests/${OUT}" fi dotnet restore -dotnet build -c "$BUILD" -o "$OUT" --no-restore "${MSBUILD_ARGS[@]}" + +dotnet build -c "$CONFIGURATION" -o "$OUT" --no-restore /nologo +dotnet test ArchiSteamFarm.Tests -c "$CONFIGURATION" -o "$OUT" --no-build --no-restore echo echo "Compilation finished successfully! :)" diff --git a/run.sh b/run.sh index d4bb0bc40..c5d7cec43 100755 --- a/run.sh +++ b/run.sh @@ -2,7 +2,8 @@ set -eu PROJECT="ArchiSteamFarm" -OUT="out" +OUT="out/source" + BINARY="${PROJECT}/${OUT}/${PROJECT}.dll" ASF_ARGS=("") @@ -28,6 +29,8 @@ if ! hash dotnet &>/dev/null; then exit 1 fi +dotnet --info + cd "$(dirname "$(readlink -f "$0")")" if [[ ! -f "$BINARY" ]]; then @@ -37,7 +40,7 @@ fi if [[ "$UNTIL_CLEAN_EXIT" -eq 0 ]]; then dotnet exec "$BINARY" "${ASF_ARGS[@]}" - exit $? + exit $? # In this case $? can only be 0 because otherwise set -e terminates the script fi while [[ -f "$BINARY" ]]; do