@@ -119,42 +119,45 @@ module Tooling =
119119 member this.Path = Paths.Tool( path)
120120 member this.Exec arguments = exec this.Path arguments
121121
122- let private dotTraceCommandLineTools = " JetBrains.dotTrace.CommandLineTools.10.0.20151114.191633"
123- let private buildToolsDirectory = Paths.Build( " tools" )
124- let private dotTraceDirectory = sprintf " %s /%s " buildToolsDirectory dotTraceCommandLineTools
125-
126- if ( Directory.Exists( dotTraceDirectory) = false )
127- then
128- trace ( sprintf " No JetBrains DotTrace tooling found in %s . Downloading now" buildToolsDirectory)
129- let url = sprintf " https://d1opms6zj7jotq.cloudfront.net/resharper/%s .zip" dotTraceCommandLineTools
130- let zipFile = sprintf " %s /%s .zip" buildToolsDirectory dotTraceCommandLineTools
131- use webClient = new WebClient()
132- webClient.DownloadFile( url, zipFile)
133- System.IO.Compression.ZipFile.ExtractToDirectory( zipFile, dotTraceDirectory)
134- File.Delete zipFile
135- trace " JetBrains DotTrace tooling downloaded"
136-
137- let NugetFile = " build/tools/nuget/nuget.exe"
138- if ( File.Exists( NugetFile) = false )
139- then
140- trace " Nuget not found %s . Downloading now"
141- let url = " http://nuget.org/nuget.exe"
142- Directory.CreateDirectory( " build/tools/nuget" ) |> ignore
143- use webClient = new WebClient()
144- webClient.DownloadFile( url, NugetFile)
145- trace " nuget downloaded"
146-
147- type ProfilerTooling ( path ) =
122+ let NugetFile = fun _ ->
123+ let targetLocation = " build/tools/nuget/nuget.exe"
124+ if ( not ( File.Exists targetLocation))
125+ then
126+ trace " Nuget not found %s . Downloading now"
127+ let url = " http://nuget.org/nuget.exe"
128+ Directory.CreateDirectory( " build/tools/nuget" ) |> ignore
129+ use webClient = new WebClient()
130+ webClient.DownloadFile( url, targetLocation)
131+ trace " nuget downloaded"
132+ targetLocation
133+
134+ type ProfilerTooling ( path ) =
135+ let dotTraceCommandLineTools = " JetBrains.dotTrace.CommandLineTools.10.0.20151114.191633"
136+ let buildToolsDirectory = Paths.Build( " tools" )
137+ let dotTraceDirectory = sprintf " %s /%s " buildToolsDirectory dotTraceCommandLineTools
138+ member this.Bootstrap = fun _ ->
139+ if ( not ( Directory.Exists dotTraceDirectory)) then
140+ trace ( sprintf " No JetBrains DotTrace tooling found in %s . Downloading now" buildToolsDirectory)
141+ let url = sprintf " https://d1opms6zj7jotq.cloudfront.net/resharper/%s .zip" dotTraceCommandLineTools
142+ let zipFile = sprintf " %s /%s .zip" buildToolsDirectory dotTraceCommandLineTools
143+ use webClient = new WebClient()
144+ webClient.DownloadFile( url, zipFile)
145+ System.IO.Compression.ZipFile.ExtractToDirectory( zipFile, dotTraceDirectory)
146+ File.Delete zipFile
147+ trace " JetBrains DotTrace tooling downloaded"
148+
148149 member this.Path = sprintf " %s /%s " dotTraceDirectory path
149- member this.Exec arguments = exec this.Path arguments
150+ member this.Exec arguments =
151+ this.Bootstrap()
152+ exec this.Path arguments
150153
151154 let GitLink = new NugetTooling( " GitLink" , " gitlink/lib/net45/gitlink.exe" )
152155 let Node = new NugetTooling( " node.js" , " Node.js/node.exe" )
153156 let private npmCli = " Npm/node_modules/npm/cli.js"
154157 let Npm = new NugetTooling( " npm" , npmCli)
155158 let XUnit = new NugetTooling( " xunit.runner.console" , " xunit.runner.console/tools/xunit.console.exe" )
156159 let DotTraceProfiler = new ProfilerTooling( " ConsoleProfiler.exe" )
157- let DotTraceReporter = new ProfilerTooling( " Reporter.exe" )
160+ let DotTraceReporter = new ProfilerTooling( " Reporter.exe" )
158161 let DotTraceSnapshotStats = new ProfilerTooling( " SnapshotStat.exe" )
159162
160163 //only used to boostrap fake itself
0 commit comments