forked from Advaith3600/PowerToys-Run-Currency-Converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.ps1
executable file
·31 lines (24 loc) · 1.16 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
25
26
27
28
29
30
31
$ErrorActionPreference = "Stop"
$projectDirectory = "$PSScriptRoot\Community.PowerToys.Run.Plugin.CurrencyConverter"
[xml]$xml = Get-Content -Path "$projectDirectory\Community.PowerToys.Run.Plugin.CurrencyConverter.csproj"
$version = $xml.Project.PropertyGroup.Version
$version = "$version".Trim()
foreach ($platform in "x64", "ARM64")
{
if (Test-Path -Path "$PSScriptRoot\CurrencyConverter-$version-$platform.zip")
{
Remove-Item -Path "$PSScriptRoot\CurrencyConverter-$version-$platform.zip"
}
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 "CurrencyConverter"
Compress-Archive -Path "$projectDirectory\bin\$platform\CurrencyConverter" -DestinationPath "$PSScriptRoot\CurrencyConverter-$version-$platform.zip"
}