forked from christianrondeau/SikuliSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.ps1
More file actions
38 lines (29 loc) · 1.05 KB
/
Copy pathBuild.ps1
File metadata and controls
38 lines (29 loc) · 1.05 KB
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
Set-StrictMode -version Latest
$ErrorActionPreference = "Stop"
Write-Host "Building SikuliSharp..." -ForegroundColor Green
# ==================================== Functions
Function GetMSBuildExe {
[CmdletBinding()]
$DotNetVersion = "4.0"
$RegKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$DotNetVersion"
$RegProperty = "MSBuildToolsPath"
$MSBuildExe = Join-Path -Path (Get-ItemProperty $RegKey).$RegProperty -ChildPath "msbuild.exe"
Return $MSBuildExe
}
# ==================================== Variables
$NuGet = "$PSScriptRoot\.nuget\NuGet.exe"
$BuildPath = "$PSScriptRoot\SikuliSharp\bin\Release"
$CSProjPath = "$PSScriptRoot\SikuliSharp\SikuliSharp.csproj"
# ==================================== Build
If(Test-Path -Path $BuildPath) {
Remove-Item -Confirm:$false "$BuildPath\*.*" -Recurse
}
&(GetMSBuildExe) SikuliSharp.sln `
/t:Clean`;Rebuild `
/p:Configuration=Release `
/p:AllowedReferenceRelatedFileExtensions=- `
/p:DebugSymbols=false `
/p:DebugType=None `
/clp:ErrorsOnly `
/v:m
&($NuGet) pack $CSProjPath -Prop Configuration=Release