Skip to content

Commit

Permalink
setup FAKE build for netframework and netcore
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudRoutine committed Dec 1, 2016
1 parent 28b924d commit 595e18c
Showing 1 changed file with 55 additions and 7 deletions.
62 changes: 55 additions & 7 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,66 @@
#I @"packages/build/FAKE/tools/"
#r @"FakeLib.dll"

System.IO.Directory.SetCurrentDirectory __SOURCE_DIRECTORY__
open System
open Fake

let solutionFile = "Expecto"


let run cmd args dir =
if execProcess( fun info ->
info.FileName <- cmd
if not( String.IsNullOrWhiteSpace dir) then
info.WorkingDirectory <- dir
info.Arguments <- args
) System.TimeSpan.MaxValue = false then
failwithf "Error while running '%s' with args: %s" cmd args


// --------------------------------------------------------------------------------------
// Clean Build Detritus

Target "Clean" (fun _ ->
!! "/**/bin/"
++ "/**/obj/"
|> CleanDirs
|> ignore
)


// --------------------------------------------------------------------------------------
// Build library, test project, & sample

let solutionFile = "Expecto"

Target "Build" (fun _ ->
// We would like to build only one solution
!! (solutionFile + ".sln")
|> MSBuildRelease "" "Rebuild"
|> ignore
!! (solutionFile + ".sln")
|> MSBuildRelease "" "Rebuild"
|> ignore
)

RunTargetOrDefault "Build"

// --------------------------------------------------------------------------------------
// Build netcore expecto library

let netcoreDir = "Expecto.netcore"
let dotnet args dir = run "dotnet" args dir

Target "DotnetBuild" (fun _ ->
dotnet "restore" netcoreDir
dotnet "build" netcoreDir
)


// --------------------------------------------------------------------------------------
// Target Dependencies

Target "All" DoNothing

"Clean"
==> "Build"
<=> "DotnetBuild"

"Build" ==> "All"
"DotnetBuild" ==> "All"

RunTargetOrDefault "All"

0 comments on commit 595e18c

Please sign in to comment.