-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.ps1
29 lines (22 loc) · 1.15 KB
/
build.ps1
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
#!/usr/bin/env powershell
$errorAction = "Ignore"
function exec($_cmd) {
write-host " > $_cmd $args" -ForegroundColor cyan
& $_cmd @args
if ($LASTEXITCODE -ne 0) {
throw 'Command failed'
}
}
New-Item -ItemType "directory" -Path "nuget-packages" -Force -ErrorAction SilentlyContinue
Remove-Item "nuget-packages/*" -Recurse -ErrorAction $errorAction
Remove-Item ./src/GitLabSourceLink/bin/ -Recurse -ErrorAction $errorAction
Remove-Item ./src/GitLabSourceLink/obj/ -Recurse -ErrorAction $errorAction
Remove-Item ./src/GitLabSourceLink.ExampleLibrary/bin/ -Recurse -ErrorAction $errorAction
Remove-Item ./src/GitLabSourceLink.ExampleLibrary/obj/ -Recurse -ErrorAction $errorAction
Remove-Item ./src/GitLabSourceLink.ExampleConsumer/bin/ -Recurse -ErrorAction $errorAction
Remove-Item ./src/GitLabSourceLink.ExampleConsumer/obj/ -Recurse -ErrorAction $errorAction
exec dotnet restore -f ./src/GitLabSourceLink/
exec dotnet pack -c Debug ./src/GitLabSourceLink/
exec dotnet restore -f ./src/GitLabSourceLink.ExampleLibrary/
exec dotnet pack -c Debug ./src/GitLabSourceLink.ExampleLibrary/
exec dotnet build -c Debug ./src/GitLabSourceLink.ExampleConsumer/