-
Notifications
You must be signed in to change notification settings - Fork 1
/
tasks
executable file
·50 lines (49 loc) · 1.21 KB
/
tasks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
command="$1"
case "${command}" in
clean)
find . -type d -name bin -exec rm -r {} \;
find . -type d -name obj -exec rm -r {} \;
rm -r ./packages/*
rm -r ./paket-files/*
rm -r ./nuget-packages/*
;;
_build)
# restore packages and build the whole solution
dotnet publish --configuration=Release --output=./bin/Release
exit $?
;;
build)
dojo "./tasks _build"
exit $?
;;
_run)
# TODO: add --no-build so that we do not recreate the artifacts
dotnet run --configuration=Release --project=./src/app/
exit $?
;;
run)
dojo "./tasks _run"
exit $?
;;
_unit)
# TODO: add --no-build so that we do not recreate the artifacts
tests=$(set -x; dotnet test --configuration=Release --list-tests ./tests/app.Tests)
if [[ "${tests}" == "" ]]; then
echo "No tests found"
exit 1
fi
# TODO: add --no-build so that we do not recreate the artifacts
dotnet test --configuration=Release ./tests/app.Tests
exit $?
;;
unit)
dojo "./tasks _unit"
exit $?
;;
*)
echo "Invalid command: '${command}'"
exit 1
;;
esac
set +e