-
Notifications
You must be signed in to change notification settings - Fork 139
/
build.ps1
43 lines (29 loc) · 1.04 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
param(
[string]$configuration = "Release"
)
. ".\build.common.ps1"
$solutionName = "RaspberrySharp.IO"
function init {
# Initialization
$global:rootFolder = Split-Path -parent $script:MyInvocation.MyCommand.Path
$global:rootFolder = Join-Path $rootFolder .
$global:packagesFolder = Join-Path $rootFolder packages
$global:outputFolder = Join-Path $rootFolder _artifacts
$global:msbuild = "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
_WriteOut -ForegroundColor $ColorScheme.Banner "-= $solutionName Build =-"
_WriteConfig "rootFolder" $rootFolder
}
function restorePackages{
_WriteOut -ForegroundColor $ColorScheme.Banner "nuget restore"
New-Item -Force -ItemType directory -Path $packagesFolder
_DownloadNuget $packagesFolder
nuget restore
}
function buildSolution{
_WriteOut -ForegroundColor $ColorScheme.Banner "Build Solution"
& $msbuild "$rootFolder\$solutionName.sln" /p:Configuration=$configuration
}
init
restorePackages
buildSolution
Write-Host "Build $configuration complete"