-
-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup FAKE build for netframework and netcore
- Loading branch information
1 parent
28b924d
commit 595e18c
Showing
1 changed file
with
55 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |