未验证 提交 0b5b001e 编写于 作者: K Kevin Ransom (msft) 提交者: GitHub

Fsharp core props file (#12690)

* embed version specific props files in microsoft.compiler package

* tests

* temp
上级 2d399346
......@@ -6,36 +6,52 @@
<Import Project="eng\targets\NuGet.targets" />
<Import Project="FSharp.Profiles.props" />
<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">
<PropertyGroup>
<__TargetFilePath>@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)')</__TargetFilePath>
<__TargetFileName>@(NoneSubstituteText->'%(Filename)%(Extension)')</__TargetFileName>
<__TargetLink>@(NoneSubstituteText->'%(Link)')</__TargetLink>
<_ReplacementText>$([System.IO.File]::ReadAllText('%(NoneSubstituteText.FullPath)'))</_ReplacementText>
<_ReplacementText Condition="'%(NoneSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern1)', '%(NoneSubstituteText.Replacement1)'))</_ReplacementText>
<_ReplacementText Condition="'%(NoneSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern2)', '%(NoneSubstituteText.Replacement2)'))</_ReplacementText>
<_ReplacementText Condition="'%(NoneSubstituteText.Pattern3)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern3)', '%(NoneSubstituteText.Replacement3)'))</_ReplacementText>
<_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' != ''">%(NoneSubstituteText.CopyToOutputDirectory)</_CopyToOutputDirectory>
<_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' == ''">Never</_CopyToOutputDirectory>
<_IncludeInVsix>false</_IncludeInVsix>
<_IncludeInVsix Condition="'%(NoneSubstituteText.IncludeInVsix)' == 'true'">true</_IncludeInVsix>
</PropertyGroup>
<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="$(__TargetFilePath)" Lines="$(_ReplacementText)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<MakeDir Directories="$(IntermediateOutputPath)" Condition="!Exists('$(IntermediateOutputPath)')" />
<WriteLinesToFile File="%(NoneSubstituteText.__TargetFilePath)" Lines="%(NoneSubstituteText._ReplacementText)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<ItemGroup>
<None Include="$(__TargetFilePath)" CopyToOutputDirectory="$(_CopyToOutputDirectory)" />
<FileWrites Include="$(__TargetFilePath)" Condition="'$(__TargetFileName)' != 'App.config'" />
<Content Include="$(__TargetFilePath)" CopyToOutputDirectory="Always" IncludeInVsix="true" Link="$(__TargetLink)" Condition="'$(_IncludeInVsix)'=='true'" />
<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>
......
......@@ -35,11 +35,19 @@
<NoneSubstituteText Include="Microsoft.FSharp.NetSdk.props" CopyToOutputDirectory="PreserveNewest">
<TargetFileName>Microsoft.FSharp.NetSdk.props</TargetFileName>
<Pattern1>{{FSharpCoreShippedPackageVersionValue}}</Pattern1>
<Replacement1>$(FSharpCoreShippedPackageVersionValue)</Replacement1>
<Pattern2>{{FSharpCorePreviewPackageVersionValue}}</Pattern2>
<Replacement2>$(FSharpCorePreviewPackageVersionValue)</Replacement2>
<Pattern3>{{FSCorePackageVersionValue}}</Pattern3>
<Replacement3>$(FSCorePackageVersionValue)</Replacement3>
<Replacement1>$(FSharpCorePreviewPackageVersionValue)</Replacement1>
</NoneSubstituteText>
<NoneSubstituteText Include="Microsoft.FSharp.NetSdk.props" CopyToOutputDirectory="PreserveNewest">
<TargetFileName>Microsoft.FSharp.NetSdk.props</TargetFileName>
<SubDir>Release\</SubDir>
<Pattern1>{{FSCorePackageVersionValue}}</Pattern1>
<Replacement1>$(FSCorePackageVersionValue)</Replacement1>
</NoneSubstituteText>
<NoneSubstituteText Include="Microsoft.FSharp.NetSdk.props" CopyToOutputDirectory="PreserveNewest">
<TargetFileName>Microsoft.FSharp.NetSdk.props</TargetFileName>
<SubDir>Shipping\</SubDir>
<Pattern1>{{FSCorePackageVersionValue}}</Pattern1>
<Replacement1>$(FSCorePackageVersionValue)-$(VersionSuffix)</Replacement1>
</NoneSubstituteText>
<None Include="Microsoft.FSharp.Overrides.NetSdk.targets" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
......
......@@ -75,8 +75,6 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<PropertyGroup>
<DefaultValueTuplePackageVersion>4.4.0</DefaultValueTuplePackageVersion>
<ValueTupleImplicitPackageVersion>$(DefaultValueTuplePackageVersionValue)</ValueTupleImplicitPackageVersion>
<FSharpCoreShippedPackageVersion>{{FSharpCoreShippedPackageVersionValue}}</FSharpCoreShippedPackageVersion>
<FSharpCorePreviewPackageVersion>{{FSharpCorePreviewPackageVersionValue}}</FSharpCorePreviewPackageVersion>
<FSCorePackageVersion>{{FSCorePackageVersionValue}}</FSCorePackageVersion>
</PropertyGroup>
......@@ -88,21 +86,9 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<ExcludeAssets Condition="'$(FSharpCoreIncludeDocFileInOutput)' != 'true'">contentFiles</ExcludeAssets>
</PackageReference>
<PackageReference
Include="FSharp.Core" Version="$(FSharpCoreShippedPackageVersion)"
Condition="'$(DisableImplicitFSharpCoreReference)' != 'true' and '$(FSharpCoreImplicitPackageVersion)' == '' and '$(_NETCoreSdkIsPreview)' == 'true' and '$(DisableFSharpCorePreviewCheck)' == 'true'">
<ExcludeAssets Condition="'$(FSharpCoreIncludeDocFileInOutput)' != 'true'">contentFiles</ExcludeAssets>
</PackageReference>
<PackageReference
Include="FSharp.Core" Version="$(FSharpCorePreviewPackageVersion)"
Condition="'$(DisableImplicitFSharpCoreReference)' != 'true' and '$(FSharpCoreImplicitPackageVersion)' == '' and '$(_NETCoreSdkIsPreview)' == 'true' and '$(DisableFSharpCorePreviewCheck)' != 'true'">
<ExcludeAssets Condition="'$(FSharpCoreIncludeDocFileInOutput)' != 'true'">contentFiles</ExcludeAssets>
</PackageReference>
<PackageReference
Include="FSharp.Core" Version="$(FSCorePackageVersion)"
Condition="'$(DisableImplicitFSharpCoreReference)' != 'true' and '$(FSharpCoreImplicitPackageVersion)' == '' and '$(_NETCoreSdkIsPreview)' != 'true'">
Condition="'$(DisableImplicitFSharpCoreReference)' != 'true' and '$(FSharpCoreImplicitPackageVersion)' == ''">
<ExcludeAssets Condition="'$(FSharpCoreIncludeDocFileInOutput)' != 'true'">contentFiles</ExcludeAssets>
</PackageReference>
......
......@@ -53,6 +53,14 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);PackageFSharpDesignTimeTools</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>
<PropertyGroup>
<_FSharpCoreLibraryPacksFolder Condition="'$(_FSharpCoreLibraryPacksFolder)' == ''">$([MSBuild]::EnsureTrailingSlash('$(MSBuildThisFileDirectory)'))library-packs</_FSharpCoreLibraryPacksFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(DisableImplicitLibraryPacksFolder)' != 'true' ">
<RestoreAdditionalProjectSources Condition="Exists('$(_FSharpCoreLibraryPacksFolder)')">$(RestoreAdditionalProjectSources);$(_FSharpCoreLibraryPacksFolder)</RestoreAdditionalProjectSources>
</PropertyGroup>
<Target Name="CollectFSharpDesignTimeTools" BeforeTargets="BeforeCompile" DependsOnTargets="_GetFrameworkAssemblyReferences">
<ItemGroup>
<PropertyNames Include = "Pkg$([System.String]::Copy('%(PackageReference.FileName)').Replace('.','_'))" Condition = " '%(PackageReference.IsFSharpDesignTimeProvider)' == 'true' and '%(PackageReference.Extension)' == '' "/>
......
......@@ -58,7 +58,9 @@
<file src="$artifactsPackagesDir$Release\FSharp.Core.$fSharpCorePackageVersion$*nupkg" target="contentFiles\Release" />
<file src="$artifactsPackagesDir$Shipping\FSharp.Compiler.Service.$fSharpCompilerServicePreviewPackageVersion$*nupkg"
target="contentFiles\Shipping" />
<file src="$artifactsPackagesDir$Release\FSharp.Compiler.Service.$fSharpCompilerServicePackageVersion$*nupkg"
target="contentFiles\Release" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\Shipping\Microsoft.FSharp.NetSdk.props"
target="contentFiles\Shipping" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\Release\Microsoft.FSharp.NetSdk.props"
target="contentFiles\Release" />
</files>
</package>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Verifies that in a non preview sdk it selects the recently built fsharp.core package -->
<PropertyGroup>
<_NETCoreSdkIsPreview>false</_NETCoreSdkIsPreview>
</PropertyGroup>
<Import Project="PackageTest.props" />
<PropertyGroup>
<ExpectsValueTuple>false</ExpectsValueTuple>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<ExpectsFSharpCore>true</ExpectsFSharpCore>
<ExpectedFSharpCorePackageVersion>$(FSCorePackageVersion)</ExpectedFSharpCorePackageVersion>
</PropertyGroup>
<Import Project="PackageTest.targets" />
</Project>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Verifies that in an RTM sdk with the previewcheck disabled it selects the already RTM fsharp.core package -->
<PropertyGroup>
<_NETCoreSdkIsPreview>false</_NETCoreSdkIsPreview>
</PropertyGroup>
<Import Project="PackageTest.props" />
<PropertyGroup>
<ExpectsValueTuple>false</ExpectsValueTuple>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<DisableFSharpCorePreviewCheck>true</DisableFSharpCorePreviewCheck>
<ExpectsFSharpCore>true</ExpectsFSharpCore>
<ExpectedFSharpCorePackageVersion>$(FSCorePackageVersion)</ExpectedFSharpCorePackageVersion>
</PropertyGroup>
<Import Project="PackageTest.targets" />
</Project>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Verifies that in an RTM sdk with the previewcheck enabled it selects the already shipped fsharp.core package -->
<PropertyGroup>
<_NETCoreSdkIsPreview>false</_NETCoreSdkIsPreview>
</PropertyGroup>
<Import Project="PackageTest.props" />
<PropertyGroup>
<ExpectsValueTuple>false</ExpectsValueTuple>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<DisableFSharpCorePreviewCheck>false</DisableFSharpCorePreviewCheck>
<ExpectsFSharpCore>true</ExpectsFSharpCore>
<ExpectedFSharpCorePackageVersion>$(FSCorePackageVersion)</ExpectedFSharpCorePackageVersion>
</PropertyGroup>
<Import Project="PackageTest.targets" />
</Project>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Verifies that in a preview sdk it selects the preview fsharp.core package -->
<PropertyGroup>
<_NETCoreSdkIsPreview>true</_NETCoreSdkIsPreview>
</PropertyGroup>
<Import Project="PackageTest.props" />
<PropertyGroup>
<ExpectsValueTuple>false</ExpectsValueTuple>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<ExpectsFSharpCore>true</ExpectsFSharpCore>
<ExpectedFSharpCorePackageVersion>$(FSharpCorePreviewPackageVersion)</ExpectedFSharpCorePackageVersion>
</PropertyGroup>
<Import Project="PackageTest.targets" />
</Project>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Verifies that in a preview sdk with preview check disabled it selects the shipped fsharp.core package -->
<PropertyGroup>
<_NETCoreSdkIsPreview>true</_NETCoreSdkIsPreview>
</PropertyGroup>
<Import Project="PackageTest.props" />
<PropertyGroup>
<ExpectsValueTuple>false</ExpectsValueTuple>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<DisableFSharpCorePreviewCheck>true</DisableFSharpCorePreviewCheck>
<ExpectsFSharpCore>true</ExpectsFSharpCore>
<ExpectedFSharpCorePackageVersion>$(FSharpCoreShippedPackageVersionValue)</ExpectedFSharpCorePackageVersion>
</PropertyGroup>
<Import Project="PackageTest.targets" />
</Project>
<Project ToolsVersion="4.0" DefaultTargets="Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Verifies that in a preview sdk with preview check enabled it selects the preview fsharp.core package -->
<PropertyGroup>
<_NETCoreSdkIsPreview>true</_NETCoreSdkIsPreview>
</PropertyGroup>
<Import Project="PackageTest.props" />
<PropertyGroup>
<ExpectsValueTuple>false</ExpectsValueTuple>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>
<DisableFSharpCorePreviewCheck>false</DisableFSharpCorePreviewCheck>
<ExpectsFSharpCore>true</ExpectsFSharpCore>
<ExpectedFSharpCorePackageVersion>$(FSharpCorePreviewPackageVersionValue)</ExpectedFSharpCorePackageVersion>
</PropertyGroup>
<Import Project="PackageTest.targets" />
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册