-
Notifications
You must be signed in to change notification settings - Fork 3
/
fbt.ps1
80 lines (69 loc) · 3 KB
/
fbt.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<#
.SYNOPSIS
fbt - Funcy Build Tool
.DESCRIPTION
Make your build tasks for Funcy easy.
.PARAMETER NoUpdate
Do not run paket.exe so as not to update packages if set, otherwise do.
.PARAMETER Build
Build Funcy.sln if set, otherwise not.
.PARAMETER Test
Test Funcy.Test.dll with Persimmon.Console if set, otherwise not.
#>
Param(
[switch]$NoUpdate,
[switch]$Build,
[switch]$Test
)
begin
{
function Check-Parameter
{
return $Build -or $Test
}
function Write-Usage
{
Write-Output " Usage
fbt.ps1 [-NoUpdate] [-Build] [-Test]
"
}
if (-not (Check-Parameter))
{
Write-Usage
exit 0
}
$env:Path = $env:MSBUILD_HOME + ";" + $env:Path
}
process
{
if(-not $NoUpdate)
{
.paket/paket.bootstrapper.exe
if (-not $?)
{
exit $LASTEXITCODE
}
.paket/paket.exe update
if (-not $?)
{
exit $LASTEXITCODE
}
}
if ($Build)
{
# It may be necessary for you to add a path to MSBuild to $env:PATH.
MSBuild.exe .\Funcy.sln /p:Configuration=Debug /p:Platform="Any CPU" /v:minimal
if (-not $?)
{
exit $LASTEXITCODE
}
}
if ($Test)
{
.\packages\Persimmon.Console\tools\Persimmon.Console.exe .\Funcy.Test\bin\Debug\Funcy.Test.dll
if (-not $?)
{
exit $LASTEXITCODE
}
}
}