Skip to content

Commit b08afc5

Browse files
authored
Revert "Beforecompile (#17057)" (#17099)
This reverts commit 7e1b266.
1 parent 7906f6c commit b08afc5

File tree

4 files changed

+6
-86
lines changed

4 files changed

+6
-86
lines changed

src/FSharp.Build/Microsoft.FSharp.Targets

+5-27
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ this file.
235235
</FSharpEmbedResXSource>
236236

237237
<ItemGroup>
238-
<Compile Include="@(_FsGeneratedResXSource)" CompileOrder="CompileBefore" />
238+
<CompileBefore Include="@(_FsGeneratedResXSource)" />
239239
<FsGeneratedSource Include="@(_FsGeneratedResXSource)" />
240240
<FileWrites Include="@(_FsGeneratedResXSource)" />
241241
</ItemGroup>
@@ -247,35 +247,14 @@ this file.
247247
</FSharpEmbedResourceText>
248248

249249
<ItemGroup>
250-
<Compile Include="@(_FsGeneratedTxtSource)" CompileOrder="CompileBefore" />
250+
<CompileBefore Include="@(_FsGeneratedTxtSource)" />
251251
<FsGeneratedSource Include="@(_FsGeneratedTxtSource)" />
252252
<EmbeddedResource Include="@(_FsGeneratedResx)" />
253253
<FileWrites Include="@(_FsGeneratedTxtSource)" />
254254
<FileWrites Include="@(_FsGeneratedResx)" />
255255
</ItemGroup>
256256
</Target>
257257

258-
<Target Name="FSharpSourceCodeCompileOrder">
259-
<!-- implement <CompileOrder>CompileBefore</CompileOrder> -->
260-
<ItemGroup>
261-
<__Sources Remove="@(__Sources)" />
262-
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileFirst'))" />
263-
<__Sources Include="@(CompileBefore)" />
264-
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileBefore'))" />
265-
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', ''))" />
266-
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileAfter'))" />
267-
<__Sources Include="@(CompileAfter)" />
268-
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileLast'))" />
269-
</ItemGroup>
270-
<ItemGroup>
271-
<Compile Remove="@(Compile)" />
272-
<CompileBefore Remove="@(CompileBefore)" />
273-
<CompileAfter Remove="@(CompileAfter)" />
274-
<Compile Include="@(__Sources)" />
275-
</ItemGroup>
276-
<Message Importance="low" Text="FSharpSourceCodeCompileOrder:Sources: '@(__Sources)'" />
277-
</Target>
278-
279258
<Target
280259
Name="CoreCompile"
281260
Inputs="$(MSBuildAllProjects);
@@ -305,7 +284,7 @@ this file.
305284
$(NonExistentFile);
306285
@(CustomAdditionalCompileOutputs)"
307286
Returns="@(FscCommandLineArgs)"
308-
DependsOnTargets="$(CoreCompileDependsOn);FSharpSourceCodeCompileOrder"
287+
DependsOnTargets="$(CoreCompileDependsOn)"
309288
>
310289

311290
<Error
@@ -342,7 +321,6 @@ this file.
342321
<EmbeddedFiles Include="@(FsGeneratedSource)" KeepDuplicates="false" Condition="'$(SourceLink)'!='' or '$(EmbeddedFiles)'!='' or '$(EmbedAllSources)'!=''" />
343322
</ItemGroup>
344323

345-
346324
<!-- Dotnet SDK requires SimpleResolution to be true Legacy project system build not -->
347325
<PropertyGroup>
348326
<FscOtherFlags Condition="'$(SimpleResolution)' == 'true'">--simpleresolution $(OtherFlags)</FscOtherFlags>
@@ -393,7 +371,7 @@ this file.
393371
Resources="@(ActualEmbeddedResources)"
394372
SkipCompilerExecution="$(SkipCompilerExecution)"
395373
SourceLink="$(SourceLink)"
396-
Sources="@(Compile)"
374+
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
397375
SubsystemVersion="$(SubsystemVersion)"
398376
Tailcalls="$(Tailcalls)"
399377
TargetType="$(OutputType)"
@@ -456,7 +434,7 @@ this file.
456434
Overwrite="true"/>
457435

458436
<ItemGroup Condition="'$(AdditionalSourcesText)' != ''">
459-
<Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"><CompileOrder>CompileBefore</CompileOrder></Compile>
437+
<CompileBefore Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
460438
<_FsGeneratedTfmAttributesSource Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
461439
</ItemGroup>
462440
</Target>

src/FSharp.Core/FSharp.Core.fsproj

-13
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,12 @@
6161
</EmbeddedResource>
6262
<EmbeddedResource Include="ILLink.LinkAttributes.xml" LogicalName="ILLink.LinkAttributes.xml" />
6363
<EmbeddedResource Include="ILLink.Substitutions.xml" LogicalName="ILLink.Substitutions.xml" />
64-
</ItemGroup>
65-
<ItemGroup Condition="'$(Configuration)' == 'Proto'">
66-
<!-- This can be removed once CompileBefore support is shipped in an rtm relase -->
6764
<CompileBefore Include="prim-types-prelude.fsi">
6865
<Link>Primitives/prim-types-prelude.fsi</Link>
6966
</CompileBefore>
7067
<CompileBefore Include="prim-types-prelude.fs">
7168
<Link>Primitives/prim-types-prelude.fs</Link>
7269
</CompileBefore>
73-
</ItemGroup>
74-
<ItemGroup Condition="'$(Configuration)' != 'Proto'">
75-
<Compile Include="prim-types-prelude.fsi" CompileOrder="CompileFirst">
76-
<Link>Primitives/prim-types-prelude.fsi</Link>
77-
</Compile>
78-
<Compile Include="prim-types-prelude.fs" CompileOrder="CompileFirst">
79-
<Link>Primitives/prim-types-prelude.fs</Link>
80-
</Compile>
81-
</ItemGroup>
82-
<ItemGroup>
8370
<Compile Include="prim-types.fsi">
8471
<Link>Primitives/prim-types.fsi</Link>
8572
</Compile>

tests/fsharp/SDKTests/tests/CompileOrder - BeforeAndAfter.proj

-42
This file was deleted.

tests/fsharp/SDKTests/tests/ToolsTest.targets

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44

55
<Import Project="$(TargetsDirectory)\Microsoft.FSharp.targets" />
66

7-
<Target Name="Test" DependsOnTargets="FSharpSourceCodeCompileOrder">
7+
<Target Name="Test">
88
<Message Importance="High" Text="===========================================================================================================" />
99
<Message Importance="High" Text="Testing : $(MSBuildProjectName)" />
1010

11-
1211
<!-- check for expected settings -->
1312
<Error Condition="'$(ExpectedFSharpShimPresent)' != '$(FSharp_Shim_Present)'" Text="FSharp_Shim_Present expected:'$(ExpectedFSharpShimPresent)' actual: '$(FSharp_Shim_Present)'" />
1413

@@ -18,8 +17,6 @@
1817

1918
<Error Condition="'$(ExpectedFscToolPath)' != '$(FscToolPath)'" Text="FscToolPath: expected:'$(ExpectedFscToolPath)' actual:'$(FscToolPath)'" />
2019

21-
<Error Condition="'$(ExpectedCompile)' != '' and '$(ExpectedCompile)' != '@(Compile)'" Text="ExpectedCompile: expected:'$(ExpectedCompile)' actual:'@(Compile)'" />
22-
2320
<Error Condition="'$(ExpectedDotnetFscCompilerPath)' == '' and '$(DotnetFscCompilerPath)' != ''" Text="DotnetFscCompilerPath expected to be empty actual:'$(DotnetFscCompilerPath)'" />
2421

2522
<Error Condition="'$(ExpectedDotnetFscCompilerPath)' != '' and $([System.String]::new('$(DotnetFscCompilerPath)').EndsWith('$(ExpectedDotnetFscCompilerPath)')) == true" Text="DotnetFscCompilerPath expected to end with: '$(ExpectedDotnetFscCompilerPath)' actual:'$(DotnetFscCompilerPath)'" />

0 commit comments

Comments
 (0)