-
Notifications
You must be signed in to change notification settings - Fork 4
/
init.ps1
40 lines (29 loc) · 1.23 KB
/
init.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
param(
[Parameter(Position = 0, ValueFromPipelineByPropertyName = $true)]
[switch] $WithCIBuild,
[Parameter(Position = 1, ValueFromPipelineByPropertyName = $true)]
[switch] $WithRunDotNetTests,
[Parameter(Position = 2, ValueFromPipelineByPropertyName = $true)]
[switch] $WithDebugOnly
)
$WorkingDir = Split-Path -parent $MyInvocation.MyCommand.Definition
. $WorkingDir\common.ps1
$SrcDirectory = Join-Path $WorkingDir src
$SnapxVersion = (dotnet gitversion /showVariable NugetVersionv2 | Out-String).Trim()
$Configurations = @("Debug")
if($WithDebugOnly -eq $false) {
$Configurations += "Release"
}
$ConfigurationsStr = $Configurations -join ", "
Write-Output-Colored "Init: $ConfigurationsStr. This might take a while! :)"
$Configurations | ForEach-Object {
$Configuration = $_
Invoke-Command-Colored pwsh @("build.ps1 -Target Bootstrap -Version $SnapxVersion -Configuration $Configuration -CIBuild:$WithCIBuild")
}
if($WithRunDotNetTests) {
$Configurations | ForEach-Object {
$Configuration = $_
Invoke-Command-Colored pwsh @("build.ps1 -Target Run-Dotnet-UnitTests -Version $SnapxVersion -Configuration $Configuration -CIBuild:$WithCIBuild")
}
}
Invoke-Dotnet-Clear $SrcDirectory