forked from emgarten/NuGet.CatalogReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
43 lines (33 loc) · 958 Bytes
/
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
param (
[switch]$SkipTests,
[switch]$SkipPack,
[ValidateSet("Debug", "Release")]
[string]$Configuration = "Release"
)
$RepoName = "NuGet.CatalogReader"
$RepoRoot = $PSScriptRoot
pushd $RepoRoot
# Load common build script helper methods
. "$PSScriptRoot\build\common\common.ps1"
# Download tools
Install-DotnetCLI $RepoRoot
Install-NuGetExe $RepoRoot
# Clean and write git info
Remove-Artifacts $RepoRoot
Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:Clean;WriteGitInfo", "/p:Configuration=$Configuration")
# Restore
Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:Restore", "/p:Configuration=$Configuration")
# Run main build
$buildTargets = "Build"
if (-not $SkipTests)
{
$buildTargets += ";Test"
}
if (-not $SkipPack)
{
$buildTargets += ";Pack"
}
# Run build.proj
Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:$buildTargets", "/p:Configuration=$Configuration")
popd
Write-Host "Success!"