Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

NDepend F# make

View ndepend.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
module Fake.NDepend
 
open Fake
open System
open System.IO
open System.Text
 
let getWorkingDir workingDir =
Seq.find isNotNullOrEmpty [workingDir; environVar("teamcity.build.workingDir"); "."]
|> Path.GetFullPath
 
let buildParamsAndExecute parameters buildArguments toolPath workingDir =
let args = buildArguments parameters
trace (toolPath + " " + args)
let result = ExecProcess (fun info ->
info.FileName <- toolPath
info.WorkingDirectory <- getWorkingDir workingDir
info.Arguments <- args) TimeSpan.MaxValue
if result <> 0 then failwithf "Error running %s" toolPath
type NDependParams =
{ ToolPath: string
WorkingDir: string
ProjectFile: string
CoverageFiles: string list }
 
let NDependDefaults =
{ ToolPath = findToolInSubPath "ndepend.console.exe" (currentDirectory @@ "tools" @@ "NDepend")
WorkingDir = ""
ProjectFile = ""
CoverageFiles = [] }
 
let buildNDependArgs parameters =
new StringBuilder()
|> append parameters.ProjectFile
|> appendWithoutQuotes "/CoverageFiles "
|> appendFileNamesIfNotNull parameters.CoverageFiles
|> toText
 
let NDepend (setParams: NDependParams -> NDependParams) =
let parameters = (NDependDefaults |> setParams)
buildParamsAndExecute parameters buildNDependArgs parameters.ToolPath parameters.WorkingDir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.