forked from Azure-Samples/azure-batch-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
38 lines (34 loc) · 1.02 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
param([string]$msbuildLogger="")
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$solutions = Get-ChildItem -Filter *.sln -Recurse
$msbuildSolutions = $solutions | where {$_.Name -like "BatchExplorer.sln"}
# Skip MultiInstanceTasks.sln due to native dependency
$skippedSolutions = $solutions | where {$_.Name -like "MultiInstanceTasks.sln"}
$dotnetBuildSolutions = $solutions | where {$msbuildSolutions -notcontains $_ -and $skippedSolutions -notcontains $_}
foreach($sln in $dotnetBuildSolutions)
{
Write-Output $sln.FullName
dotnet build $sln.FullName
if ($LastExitCode -ne 0)
{
exit $LastExitCode
}
}
foreach($sln in $msbuildSolutions)
{
Write-Output $sln.FullName
$slnName = $sln.FullName
if($msbuildLogger -ne "")
{
cmd /c "nuget restore $slnName && msbuild /m $slnName /logger:`"$msbuildLogger`""
}
else
{
cmd /c "nuget restore $slnName && msbuild /m $slnName"
}
if ($LastExitCode -ne 0)
{
exit $LastExitCode
}
}