Update scripts

So they match more what travis is doing.
This commit is contained in:
JustArchi
2017-08-31 07:54:07 +02:00
parent cdd08ad14b
commit 6b4634746a
2 changed files with 18 additions and 11 deletions

22
cc.sh
View File

@@ -2,10 +2,11 @@
set -eu set -eu
PROJECT="ArchiSteamFarm" PROJECT="ArchiSteamFarm"
OUT="out" OUT="out/source"
MSBUILD_ARGS=("/nologo")
SOLUTION="${PROJECT}.sln"
CONFIGURATION="Release"
BUILD="Release"
CLEAN=0 CLEAN=0
PRINT_USAGE() { PRINT_USAGE() {
@@ -15,8 +16,8 @@ PRINT_USAGE() {
for ARG in "$@"; do for ARG in "$@"; do
case "$ARG" in case "$ARG" in
release|Release) BUILD="Release" ;; release|Release) CONFIGURATION="Release" ;;
debug|Debug) BUILD="Debug" ;; debug|Debug) CONFIGURATION="Debug" ;;
--clean) CLEAN=1 ;; --clean) CLEAN=1 ;;
*) PRINT_USAGE *) PRINT_USAGE
esac esac
@@ -27,6 +28,8 @@ if ! hash dotnet &>/dev/null; then
exit 1 exit 1
fi fi
dotnet --info
cd "$(dirname "$(readlink -f "$0")")" cd "$(dirname "$(readlink -f "$0")")"
if [[ -d ".git" ]] && hash git &>/dev/null; then if [[ -d ".git" ]] && hash git &>/dev/null; then
@@ -34,17 +37,18 @@ if [[ -d ".git" ]] && hash git &>/dev/null; then
fi fi
if [[ ! -f "${PROJECT}.sln" ]]; then if [[ ! -f "${PROJECT}.sln" ]]; then
echo "ERROR: ${PROJECT}.sln could not be found!"
exit 1 exit 1
fi fi
if [[ "$CLEAN" -eq 1 ]]; then if [[ "$CLEAN" -eq 1 ]]; then
dotnet clean -c "$BUILD" -o "$OUT" dotnet clean -c "$CONFIGURATION" -o "$OUT"
rm -rf "$OUT" rm -rf "ArchiSteamFarm/${OUT}" "ArchiSteamFarm.Tests/${OUT}"
fi fi
dotnet restore 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
echo "Compilation finished successfully! :)" echo "Compilation finished successfully! :)"

7
run.sh
View File

@@ -2,7 +2,8 @@
set -eu set -eu
PROJECT="ArchiSteamFarm" PROJECT="ArchiSteamFarm"
OUT="out" OUT="out/source"
BINARY="${PROJECT}/${OUT}/${PROJECT}.dll" BINARY="${PROJECT}/${OUT}/${PROJECT}.dll"
ASF_ARGS=("") ASF_ARGS=("")
@@ -28,6 +29,8 @@ if ! hash dotnet &>/dev/null; then
exit 1 exit 1
fi fi
dotnet --info
cd "$(dirname "$(readlink -f "$0")")" cd "$(dirname "$(readlink -f "$0")")"
if [[ ! -f "$BINARY" ]]; then if [[ ! -f "$BINARY" ]]; then
@@ -37,7 +40,7 @@ fi
if [[ "$UNTIL_CLEAN_EXIT" -eq 0 ]]; then if [[ "$UNTIL_CLEAN_EXIT" -eq 0 ]]; then
dotnet exec "$BINARY" "${ASF_ARGS[@]}" dotnet exec "$BINARY" "${ASF_ARGS[@]}"
exit $? exit $? # In this case $? can only be 0 because otherwise set -e terminates the script
fi fi
while [[ -f "$BINARY" ]]; do while [[ -f "$BINARY" ]]; do