-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
96 lines (83 loc) · 1.6 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
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
param(
$a
)
$src = dir .\src
function clean {
foreach ($dir in $src) {
Set-Location .\src\$dir
if(Test-Path -Path .\bin) {
Remove-Item .\bin -Force -Recurse
"$dir\bin deleted."
} else {
"$dir\bin not found."
}
Set-Location ..\..\
}
}
function build {
foreach ($dir in $src) {
Set-Location .\src\$dir
dotnet build
Set-Location ..\..\
}
}
function pack {
foreach ($dir in $src) {
Set-Location .\src\$dir
dotnet pack
Set-Location ..\..\
}
}
function restore {
foreach ($dir in $src) {
Set-Location .\src\$dir
dotnet restore
Set-Location ..\..\
}
}
function publish {
foreach ($dir in $src) {
Set-Location .\src\$dir\bin\debug
$packages = Get-ChildItem -Filter *.nupkg | Where-Object { $_.Extension -eq '.nupkg' }
foreach($package in $packages) {
nuget push $package -Source https://www.nuget.org/api/v2/package
}
Set-Location ..\..\..\..\
}
}
function love {
"Awww, we love you too!"
}
switch($a) {
"clean" {
clean
}
"restore" {
restore
}
"build" {
build
}
"pack" {
pack
}
"publish" {
publish
}
"love" {
love
}
default {
clean
restore
build
pack
""
"---------------------------------------"
""
"NOTE: You must run `publish` manually."
""
"---------------------------------------"
""
}
}