File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?vi
2424 </Target >
2525
2626 <!-- Make sure that files are formatted before building -->
27- <Target Name =" Format "
27+ <Target Name =" FormatFSharp "
2828 Condition =" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' "
2929 BeforeTargets =" BeforeBuild" Inputs =" @(Compile)" Outputs =" $(_DotnetFantomasOutputFile)" >
3030 <Exec Command =" dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance =" High"
@@ -33,4 +33,18 @@ https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-directory?vi
3333 <Touch Files =" $(_DotnetFantomasOutputFile)" AlwaysCreate =" True" ForceTouch =" True" />
3434 </Target >
3535
36+ <!-- Only format once per project -->
37+ <!-- https://learn.microsoft.com/en-us/visualstudio/msbuild/run-target-exactly-once?view=vs-2022 -->
38+ <Target Name =" FormatFSharpBeforeOuterBuild"
39+ DependsOnTargets =" FormatFSharp"
40+ BeforeTargets =" DispatchToInnerBuilds"
41+ />
42+
43+ <Target Name =" FormatFSharpBeforeInnerBuild"
44+ BeforeTargets =" BeforeBuild" >
45+ <MSBuild Projects =" $(MSBuildProjectFullPath)"
46+ Targets =" FormatFSharp"
47+ RemoveProperties =" TargetFramework" />
48+ </Target >
49+
3650</Project >
You can’t perform that action at this time.
0 commit comments