-
Notifications
You must be signed in to change notification settings - Fork 28
/
Prepare-Release.ps1
35 lines (29 loc) · 872 Bytes
/
Prepare-Release.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
35
param (
$Solution = "$PSScriptRoot/../ManagedSpy.sln",
$ReleaseDir = "$PSScriptRoot/../releases",
$Version = '1.2.2',
$msbuild = 'msbuild'
)
$ErrorActionPreference = 'Stop'
function log($text, $header) {
if (-not $header) {
$header = 'build'
}
Write-Host "[$header] $text" -ForegroundColor White
}
function exec($command) {
log "$command $args" 'exec'
& $command $args
if (!$?) {
throw "[build error] $command $args = $LASTEXITCODE"
}
}
function prepare($platform) {
exec $msbuild /p:Configuration=Release /p:Platform=$platform '/t:Clean;Rebuild'
Compress-Archive "$PSScriptRoot/../ManagedSpy/bin/$platform/Release/*" "$ReleaseDir/ManagedSpy_$($platform)_$Version.zip"
}
if (-not (Test-Path -PathType Container $ReleaseDir)) {
New-Item -ItemType Directory $ReleaseDir
}
prepare x86
prepare x64