-
Notifications
You must be signed in to change notification settings - Fork 113
/
generate-dev-sln.ps1
40 lines (33 loc) · 1.29 KB
/
generate-dev-sln.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
[CmdletBinding()]
param
(
[ValidateNotNullOrEmpty()]
[string]
$DiagRepoRoot = "$PSScriptRoot\..\diagnostics"
)
$ErrorActionPreference = 'Stop'
$resolvedPath = Resolve-Path $DiagRepoRoot
$env:DIAGNOSTICS_REPO_ROOT=$resolvedPath
#Generates a solution that spans both the diagnostics and the dotnet-monitor repo.
#This can be used to build both projects in VS.
$devSln = "$PSScriptRoot\dotnet-monitor.dev.sln"
Copy-Item "$PSScriptRoot\dotnet-monitor.sln" $devSln -Force
& dotnet sln $devSln add "$env:DIAGNOSTICS_REPO_ROOT\src\Microsoft.Diagnostics.Monitoring\Microsoft.Diagnostics.Monitoring.csproj"
if ($LASTEXITCODE -gt 0)
{
exit $LASTEXITCODE
}
& dotnet sln $devSln add "$env:DIAGNOSTICS_REPO_ROOT\src\Microsoft.Diagnostics.Monitoring.EventPipe\Microsoft.Diagnostics.Monitoring.EventPipe.csproj"
if ($LASTEXITCODE -gt 0)
{
exit $LASTEXITCODE
}
& dotnet sln $devSln add "$env:DIAGNOSTICS_REPO_ROOT\src\Microsoft.Diagnostics.NETCore.Client\Microsoft.Diagnostics.NETCore.Client.csproj"
if ($LASTEXITCODE -gt 0)
{
exit $LASTEXITCODE
}
$slnFile = Get-Content $devSln
#dotnet sln uses an older ProjectType Guid
$slnFile -replace 'FAE04EC0-301F-11D3-BF4B-00C04F79EFBC', '9A19103F-16F7-4668-BE54-9A1E7A4F7556' | Out-File $devSln
& "$PSScriptRoot\startvs.cmd" $PSScriptRoot\dotnet-monitor.dev.sln