fsharp/FSharpBuild.Directory.Build...

156 строки
7.6 KiB
XML

<Project>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="eng\targets\Imports.targets" />
<Import Project="eng\targets\NGenBinaries.targets" />
<Import Project="eng\targets\NuGet.targets" />
<Import Project="FSharp.Profiles.props" />
<PropertyGroup>
<DefineConstants Condition="'$(Configuration)'=='release'">$(DefineConstants);Release</DefineConstants>
<DefineConstants Condition="'$(Configuration)'=='debug'">$(DefineConstants);Debug</DefineConstants>
</PropertyGroup>
<ItemDefinitionGroup>
<NoneSubstituteText>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<Pattern1></Pattern1>
<Pattern2></Pattern2>
<Pattern3></Pattern3>
<Replacement1></Replacement1>
<Replacement2></Replacement2>
<Replacement3></Replacement3>
<_ReplacementText></_ReplacementText>
<IncludeInVsix>false</IncludeInVsix>
<Link></Link>
<SubDir></SubDir>
</NoneSubstituteText>
</ItemDefinitionGroup>
<Target Name="NoneSubstituteTextFiles"
Inputs="@(NoneSubstituteText)"
Outputs="@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)')"
BeforeTargets="AssignTargetPaths;BeforeBuild;GenerateFSharpTextResources">
<ItemGroup>
<NoneSubstituteText Update="@(NoneSubstituteText)">
<__TargetFilePath>$(IntermediateOutputPath)%(Subdir)%(Filename)%(Extension)</__TargetFilePath>
<__TargetFileName>%(Filename)%(Extension)</__TargetFileName>
<_ReplacementText>$([System.IO.File]::ReadAllText('%(FullPath)'))</_ReplacementText>
</NoneSubstituteText>
<NoneSubstituteText Update="@(NoneSubstituteText)">
<_ReplacementText Condition="'%(Pattern1)' != ''">$([System.Text.RegularExpressions.Regex]::Replace('%(_ReplacementText)', '%(Pattern1)', '%(Replacement1)'))</_ReplacementText>
</NoneSubstituteText>
<NoneSubstituteText Update="@(NoneSubstituteText)">
<_ReplacementText Condition="'%(Pattern2)' != ''">$([System.Text.RegularExpressions.Regex]::Replace('%(_ReplacementText)', '%(Pattern2)', '%(Replacement2)'))</_ReplacementText>
</NoneSubstituteText>
<NoneSubstituteText Update="@(NoneSubstituteText)">
<_ReplacementText Condition="'%(Pattern3)' != ''">$([System.Text.RegularExpressions.Regex]::Replace('%(_ReplacementText)', '%(Pattern3)', '%(Replacement3)'))</_ReplacementText>
</NoneSubstituteText>
</ItemGroup>
<MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists('$(IntermediateOutputPath)')" />
<WriteLinesToFile File="%(NoneSubstituteText.__TargetFilePath)" Lines="%(NoneSubstituteText._ReplacementText)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<ItemGroup>
<None Include="%(NoneSubstituteText.__TargetFilePath)" CopyToOutputDirectory="%(NoneSubstituteText.CopyToOutputDirectory)" Condition="'%(NoneSubstituteText.SubDir)'==''" />
<_NoneWithTargetPath Include="%(NoneSubstituteText.__TargetFilePath)" CopyToOutputDirectory="%(NoneSubstituteText.CopyToOutputDirectory)" TargetPath="%(SubDir)%(__TargetFileName)" Condition="'%(NoneSubstituteText.SubDir)'!=''"/>
<FileWrites Include="%(NoneSubstituteText.__TargetFilePath)" Condition="'%(NoneSubstituteText.__TargetFileName)' != 'App.config'" />
<Content Include="%(NoneSubstituteText.__TargetFilePath)" CopyToOutputDirectory="Always" IncludeInVsix="true" Link="%(NoneSubstituteText.Link)" Condition="'%(NoneSubstituteText.IncludeInVsix)'=='true'" />
</ItemGroup>
</Target>
<Target Name="_GenerateBuildPropertiesFile"
Outputs="$(IntermediateOutputPath)buildproperties.fs"
BeforeTargets="BeforeBuild"
Condition="'$(Language)'=='F#'">
<ItemGroup>
<_BuildPropertyLines Remove="@(_BuildPropertyLines)" />
<_BuildPropertyLines Include="// &lt;auto-generated &gt;" />
<_BuildPropertyLines Include="// &lt;Generated by the FSharp WriteCodeFragment class./&gt;" />
<_BuildPropertyLines Include="// &lt;/auto-generated/&gt;" />
<_BuildPropertyLines Include="//" />
<_BuildPropertyLines Include="module internal FSharp.BuildProperties" />
<_BuildPropertyLines Include="let fsProductVersion = &quot;$(FSPRODUCTVERSION)&quot;" />
<_BuildPropertyLines Include="let fsLanguageVersion = &quot;$(FSLANGUAGEVERSION)&quot;" />
</ItemGroup>
<MakeDir
Directories="$(IntermediateOutputPath)"
Condition="!Exists('$(IntermediateOutputPath)')" />
<WriteLinesToFile File="$(IntermediateOutputPath)buildproperties.fs" Lines="@(_BuildPropertyLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<!-- Make sure it will get cleaned -->
<ItemGroup>
<CompileBefore Include="$(IntermediateOutputPath)buildproperties.fs" />
<FsGeneratedSource Include="$(IntermediateOutputPath)buildproperties.fs" />
<FileWrites Include="$(IntermediateOutputPath)buildproperties.fs" />
</ItemGroup>
</Target>
<Target Name="BeforeResGen"
Inputs="@(EmbeddedResource->'$(IntermediateOutputPath)%(Filename)%(Extension)')"
Outputs="@(EmbeddedResource->'$(IntermediateOutputPath)resources\%(Filename)%(Extension)')"
Condition="'$(Configuration)' != 'Proto' and '$(Language)'=='F#' and '$(DisableCompilerRedirection)' != 'true' ">
<MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists('$(IntermediateOutputPath)')" />
<MakeDir Directories="$(IntermediateOutputPath)resources\" Condition="!Exists('$(IntermediateOutputPath)resources\')" />
<SubstituteText EmbeddedResources="@(EmbeddedResource)">
<Output TaskParameter="CopiedFiles" ItemName="CopiedFiles" />
</SubstituteText>
<ItemGroup>
<IntermediateFiles Include="$(IntermediateOutputPath)\*.resx" />
<IntermediateResourcesFiles Include="$(IntermediateOutputPath)resources\*.resx" />
</ItemGroup>
<!-- IntermediateFiles Hashes -->
<GetFileHash Files="@(IntermediateFiles)">
<Output
TaskParameter="Items"
ItemName="IntermediateFilesHashes" />
</GetFileHash>
<Hash ItemsToHash="@(IntermediateFilesHashes->'%(FileHash)')">
<Output TaskParameter="HashResult" PropertyName="IntermediateFilesHash" />
</Hash>
<!-- CopiedFilesForHash Hashes -->
<GetFileHash Files="@(IntermediateResourceFilesForHash)">
<Output
TaskParameter="Items"
ItemName="IntermediateResourceFilesHashes" />
</GetFileHash>
<Hash ItemsToHash="@(IntermediateResourceFilesHashes->'%(FileHash)')">
<Output TaskParameter="HashResult" PropertyName="IntermediateResourceFilesHash" />
</Hash>
<!-- Update EmbeddedResources -->
<ItemGroup Condition="'$(IntermediateFilesHash)' != '$(IntermediateResourceFilesHash)'">
<EmbeddedResource Remove="@(EmbeddedResource)"/>
<EmbeddedResource Include="@(CopiedFiles)"/>
</ItemGroup>
<Copy SourceFiles="@(CopyVsixResources)" DestinationFolder="$(IntermediateOutputPath)\resources\Resources" Condition="'$(IntermediateFilesHash)' != '$(IntermediateResourceFilesHash)'" />
</Target>
<PropertyGroup>
<CoreBuildDependsOn>$(CoreBuildDependsOn);PrefixRepoToReleaseNotes</CoreBuildDependsOn>
</PropertyGroup>
<Target Name="PrefixRepoToReleaseNotes"
AfterTargets="InitializeSourceControlInformationFromSourceControlManager"
BeforeTargets="InitializeStandardNuspecProperties"
Condition="'$(IsPackable)'=='true'">
<PropertyGroup>
<_GitUrl>$([System.Text.RegularExpressions.Regex]::Replace($(ScmRepositoryUrl), ".git$", ""))</_GitUrl>
<PackageReleaseNotes>$(_GitUrl)$(PackageReleaseNotes)</PackageReleaseNotes>
</PropertyGroup>
</Target>
</Project>