Skip to content

Commit f8ea068

Browse files
committed
restore
1 parent b543788 commit f8ea068

File tree

2 files changed

+159
-155
lines changed

2 files changed

+159
-155
lines changed

vsintegration/tests/Salsa/salsa.fs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -186,23 +186,27 @@ module internal Salsa =
186186

187187
/// Compute the Flags and Sources
188188
let GetFlagsAndSources(project:Project, host:HostCompile) : BuildFlags =
189-
use _ = host.CaptureSourcesAndFlagsWithoutBuildingForABit()
190-
project.IsBuildEnabled <- true
191-
// Always invoke CoreCompile directly (host object registered there)
192-
let loggers = seq { yield (new Microsoft.Build.Logging.ConsoleLogger(LoggerVerbosity.Minimal) :> ILogger) }
193-
let _ = project.Build("CoreCompile", loggers) |> ignore
194-
let capturedFlags, capturedSources = host.Results
195-
let raw =
196-
if isNull capturedFlags || isNull capturedSources then
197-
// Fallback if the host wasn't invoked (e.g. up-to-date skip or custom targets)
198-
GetFlagsAndSourcesFallback project
189+
let result =
190+
use xx = host.CaptureSourcesAndFlagsWithoutBuildingForABit()
191+
project.IsBuildEnabled <- true
192+
193+
let loggers = seq { yield (new Microsoft.Build.Logging.ConsoleLogger(LoggerVerbosity.Detailed) :> ILogger) }
194+
195+
let r = project.Build("Compile", loggers)
196+
if not(r) then
197+
printfn "MSBuild result: %A" r
198+
printfn "%s" project.FullPath
199+
System.Diagnostics.Debug.Assert(false, "things are about to fail, as MSBuild failed; it would behoove you to turn on MSBuild tracing")
200+
let capturedFlags, capturedSources = host.Results
201+
{flags = capturedFlags |> Array.toList
202+
sources = capturedSources |> Array.toList }
203+
let Canonicalize (fileName:string) =
204+
if System.IO.Path.IsPathRooted(fileName) then
205+
System.IO.Path.GetFullPath(fileName)
199206
else
200-
{ flags = capturedFlags |> Array.toList; sources = capturedSources |> Array.toList }
201-
// Canonicalize source paths
202-
let canonicalize (fileName:string) =
203-
if Path.IsPathRooted(fileName) then Path.GetFullPath(fileName)
204-
else Path.GetFullPath(Path.Combine(Path.GetDirectoryName(project.FullPath), fileName))
205-
{ flags = raw.flags; sources = raw.sources |> List.map canonicalize }
207+
System.IO.Path.GetFullPath(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(project.FullPath),fileName))
208+
{ flags = result.flags
209+
sources = result.sources |> List.map Canonicalize }
206210

207211
let CrackProject(projectFileName, configuration, platform) =
208212

0 commit comments

Comments
 (0)