-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.ps1
23 lines (19 loc) · 784 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
param (
[ValidateSet("Debug", "Release")]
$Configuration = "Release"
)
$ErrorActionPreference = "Stop"
$sln = "$PSScriptRoot/csharp/Profiler.sln"
Write-Host "Publish and copy dlls"
$frameworks = "net452", "net6.0"
foreach ($framework in $frameworks) {
dotnet publish $sln --framework $framework --configuration $Configuration /warnaserror
if (0 -ne $LASTEXITCODE) {
throw "Publish failed"
}
$destination = "$PSScriptRoot/Profiler/bin/$framework"
$sourceDir = "$PSScriptRoot/csharp/Profiler/bin/$Configuration/$framework/publish"
New-Item $destination -ItemType Directory -Force | Out-Null
Copy-Item -Destination $destination -Path $sourceDir/Profiler.dll
Copy-Item -Destination $destination -Path $sourceDir/Newtonsoft.Json.dll
}