-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
86 lines (58 loc) · 1.81 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
#r @"packages/Fake/tools/FakeLib.dll"
#r @"packages\FSharp.Management\lib\net40\FSharp.Management.dll"
open System
open System.IO
open System.Diagnostics
open FSharp.Management
open Fake
open Fake.MSBuildHelper
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let (+/) path1 path2 = Path.Combine(path1, path2)
let argstr ls = String.concat " " ls
let run cmd args =
let pinfo = ProcessStartInfo cmd
pinfo.RedirectStandardOutput <- true
pinfo.UseShellExecute <- false
pinfo.Arguments <- args
let proc = System.Diagnostics.Process.Start (pinfo)
proc.WaitForExit()
let inline quote str = String.Concat["\"";str;"\""]
let PathName path = FullName path |> quote
type Relative = RelativePath<".",true>
let solutionFile = Relative.``src-fs``.``UnityEditorFs.sln``
let editorLibs = Relative.Assets.Editor.Path
let gizmoDir = Relative.Assets.Gizmos.Path
Target "Clean"( fun _ ->
trace "Cleaning up detritus"
CleanDirs ["src-fs/UnityEditorFs/bin";"src-fs/UnityEditorFs/temp"]
)
Target "Trace"( fun _ ->
trace "I'd rather FAKE it than MAKE it"
)
Target "Build"( fun _ ->
trace "Building project files"
!! solutionFile
|> MSBuildRelease "" "Rebuild"
|> ignore
)
Target "EditorClean"( fun _ ->
trace "Cleaning Extension dlls from Assets/Editor"
CleanDir editorLibs
)
Target "EditorExt"( fun _ ->
trace "Building project files for Unity Engine"
!! solutionFile
|> MSBuildRelease "" "Rebuild"
// |> MSBuildRelease ("Assets"+/"libs") "Rebuild"
|> ignore
!! "src-fs/UnityEditorFs/bin/Release/*.dll"
|> CopyFiles editorLibs
)
"Clean"
==> "Build"
"EditorClean"
==> "EditorExt"
let argvs = fsi.CommandLineArgs
match argvs.Length with
| 1 -> RunTargetOrDefault "Build"
| _ -> RunTargetOrDefault argvs.[1]