|
| 1 | +<Project> |
| 2 | + |
| 3 | + <Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" /> |
| 4 | + <Import Project="eng\targets\Imports.targets" /> |
| 5 | + <Import Project="eng\targets\NuGet.targets" /> |
| 6 | + <Import Project="eng\targets\NGenBinaries.targets" /> |
| 7 | + <Import Project="FSharp.Profiles.props" /> |
| 8 | + |
| 9 | + <Target Name="NoneSubstituteTextFiles" |
| 10 | + Inputs="@(NoneSubstituteText)" |
| 11 | + Outputs="@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)')" |
| 12 | + BeforeTargets="AssignTargetPaths;BeforeBuild;GenerateFSharpTextResources"> |
| 13 | + |
| 14 | + <PropertyGroup> |
| 15 | + <__TargetFilePath>@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)')</__TargetFilePath> |
| 16 | + <__TargetFileName>@(NoneSubstituteText->'%(Filename)%(Extension)')</__TargetFileName> |
| 17 | + |
| 18 | + <_ReplacementText>$([System.IO.File]::ReadAllText('%(NoneSubstituteText.FullPath)'))</_ReplacementText> |
| 19 | + <_ReplacementText Condition="'%(NoneSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern1)', '%(NoneSubstituteText.Replacement1)'))</_ReplacementText> |
| 20 | + <_ReplacementText Condition="'%(NoneSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern2)', '%(NoneSubstituteText.Replacement2)'))</_ReplacementText> |
| 21 | + |
| 22 | + <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' != ''">%(NoneSubstituteText.CopyToOutputDirectory)</_CopyToOutputDirectory> |
| 23 | + <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' == ''">Never</_CopyToOutputDirectory> |
| 24 | + |
| 25 | + <_IncludeInVsix>false</_IncludeInVsix> |
| 26 | + <_IncludeInVsix Condition="'%(NoneSubstituteText.IncludeInVsix)' == 'true'">true</_IncludeInVsix> |
| 27 | + </PropertyGroup> |
| 28 | + |
| 29 | + <MakeDir Directories="$(IntermediateOutputPath)" |
| 30 | + Condition="!Exists('$(IntermediateOutputPath)')" /> |
| 31 | + <WriteLinesToFile File="$(__TargetFilePath)" Lines="$(_ReplacementText)" Overwrite="true" WriteOnlyWhenDifferent="true" /> |
| 32 | + |
| 33 | + <ItemGroup> |
| 34 | + <None Include="$(__TargetFilePath)" CopyToOutputDirectory="$(_CopyToOutputDirectory)" /> |
| 35 | + <FileWrites Include="$(__TargetFilePath)" Condition="'$(__TargetFileName)' != 'App.config'" /> |
| 36 | + <Content Include="$(__TargetFilePath)" CopyToOutputDirectory="Always" IncludeInVsix="true" /> |
| 37 | + </ItemGroup> |
| 38 | + </Target> |
| 39 | + |
| 40 | + <Target Name="_GenerateBuildPropertiesFile" |
| 41 | + Outputs="$(IntermediateOutputPath)buildproperties.fs" |
| 42 | + BeforeTargets="BeforeBuild" |
| 43 | + Condition="'$(Language)'=='F#'"> |
| 44 | + |
| 45 | + <ItemGroup> |
| 46 | + <_BuildPropertyLines Remove="@(_BuildPropertyLines)" /> |
| 47 | + <_BuildPropertyLines Include="// <auto-generated >" /> |
| 48 | + <_BuildPropertyLines Include="// <Generated by the FSharp WriteCodeFragment class./>" /> |
| 49 | + <_BuildPropertyLines Include="// </auto-generated/>" /> |
| 50 | + <_BuildPropertyLines Include="//" /> |
| 51 | + <_BuildPropertyLines Include="module internal FSharp.BuildProperties" /> |
| 52 | + <_BuildPropertyLines Include="let fsProductVersion = "$(FSPRODUCTVERSION)"" /> |
| 53 | + <_BuildPropertyLines Include="let fsLanguageVersion = "$(FSLANGUAGEVERSION)"" /> |
| 54 | + </ItemGroup> |
| 55 | + |
| 56 | + <MakeDir |
| 57 | + Directories="$(IntermediateOutputPath)" |
| 58 | + Condition="!Exists('$(IntermediateOutputPath)')" /> |
| 59 | + <WriteLinesToFile File="$(IntermediateOutputPath)buildproperties.fs" Lines="@(_BuildPropertyLines)" Overwrite="true" WriteOnlyWhenDifferent="true" /> |
| 60 | + |
| 61 | + <!-- Make sure it will get cleaned --> |
| 62 | + <ItemGroup> |
| 63 | + <FileWrites Include="$(IntermediateOutputPath)buildproperties.fs" /> |
| 64 | + <CompileBefore Include="$(IntermediateOutputPath)buildproperties.fs" /> |
| 65 | + </ItemGroup> |
| 66 | + </Target> |
| 67 | + |
| 68 | + <Target Name="BeforeResGen" |
| 69 | + Inputs="@(EmbeddedResource->'$(IntermediateOutputPath)%(Filename)%(Extension)')" |
| 70 | + Outputs="@(EmbeddedResource->'$(IntermediateOutputPath)resources\%(Filename)%(Extension)')" |
| 71 | + DependsOnTargets="CopyVsixResources" |
| 72 | + Condition="'$(Configuration)' != 'Proto' and '$(Language)'=='F#' and '$(DisableCompilerRedirection)' != 'true' "> |
| 73 | + |
| 74 | + <SubstituteText EmbeddedResources="@(EmbeddedResource)"> |
| 75 | + <Output TaskParameter="CopiedFiles" ItemName="CopiedFiles" /> |
| 76 | + </SubstituteText> |
| 77 | + |
| 78 | + <ItemGroup> |
| 79 | + <EmbeddedResource Remove="@(EmbeddedResource)"/> |
| 80 | + <EmbeddedResource Include="@(CopiedFiles)"/> |
| 81 | + </ItemGroup> |
| 82 | + |
| 83 | + <MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists('$(IntermediateOutputPath)')" /> |
| 84 | + <MakeDir Directories="$(IntermediateOutputPath)resources\" Condition="!Exists('$(IntermediateOutputPath)resources\')" /> |
| 85 | + </Target> |
| 86 | + |
| 87 | + <Target Name="CopyVsixResources"> |
| 88 | + <Copy SourceFiles="@(CopyVsixResources)" DestinationFolder="$(IntermediateOutputPath)\resources\Resources" /> |
| 89 | + </Target> |
| 90 | + |
| 91 | +</Project> |
0 commit comments