-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
49 lines (39 loc) · 1.11 KB
/
build.fsx
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
// include Fake lib
#r @"packages/FAKE/tools/Nuget.Core.dll"
#r @"packages/FAKE/tools/FakeLib.dll"
open Fake
CreateDir "Build"
Target "NugetRestore" (fun _ ->
RestorePackages()
)
Target "BuildApp" (fun _ ->
!! "Source/CSharpWarrior.Web.Host/CSharpWarrior.Web.Host.csproj"
|> MSBuildRelease "" "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTest" (fun _ ->
!! "Test/**/*.csproj"
|> MSBuildRelease "" "Build"
|> Log "TestBuild-Output: "
)
Target "Test" (fun _ ->
!! "Test/**/bin/Release/*.Test.dll"
|> NUnit (fun p -> { p with OutputFile = "Build/TestResults.xml" })
)
Target "NpmRestore" (fun _ ->
let exitCode = Shell.Exec("npm", "install")
trace(exitCode.ToString())
if exitCode <> 0 then failwithf "npm install failed: %i" exitCode
)
Target "WatchTypeScript" (fun _ ->
let exitCode = Shell.Exec("grunt", "watch")
trace(exitCode.ToString())
if exitCode <> 0 then failwithf "grunt watch failed: %i" exitCode
)
"NugetRestore"
==> "BuildApp"
<=> "BuildTest"
==> "Test"
"NpmRestore"
==> "WatchTypeScript"
RunTargetOrDefault "Test"