phmonte / Buildalyzer

A utility to perform design-time builds of .NET projects without having to think too hard about it.
MIT License
593 stars 94 forks source link

F# support broken šŸ˜„ (I am sorry) #151

Closed dukedagmor closed 3 years ago

dukedagmor commented 3 years ago

if (Path.GetExtension(ProjectFile.Path).Equals(".fsproj", StringComparison.OrdinalIgnoreCase) && effectiveGlobalProperties.ContainsKey(MsBuildProperties.SkipCompilerExecution)) { // We can't skip the compiler for design-time builds in F# (it causes strange errors regarding file copying) effectiveGlobalProperties.Remove(MsBuildProperties.SkipCompilerExecution); } Got added after I deleted it to fast while working on F#. This however leads to extra BuildMessageEventArgs being triggered since the full compiling diagnostic/logging is triggered.

Because there is no TaskCommandLineEventArgs for F# I created a big if statement to serve as a check. This if statement missed something, I did not know of this since I tested without the extra logging from SkipCompilerExecution.

in short: F# support (sourcefiles and references) is broken, I already made a fix :) check PRs

What does the fix do? -add extra check if _fscArguments already contains data, since only the first BuildMessageEventArgs to pass my checks contains the data we want.

How debugging went: I printed all BuildMessageEventArgs senders and messages. With SkipCompilerExecution I would expect 1 event. There are however multiple, all from the Fsc process, this leads to _fscArguments being overridden with the new data. In this example that would be: ["","The command exited with code 1."] No worries, fix is available :)

image

daveaglick commented 3 years ago

Sorry it took so long to get back to this! I'm merging it in now, thanks a lot for staying on top of the F# support.

daveaglick commented 3 years ago

Merged and prepping for release