-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ps1
33 lines (27 loc) · 1.19 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
#This build assumes the following directory structure
#
# \ - This is where the project build code lives
# \build - This folder is created if it is missing and contains output of the build
# \src - This folder contains the source code or solutions you want to build
#
Properties {
$build_dir = Split-Path $psake.build_script_file
$build_artifacts_dir = "$build_dir\build\"
$solution_file = "$build_dir\src\ActionControllers\ActionControllers.csproj"
}
FormatTaskName (("-"*25) + "[{0}]" + ("-"*25))
Task Default -Depends Build
Task Build -Depends Clean {
Write-Host "Building $solution_file" -ForegroundColor Green
Exec { msbuild "$solution_file" /t:Build /p:Configuration=Release /v:quiet /p:OutDir=$build_artifacts_dir }
}
Task Clean {
Write-Host "Creating BuildArtifacts directory" -ForegroundColor Green
if (Test-Path $build_artifacts_dir)
{
rd $build_artifacts_dir -rec -force | out-null
}
mkdir $build_artifacts_dir | out-null
Write-Host "Cleaning $solution_file" -ForegroundColor Green
Exec { msbuild "$solution_file" /t:Clean /p:Configuration=Release /v:quiet }
}