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