Remove AnalyzeFSharpProjectUsingFscArgs #164
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alas, I must shatter my dream of reusing the
fsc
arguments provided by MSBuild.I noticed some drawbacks when doing a
DesignTimeBuild
for projects that have project references.Let us take
Fantomas.Client.fsproj
andFantomas.Client.Tests.fsproj
as example:Fantomas.Client.Tests.fsproj
will trigger a build forFantomas.Client.fsproj
as well. However, this won't produce a binary forFantomas.Client
, whileFantomas.Client.Tests
does depend on its existence from the fsc args perspective.Fantomas.Client.Tests
already builtFantomas.Client
(without producing a binary),CoreCompile
will be skipped when we try and do the design time build forFantomas.Core
and thusFscCommandLineArgs
will not be populated. I believe this to be a larger problem in theFSharpTargets
but I digress.So in short, the idea of reusing
FscCommandLineArgs
from MSBuild only works when:CoreCompile
of the current project is not skipped.Initially, we did a full build of
fantomas.sln
before invoking the targets, which helps with the dependent projects having binaries. But doesn't help thatCoreCompile
is being skipped.I don't see a scenario where we can have the best of both worlds, so I recommend we stick to
AnalyzeFSharpProject
and keep usingproj-info
to crack the projects.That being said, I do still see a use-case for
--fsc-args
as cli parameter input. This can be great for debugging and exploring.