-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.fsx
55 lines (47 loc) · 1.48 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
50
51
52
53
54
55
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.NpmHelper
let buildDir = "./build"
let testDir = "./tests"
let clientDir = "./client"
let clientAssetDir = clientDir @@ "public"
let assetBuildDir = buildDir @@ "public"
Target "Clean" (fun _ -> CleanDirs [buildDir; testDir; clientAssetDir; assetBuildDir])
Target "BuildApp" (fun _ ->
!! "src/**/*.fsproj"
-- "src/**/*.Tests.fsproj"
|> MSBuildRelease buildDir "Build"
|> Log "AppBuild-Output: "
)
Target "BuildTests" (fun _ ->
!! "src/**/*.Tests.fsproj"
|> MSBuildDebug testDir "Build"
|> Log "BuildTests-Output: "
)
Target "RunUnitTests" (fun _ ->
!! (testDir + "/*.Tests.dll")
|> NUnit (fun p ->
{p with ToolPath = "packages/NUnit.Runners/tools/"})
)
Target "Client" (fun _ ->
let npmFilePath = environVarOrDefault "NPM_FILE_PATH" defaultNpmParams.NpmFilePath
Npm (fun p ->
{ p with
Command = Install Standard
WorkingDirectory = clientDir
NpmFilePath = npmFilePath
})
Npm (fun p ->
{ p with
Command = (Run "build")
WorkingDirectory = clientDir
NpmFilePath = npmFilePath
})
CopyRecursive clientAssetDir assetBuildDir true |> ignore
)
"Clean"
==> "BuildApp"
==> "BuildTests"
==> "RunUnitTests"
==> "Client"
RunTargetOrDefault "Client"