forked from bakakaba/modfx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·112 lines (84 loc) · 1.85 KB
/
run.sh
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
set -e
function clean {
echo Cleaning...
find src test -name obj -or -name bin | xargs -r rm -r
}
function restore {
echo Restoring...
dotnet restore
}
function build {
echo Building...
dotnet build --configuration Release
}
function test {
echo Testing...
for project in $(get_test_projects); do
dotnet test $project
done
}
function package {
echo Packaging...
if [ "$BRANCH" != "master" ]
then
local version_suffix="b$BUILD_NUMBER"
fi
for project in $(get_projects); do
dotnet pack $project -c Release --version-suffix "$version_suffix" --include-symbols
done
echo "Produced the following packages:"
find src -name "*.nupkg" -printf " -> %p\n"
}
function publish {
echo Publishing...
for package in $(get_packages); do
dotnet nuget push $package -s nuget.org -k "$NUGET_KEY"
done
}
function get_projects {
find src -name '*.csproj'
}
function get_test_projects {
find test -name '*.csproj'
}
function get_packages {
find src -name "*.nupkg" ! -name "*.symbols.nupkg"
}
case "$1" in
clean)
clean
;;
restore)
restore
;;
build)
build
;;
test)
test
;;
package)
clean
restore
test
package
;;
publish)
publish
;;
*)
cat <<EOF
Usage: $0 [command]
Commands:
clean Removes all bin/ and obj/ folders.
restore Restores dependent packages for projects specified in the solution.
build Builds projects specified in the solution.
test Tests all projects under test/.
package Performs clean build, test and pack.
publish Publishes all packages under src/
help Prints this message.
EOF
exit 1
;;
esac