-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.ps1
executable file
·34 lines (26 loc) · 1.2 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
32
33
34
$ErrorActionPreference = "Stop"
$projectDirectory = "$PSScriptRoot\Community.PowerToys.Run.Plugin.CurrencyConverter"
$jsonContent = Get-Content -Path "$projectDirectory\plugin.json" -Raw | ConvertFrom-Json
$version = $jsonContent.version
foreach ($platform in "x64", "ARM64")
{
if (Test-Path -Path "$PSScriptRoot\bin\CurrencyConverter-$version-$platform.zip")
{
Remove-Item -Path "$PSScriptRoot\bin\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 --property WarningLevel=0
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\bin\CurrencyConverter-$version-$platform.zip"
}
Set-Location -Path "exe"
./build.ps1
Set-Location -Path ".."