-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathBuild.ps1
31 lines (24 loc) · 1.28 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.ClipboardManager"
[xml]$xml = Get-Content -Path "$projectDirectory\Community.PowerToys.Run.Plugin.ClipboardManager.csproj"
$version = $xml.Project.PropertyGroup.Version
$version = "$version".Trim()
$pasterReleaseDirectory = "$PSScriptRoot\Paster\bin\Release\net8.0-windows"
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
$releaseDirectory = "$projectDirectory\bin\$platform\Release"
Remove-Item -Path "$projectDirectory\bin\*" -Recurse -Include *.xml, *.pdb, PowerToys.*, Wox.*, WinRT*, Microsoft*
New-Item -ItemType Directory -Force -Path $releaseDirectory\Paster
Copy-Item -Path $pasterReleaseDirectory\Paster.exe -Destination $releaseDirectory\Paster -Recurse
Rename-Item -Path $releaseDirectory -NewName "ClipboardManager"
Compress-Archive -Path "$projectDirectory\bin\$platform\ClipboardManager" -DestinationPath "$PSScriptRoot\ClipboardManager-$version-$platform.zip"
}