/
deployables.ps1
28 lines (23 loc) · 1.18 KB
/
deployables.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
$RepoRoot = [System.IO.Path]::GetFullPath("$PSScriptRoot/../..")
$BuildConfiguration = $env:BUILDCONFIGURATION
if (!$BuildConfiguration) {
$BuildConfiguration = 'Debug'
}
$result = @{ }
$PackagesRoot = "$RepoRoot/bin/Packages/$BuildConfiguration"
if (Test-Path $PackagesRoot) {
$result[$PackagesRoot] = (Get-ChildItem $PackagesRoot -Recurse)
}
$SosThreadingToolsRoot = "$RepoRoot/bin/SosThreadingTools/$BuildConfiguration/net472"
if (Test-Path $SosThreadingToolsRoot) {
$ArchivePath = "$RepoRoot\obj\SosThreadingTools\SosThreadingTools.zip"
$ArchiveLayout = "$RepoRoot\obj\SosThreadingTools\ArchiveLayout"
if (Test-Path $ArchiveLayout) { Remove-Item -Force $ArchiveLayout -Recurse }
New-Item -Path $ArchiveLayout -ItemType Directory | Out-Null
Copy-Item -Force -Path "$SosThreadingToolsRoot" -Recurse -Exclude "DllExport.dll","*.xml" -Destination $ArchiveLayout
Rename-Item -Path $ArchiveLayout\net472 $ArchiveLayout\SosThreadingTools
Get-ChildItem -Path $ArchiveLayout\symstore -Recurse | Remove-Item
Compress-Archive -Force -Path $ArchiveLayout\SosThreadingTools -DestinationPath $ArchivePath
$result[(Split-Path $ArchivePath -Parent)] = $ArchivePath
}
$result