-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.ps1
49 lines (38 loc) · 1.18 KB
/
default.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
properties {
$build_dir = Split-Path $psake.build_script_file
$build_output = "$build_dir\build\"
$release_output = "$build_dir\release\"
$code_dir = "$build_dir\src"
$xunit_dir = "$build_dir\lib\xunit"
}
task default -depends Release
task Release -depends Test {
Write-Host "Creating release..." -ForegroundColor Green
cp $build_output\dotLessen.dll $release_output
}
task Test -depends Compile, Clean {
Write-Host "Testing..." -ForegroundColor Green
$old = pwd
cd $xunit_dir
cp $xunit_dir\Xunit.dll $build_output
Exec { &"$xunit_dir\xunit.console.exe" "$build_output\dotLessen.Tests.dll" }
cd $old
}
task Compile -depends Clean {
Write-Host "Compiling..." -ForegroundColor Green
Exec { msbuild "$code_dir\dotLessen.sln" /t:Build /p:Configuration=Release /v:quiet /p:OutDir=$build_output }
}
task Clean {
Write-Host "Cleaning..." -ForegroundColor Green
if (Test-Path $build_output)
{
rd $build_output -rec -force | out-null
}
mkdir $build_output | out-null
if (Test-Path $release_output)
{
rd $release_output -rec -force | out-null
}
mkdir $release_output | out-null
Exec { msbuild "$code_dir\dotLessen.sln" /t:Clean /p:Configuration=Release /v:quiet }
}