Skip to content

Commit

Permalink
Revert "Beforecompile (#17057)" (#17099)
Browse files Browse the repository at this point in the history
This reverts commit 7e1b266.
  • Loading branch information
vzarytovskii authored Apr 29, 2024
1 parent 7906f6c commit b08afc5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 86 deletions.
32 changes: 5 additions & 27 deletions src/FSharp.Build/Microsoft.FSharp.Targets
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ this file.
</FSharpEmbedResXSource>

<ItemGroup>
<Compile Include="@(_FsGeneratedResXSource)" CompileOrder="CompileBefore" />
<CompileBefore Include="@(_FsGeneratedResXSource)" />
<FsGeneratedSource Include="@(_FsGeneratedResXSource)" />
<FileWrites Include="@(_FsGeneratedResXSource)" />
</ItemGroup>
Expand All @@ -247,35 +247,14 @@ this file.
</FSharpEmbedResourceText>

<ItemGroup>
<Compile Include="@(_FsGeneratedTxtSource)" CompileOrder="CompileBefore" />
<CompileBefore Include="@(_FsGeneratedTxtSource)" />
<FsGeneratedSource Include="@(_FsGeneratedTxtSource)" />
<EmbeddedResource Include="@(_FsGeneratedResx)" />
<FileWrites Include="@(_FsGeneratedTxtSource)" />
<FileWrites Include="@(_FsGeneratedResx)" />
</ItemGroup>
</Target>

<Target Name="FSharpSourceCodeCompileOrder">
<!-- implement <CompileOrder>CompileBefore</CompileOrder> -->
<ItemGroup>
<__Sources Remove="@(__Sources)" />
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileFirst'))" />
<__Sources Include="@(CompileBefore)" />
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileBefore'))" />
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', ''))" />
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileAfter'))" />
<__Sources Include="@(CompileAfter)" />
<__Sources Include="@(Compile->WithMetadataValue('CompileOrder', 'CompileLast'))" />
</ItemGroup>
<ItemGroup>
<Compile Remove="@(Compile)" />
<CompileBefore Remove="@(CompileBefore)" />
<CompileAfter Remove="@(CompileAfter)" />
<Compile Include="@(__Sources)" />
</ItemGroup>
<Message Importance="low" Text="FSharpSourceCodeCompileOrder:Sources: '@(__Sources)'" />
</Target>

<Target
Name="CoreCompile"
Inputs="$(MSBuildAllProjects);
Expand Down Expand Up @@ -305,7 +284,7 @@ this file.
$(NonExistentFile);
@(CustomAdditionalCompileOutputs)"
Returns="@(FscCommandLineArgs)"
DependsOnTargets="$(CoreCompileDependsOn);FSharpSourceCodeCompileOrder"
DependsOnTargets="$(CoreCompileDependsOn)"
>

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


<!-- Dotnet SDK requires SimpleResolution to be true Legacy project system build not -->
<PropertyGroup>
<FscOtherFlags Condition="'$(SimpleResolution)' == 'true'">--simpleresolution $(OtherFlags)</FscOtherFlags>
Expand Down Expand Up @@ -393,7 +371,7 @@ this file.
Resources="@(ActualEmbeddedResources)"
SkipCompilerExecution="$(SkipCompilerExecution)"
SourceLink="$(SourceLink)"
Sources="@(Compile)"
Sources="@(CompileBefore);@(Compile);@(CompileAfter)"
SubsystemVersion="$(SubsystemVersion)"
Tailcalls="$(Tailcalls)"
TargetType="$(OutputType)"
Expand Down Expand Up @@ -456,7 +434,7 @@ this file.
Overwrite="true"/>

<ItemGroup Condition="'$(AdditionalSourcesText)' != ''">
<Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"><CompileOrder>CompileBefore</CompileOrder></Compile>
<CompileBefore Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
<_FsGeneratedTfmAttributesSource Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" />
</ItemGroup>
</Target>
Expand Down
13 changes: 0 additions & 13 deletions src/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,12 @@
</EmbeddedResource>
<EmbeddedResource Include="ILLink.LinkAttributes.xml" LogicalName="ILLink.LinkAttributes.xml" />
<EmbeddedResource Include="ILLink.Substitutions.xml" LogicalName="ILLink.Substitutions.xml" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Proto'">
<!-- This can be removed once CompileBefore support is shipped in an rtm relase -->
<CompileBefore Include="prim-types-prelude.fsi">
<Link>Primitives/prim-types-prelude.fsi</Link>
</CompileBefore>
<CompileBefore Include="prim-types-prelude.fs">
<Link>Primitives/prim-types-prelude.fs</Link>
</CompileBefore>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' != 'Proto'">
<Compile Include="prim-types-prelude.fsi" CompileOrder="CompileFirst">
<Link>Primitives/prim-types-prelude.fsi</Link>
</Compile>
<Compile Include="prim-types-prelude.fs" CompileOrder="CompileFirst">
<Link>Primitives/prim-types-prelude.fs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="prim-types.fsi">
<Link>Primitives/prim-types.fsi</Link>
</Compile>
Expand Down
42 changes: 0 additions & 42 deletions tests/fsharp/SDKTests/tests/CompileOrder - BeforeAndAfter.proj

This file was deleted.

5 changes: 1 addition & 4 deletions tests/fsharp/SDKTests/tests/ToolsTest.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

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

<Target Name="Test" DependsOnTargets="FSharpSourceCodeCompileOrder">
<Target Name="Test">
<Message Importance="High" Text="===========================================================================================================" />
<Message Importance="High" Text="Testing : $(MSBuildProjectName)" />


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

Expand All @@ -18,8 +17,6 @@

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

<Error Condition="'$(ExpectedCompile)' != '' and '$(ExpectedCompile)' != '@(Compile)'" Text="ExpectedCompile: expected:'$(ExpectedCompile)' actual:'@(Compile)'" />

<Error Condition="'$(ExpectedDotnetFscCompilerPath)' == '' and '$(DotnetFscCompilerPath)' != ''" Text="DotnetFscCompilerPath expected to be empty actual:'$(DotnetFscCompilerPath)'" />

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

0 comments on commit b08afc5

Please sign in to comment.