11#I @" packages/FAKE/tools"
2+ #I @" packages/FAKE.BuildLib/lib/net451"
23#r " FakeLib.dll"
4+ #r " BuildLib.dll"
35
46open Fake
5- open Fake.FileHelper
6- open Fake.ProcessHelper
7- open Fake.ZipHelper
7+ open BuildLib
88
9- // ------------------------------------------------------------------------------ Project
9+ let solution =
10+ initSolution
11+ " ./IncrementalCompiler.sln" " Release"
12+ [ ]
1013
11- let buildSolutionFile = " ./IncrementalCompiler.sln"
12- let buildConfiguration = " Release"
13-
14- // ---------------------------------------------------------------------------- Variables
14+ Target " Clean" <| fun _ -> cleanBin
1515
16- let binDir = " bin"
17- let testDir = binDir @@ " test"
16+ Target " Restore" <| fun _ -> restoreNugetPackages solution
1817
19- // ------------------------------------------------------------------------------ Targets
18+ Target " Build " <| fun _ -> buildSolution solution
2019
21- Target " Clean" ( fun _ ->
22- CleanDirs [ binDir]
23- )
24-
25- Target " Build" ( fun _ ->
26- !! buildSolutionFile
27- |> MSBuild " " " Rebuild" [ " Configuration" , buildConfiguration ]
28- |> Log " Build-Output: "
29- )
30-
31- Target " Package" ( fun _ ->
20+ Target " Package" ( fun _ ->
3221 // pack IncrementalCompiler.exe with dependent module dlls to packed one
33- Shell.Exec( " ./packages/ILRepack/tools/ILRepack.exe" ,
22+ let ilrepackExe = ( getNugetPackage " ILRepack" " 2.0.9" ) @@ " tools" @@ " ILRepack.exe"
23+ Shell.Exec( ilrepackExe,
3424 " /wildcards /out:IncrementalCompiler.packed.exe IncrementalCompiler.exe *.dll" ,
35- " ./core/IncrementalCompiler/bin/Release" )
25+ " ./core/IncrementalCompiler/bin/Release" ) |> ignore
3626 // fix roslyn compiler to work well with UnityVS
3727 Shell.Exec( " ./core/RoslynCompilerFix/bin/Release/RoslynCompilerFix.exe" ,
3828 " IncrementalCompiler.packed.exe IncrementalCompiler.packed.fixed.exe" ,
39- " ./core/IncrementalCompiler/bin/Release" )
29+ " ./core/IncrementalCompiler/bin/Release" ) |> ignore
4030 // let's make package
4131 for target in [ " Unity4" ; " Unity5" ] do
4232 let targetDir = binDir @@ target
@@ -58,21 +48,13 @@ Target "Package" (fun _ ->
5848 !! ( targetDir @@ " **" ) |> Zip targetDir ( binDir @@ " IncrementalCompiler." + target + " .zip" )
5949)
6050
61- Target " Help" ( fun _ ->
62- List.iter printfn [
63- " usage:"
64- " build [target]"
65- " "
66- " Targets for building:"
67- " * Build Build"
68- " * Package Make packages"
69- " " ]
70- )
71-
72- // --------------------------------------------------------------------------- Dependency
51+ Target " Help" <| fun _ ->
52+ showUsage solution ( fun name ->
53+ if name = " package" then Some( " Build package" , " " )
54+ else None)
7355
74- // Build order
7556" Clean"
57+ ==> " Restore"
7658 ==> " Build"
7759 ==> " Package"
7860
0 commit comments