forked from mathnet/mathnet-numerics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
148 lines (103 loc) · 3.95 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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
// --------------------------------------------------------------------------------------
// FAKE build script, see http://fsharp.github.io/FAKE
// --------------------------------------------------------------------------------------
#I @"packages/FAKE/tools"
#r @"packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.DocuHelper
open System
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
// PREPARE
Target "Start" DoNothing
Target "Clean" (fun _ -> CleanDirs ["out"; "obj"; "temp"])
Target "RestorePackages" RestorePackages
Target "AssemblyInfo" DoNothing
Target "Prepare" DoNothing
"Start"
=?> ("Clean", not (hasBuildParam "incremental"))
==> "RestorePackages"
==> "AssemblyInfo"
==> "Prepare"
// BUILD
let build subject = MSBuildRelease "" (if hasBuildParam "incremental" then "Build" else "Rebuild") subject |> ignore
Target "BuildMain" (fun _ -> build !! "MathNet.Numerics.sln")
Target "BuildNet35" (fun _ -> build !! "MathNet.Numerics.Net35Only.sln")
Target "BuildFull" (fun _ -> build !! "MathNet.Numerics.Portable.sln")
Target "Build" DoNothing
"Prepare"
=?> ("BuildNet35", hasBuildParam "net35")
=?> ("BuildFull", hasBuildParam "full")
=?> ("BuildMain", not (hasBuildParam "full" || hasBuildParam "net35"))
==> "Build"
// NATIVE BUILD
let buildx86 subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [("Configuration","Release"); ("Platform","Win32")] subject |> ignore
let buildx64 subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [("Configuration","Release"); ("Platform","x64")] subject |> ignore
Target "BuildNativex86" (fun _ -> buildx86 !! "MathNet.Numerics.NativeProviders.sln")
Target "BuildNativex64" (fun _ -> buildx64 !! "MathNet.Numerics.NativeProviders.sln")
Target "BuildNative" DoNothing
"Prepare" ==> "BuildNativex86" ==> "BuildNative"
"Prepare" ==> "BuildNativex64" ==> "BuildNative"
// TEST
Target "Test" (fun _ ->
!! "out/test/**/*UnitTests*.dll"
|> NUnit (fun p ->
{ p with
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 30.
OutputFile = "TestResults.xml" }))
"Build" ==> "Test"
// NATIVE TEST
Target "TestNativex86" (fun _ ->
!! "out/MKL/Windows/x86/*UnitTests*.dll"
|> NUnit (fun p ->
{ p with
ToolName = "nunit-console-x86.exe"
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 30.
OutputFile = "TestResults.xml" }))
Target "TestNativex64" (fun _ ->
!! "out/MKL/Windows/x64/*UnitTests*.dll"
|> NUnit (fun p ->
{ p with
DisableShadowCopy = true
TimeOut = TimeSpan.FromMinutes 30.
OutputFile = "TestResults.xml" }))
Target "TestNative" DoNothing
"BuildNativex86" ==> "TestNativex86" ==> "TestNative"
"BuildNativex64" ==> "TestNativex64" ==> "TestNative"
// DOCUMENTATION
Target "CleanDocs" (fun _ -> CleanDirs ["out" @@ "docs"])
Target "Docs" (fun _ ->
executeFSIWithArgs "docs/tools" "build-docs.fsx" ["--define:RELEASE"] [] |> ignore
)
Target "DocsDev" (fun _ ->
executeFSIWithArgs "docs/tools" "build-docs.fsx" [] [] |> ignore
)
"Build" ==> "Docs"
"Start"
=?> ("CleanDocs", not (hasBuildParam "incremental"))
==> "DocsDev"
// API REFERENCE
Target "CleanApi" (fun _ -> CleanDirs ["out" @@ "api"])
Target "Api" (fun _ ->
!! "out/lib/Net40/MathNet.Numerics.dll"
|> Docu (fun p ->
{ p with
ToolPath = "tools/docu/docu.exe"
TemplatesPath = "tools/docu/templates/"
TimeOut = TimeSpan.FromMinutes 10.
OutputPath = "out/api/" }))
// NUGET
Target "NuGet" (fun _ ->
// TODO: Replace with FAKE's internal NuGet support and drop the MSBuild project
!! "build/NuGet/nuget.proj" |> MSBuild "" "BuildPackages" [] |> ignore
)
"BuildFull" ==> "NuGet"
// RUN
Target "Release" DoNothing
"Test" ==> "Release"
"Docs" ==> "Release"
"NuGet" ==> "Release"
Target "All" DoNothing
"Build" ==> "Test" ==> "All"
RunTargetOrDefault "All"