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