-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.ps1
24 lines (18 loc) · 1.13 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
$ErrorActionPreference = "Stop"
[xml]$xml = Get-Content -Path "$PSScriptRoot\Directory.Build.Props"
$version = $xml.Project.PropertyGroup.Version
foreach ($platform in "ARM64", "x64")
{
if (Test-Path -Path "$PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio\bin")
{
Remove-Item -Path "$PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio\bin\*" -Recurse
}
if (Test-Path -Path "$PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio\obj")
{
Remove-Item -Path "$PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio\obj\*" -Recurse
}
dotnet build $PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio.sln -c Release /p:Platform=$platform
Remove-Item -Path "$PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio\bin\*" -Recurse -Include *.xml, *.pdb, PowerToys.*, Wox.*
Rename-Item -Path "$PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio\bin\$platform\Release" -NewName "VisualStudio"
Compress-Archive -Path "$PSScriptRoot\Community.PowerToys.Run.Plugin.VisualStudio\bin\$platform\VisualStudio" -DestinationPath "$PSScriptRoot\VisualStudio-$version-$platform.zip"
}