forked from MiniProfiler/dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
44 lines (34 loc) · 1.42 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
param(
[parameter(Position=0,Mandatory=$true)]
[AllowEmptyString()]
[string] $VersionSuffix
)
$packageOutputFolder = "$PSScriptRoot\.nupkgs"
$projectsToBuild =
'MiniProfiler.Shared',
'MiniProfiler',
'MiniProfiler.EF6',
'MiniProfiler.Mvc5',
'MiniProfiler.AspNetCore',
'MiniProfiler.AspNetCore.Mvc',
#'MiniProfiler.Providers.RavenDB',
'MiniProfiler.Providers.SqlServer',
'MiniProfiler.Providers.SqlServerCe'
Write-Host "Hello and welcome to our elaborate build!"
Write-Host "Just kidding, this is a sanity check at the moment, it'll get more detailed."
mkdir -Force $packageOutputFolder | Out-Null
Write-Host "Clearing existing $packageOutputFolder..." -NoNewline
Get-ChildItem $packageOutputFolder | Remove-Item
Write-Host "done." -ForegroundColor "Green"
Write-Host "Building Version $Version of all packages" -ForegroundColor "Green"
foreach ($project in $projectsToBuild) {
Write-Host "Working on $project`:" -ForegroundColor "Magenta"
Push-Location ".\src\$project"
Write-Host " Restoring and packing $project... (Suffix:" -NoNewline -ForegroundColor "Magenta"
Write-Host $VersionSuffix -NoNewline -ForegroundColor "Cyan"
Write-Host ")" -ForegroundColor "Magenta"
dotnet msbuild "/t:Restore;Pack" "/p:Configuration=Release" "/p:VersionSuffix=$VersionSuffix" "/p:PackageOutputPath=$packageOutputFolder" "/p:CI=true"
Pop-Location
Write-Host "Done."
Write-Host ""
}