File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,24 @@ See https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-by-director
2323 </Target >
2424
2525 <!-- Make sure that files are formatted before building -->
26- <Target Name =" Format " Condition =" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' " BeforeTargets =" BeforeBuild" Inputs =" @(Compile)" Outputs =" $(_DotnetFantomasOutputFile)" >
26+ <Target Name =" FormatFSharp " Condition =" '$(MSBuildProjectExtension)' == '.fsproj' AND '$(DesignTimeBuild)' != 'true' " BeforeTargets =" BeforeBuild" Inputs =" @(Compile)" Outputs =" $(_DotnetFantomasOutputFile)" >
2727 <Exec Command =" dotnet fantomas $(MSBuildProjectDirectory)" StandardOutputImportance =" High" StandardErrorImportance =" High" WorkingDirectory =" $(MSBuildThisFileDirectory)" ContinueOnError =" WarnAndContinue" />
2828 <Touch Files =" $(_DotnetFantomasOutputFile)" AlwaysCreate =" True" ForceTouch =" True" />
2929 </Target >
3030
31+ <!-- Only format once per project -->
32+ <!-- https://learn.microsoft.com/en-us/visualstudio/msbuild/run-target-exactly-once?view=vs-2022 -->
33+ <Target Name =" FormatFSharpBeforeOuterBuild"
34+ DependsOnTargets =" FormatFSharp"
35+ BeforeTargets =" DispatchToInnerBuilds"
36+ />
37+
38+ <Target Name =" FormatFSharpBeforeInnerBuild"
39+ BeforeTargets =" BeforeBuild" >
40+ <MSBuild Projects =" $(MSBuildProjectFullPath)"
41+ Targets =" FormatFSharp"
42+ RemoveProperties =" TargetFramework" />
43+ </Target >
44+
45+
3146</Project >
You can’t perform that action at this time.
0 commit comments