-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.ps1
74 lines (65 loc) · 1.55 KB
/
ci.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
[CmdletBinding()]
param (
[Parameter(Position = 0)]
[ValidateSet("build", "test", "pack")]
[string] $command = $null,
[Parameter(Position = 1)]
[ValidateSet("Debug", "Release")]
[string] $configuration = "Release"
)
$env:PATH += ";C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Msbuild/Current/Bin";
$build = @(
"./src/Navigation",
"./tests/Navigation.UnitTests"
)
$test = @(
"./tests/Navigation.UnitTests"
)
$pack = @(
"./src/Navigation"
)
function build () {
foreach ($path in $build) {
msbuild `
/t:"restore,build" `
/nowarn:"MSB4011,VSX1000" `
/p:NoPackageAnalysis=true `
/p:ContinuousIntegrationBuild=true `
/p:Configuration=$configuration `
/verbosity:minimal `
$path
}
}
function test () {
foreach ($path in $test) {
dotnet `
test $path `
-c $configuration `
--no-restore `
--no-build
}
}
function pack () {
$output = "./nuget"
foreach ($path in $pack) {
msbuild `
/t:"pack" `
/nowarn:"MSB4011,VSX1000" `
/p:NoPackageAnalysis=true `
/p:ContinuousIntegrationBuild=true `
/p:Configuration=Release `
/p:PackageOutputPath=$output `
/verbosity:minimal `
$path
}
}
switch ($command.ToString()) {
"build" { build; break }
"test" { test; break }
"pack" { pack; break }
Default {
build;
test;
pack;
}
}