-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathBuild.ps1
50 lines (34 loc) · 1.73 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function buildVS
{
param
(
[parameter(Mandatory=$true)]
[String] $path,
[parameter(Mandatory=$true)]
[String] $version,
[parameter(Mandatory=$false)]
[bool] $nuget = $true
)
process
{
$msBuildExe = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\msbuild.exe'
Write-Host "Building x64 $($path)" -foregroundcolor green
& "$($msBuildExe)" "$($path)" /t:Build /m /property:Configuration=Release /property:Platform=x64
Write-Host "Building x86 $($path)" -foregroundcolor green
& "$($msBuildExe)" "$($path)" /t:Build /m /property:Configuration=Release /property:Platform=x86
$x64zip = ".\Releases\Release_AutoActions_$($version)_x64.zip"
$x86zip = ".\Releases\Release_AutoActions_$($version)_x86.zip"
Write-Host "Creating Zip x64 $($x64zip)" -foregroundcolor green
if (Test-Path $x64zip -PathType leaf)
{del $x64zip}
Get-ChildItem -Path ".\Source\Release_x64" |
Where-Object {$_.PsIsContainer -eq $true -or $_.Extension -eq ".exe" -or $_.Extension -eq ".config" -or $_.Extension -eq ".dll" -or $_.Name -eq "UpdateData.json" } | Compress-Archive -DestinationPath $x64zip
Write-Host "Creating Zip x86 $($x86ip)" -foregroundcolor green
if (Test-Path $x86zip -PathType leaf)
{del $x86zip}
Get-ChildItem -Path ".\Source\Release_x86" |
Where-Object {$_.PsIsContainer -eq $true -or $_.Extension -eq ".exe" -or $_.Extension -eq ".config" -or $_.Extension -eq ".dll" -or $_.Name -eq "UpdateData.json" } | Compress-Archive -DestinationPath $x86zip
Write-Host "Finished!" -foregroundcolor green
}
}
buildVS .\Source\AutoActions.sln