forked from microsoft/dotnet-framework-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-and-test.ps1
52 lines (49 loc) · 1.24 KB
/
build-and-test.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
#!/usr/bin/env pwsh
[cmdletbinding(
DefaultParameterSetName = "BuildAndTest"
)]
param(
[ValidateSet("runtime", "sdk", "aspnet", "wcf")]
[string[]]$RepoFilter = @(),
[string]$VersionFilter = "*",
[string]$OSFilter = "*",
[Parameter(ParameterSetName = "Build")]
[switch]$BuildOnly,
[Parameter(ParameterSetName = "Test")]
[switch]$TestOnly,
[Parameter(ParameterSetName = "Build")]
[Parameter(ParameterSetName = "BuildAndTest")]
[string]$OptionalImageBuilderArgs
)
if ($PSCmdlet.ParameterSetName -eq "BuildAndTest") {
$build = $true
$test = $true
}
else {
$build = $BuildOnly
$test = $TestOnly
}
if ($RepoFilter.Count -eq 0) {
$PathFilters = $null
$testCategories = @()
}
else {
$PathFilters = ""
$RepoFilter | foreach {
$PathFilters += " --path '$VersionFilter/$_/$OSFilter'"
}
$testCategories = $RepoFilter
}
if ($build) {
& ./eng/common/build.ps1 `
-VersionFilter $VersionFilter `
-OSFilter $OSFilter `
-PathFilters $PathFilters `
-OptionalImageBuilderArgs $OptionalImageBuilderArgs
}
if ($test) {
& ./tests/run-tests.ps1 `
-VersionFilter $VersionFilter `
-OSFilter $OSFilter `
-TestCategories $testCategories
}