File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?vi
2727 </Target >
2828
2929 <!-- Make sure that files are formatted before building -->
30- <Target Name =" Format "
30+ <Target Name =" FormatFSharp "
3131 Condition =" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' "
32- BeforeTargets = " BeforeBuild " Inputs =" @(Compile)" Outputs =" $(_DotnetFantomasOutputFile)" >
33- <Exec Command =" dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance =" High "
32+ Inputs =" @(Compile)" Outputs =" $(_DotnetFantomasOutputFile)" >
33+ <Exec Command =" dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance =" Normal "
3434 StandardErrorImportance =" High" WorkingDirectory =" $(MSBuildThisFileDirectory)"
3535 ContinueOnError =" WarnAndContinue" />
3636 <Touch Files =" $(_DotnetFantomasOutputFile)" AlwaysCreate =" True" ForceTouch =" True" />
@@ -39,4 +39,18 @@ https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?vi
3939 </ItemGroup >
4040 </Target >
4141
42+ <!-- Only format once per project -->
43+ <!-- https://learn.microsoft.com/en-us/visualstudio/msbuild/run-target-exactly-once?view=vs-2022 -->
44+ <Target Name =" FormatFSharpBeforeOuterBuild"
45+ DependsOnTargets =" FormatFSharp"
46+ BeforeTargets =" DispatchToInnerBuilds"
47+ />
48+
49+ <Target Name =" FormatFSharpBeforeInnerBuild"
50+ BeforeTargets =" BeforeBuild" >
51+ <MSBuild Projects =" $(MSBuildProjectFullPath)"
52+ Targets =" FormatFSharp"
53+ RemoveProperties =" TargetFramework" />
54+ </Target >
55+
4256</Project >
You can’t perform that action at this time.
0 commit comments