Skip to content

Commit

Permalink
A little cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Oct 30, 2020
1 parent e7582eb commit 98abb3c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 3.0.2
# 3.1.0

- Added `SourceFiles` and `References` for F# projects (#146, thanks @dukedagmor)
- Fixed an inconsistency between Buildalyzer and MSBuild by adding a trailing directory separator to the solution path (#147, #148, thanks @laurenceSaes)

# 3.0.1

Expand Down
2 changes: 1 addition & 1 deletion src/Buildalyzer/Logging/EventProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private void MessageRaised(object sender, BuildMessageEventArgs e)
{
// Process the command line arguments for the Fsc task
AnalyzerResult result = _currentResult.Count == 0 ? null : _currentResult.Peek();
if (e.SenderName.Equals("Fsc", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(e.Message) && _targetStack.Any(x => x.TargetName == "CoreCompile") && _currentResult.Count != 0)
if (e.SenderName?.Equals("Fsc", StringComparison.OrdinalIgnoreCase) == true && !string.IsNullOrWhiteSpace(e.Message) && _targetStack.Any(x => x.TargetName == "CoreCompile") && _currentResult.Count != 0)
{
result.ProcessFscCommandLine(e.Message);
}
Expand Down
6 changes: 6 additions & 0 deletions src/Buildalyzer/ProjectAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ private string GetCommand(BuildEnvironment buildEnvironment, string targetFramew
// Setting the TargetFramework MSBuild property tells MSBuild which target framework to use for the outer build
effectiveGlobalProperties[MsBuildProperties.TargetFramework] = targetFramework;
}
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);
}
string propertyArgument = effectiveGlobalProperties.Count == 0 ? string.Empty : $"/property:{string.Join(";", effectiveGlobalProperties.Select(x => $"{x.Key}={FormatArgument(x.Value)}"))}";

// Get the target argument (/target)
Expand Down

0 comments on commit 98abb3c

Please sign in to comment.