Make FSharp.Build build netstandard2.0 (#10626)

* Make FSharp.Build build netstandard2.0

* typo

* fixes

* temp

* display environment windows

* feedback

* test fails
This commit is contained in:
Kevin Ransom (msft) 2020-12-08 10:20:01 -08:00 коммит произвёл nosami
Родитель e96c357255
Коммит baae065567
9 изменённых файлов: 32 добавлений и 16 удалений

Просмотреть файл

@ -426,6 +426,9 @@ try {
Push-Location $RepoRoot
Get-ChildItem ENV: | Sort-Object Name
Write-Host ""
if ($ci) {
Prepare-TempDir
EnablePreviewSdks

Просмотреть файл

@ -7,7 +7,7 @@
<ItemGroup>
<Projects Include="src\fsharp\FSharp.Build\FSharp.Build.fsproj">
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.1</AdditionalProperties>
<AdditionalProperties>TargetFramework=netstandard2.0</AdditionalProperties>
</Projects>
<Projects Include="src\fsharp\fsc\fsc.fsproj">
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.1</AdditionalProperties>

Просмотреть файл

@ -45,7 +45,7 @@
<_Line>
<![CDATA[
folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\%(_XlfLanguages.Identity)"
file source="$(ArtifactsBinDir)FSharp.Build\$(Configuration)\$(TargetFramework)\%(_XlfLanguages.Identity)\FSharp.Build.resources.dll"
file source="$(ArtifactsBinDir)FSharp.Build\$(Configuration)\netstandard2.0\%(_XlfLanguages.Identity)\FSharp.Build.resources.dll"
file source="$(ArtifactsBinDir)FSharp.Compiler.Interactive.Settings\$(Configuration)\$(TargetFramework)\%(_XlfLanguages.Identity)\FSharp.Compiler.Interactive.Settings.resources.dll"
file source="$(ArtifactsBinDir)FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\%(_XlfLanguages.Identity)\FSharp.Compiler.Private.resources.dll"
file source="$(ArtifactsBinDir)FSharp.Core\$(Configuration)\netstandard2.0\%(_XlfLanguages.Identity)\FSharp.Core.resources.dll"
@ -91,12 +91,16 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp"
file source="$(BinariesFolder)\FSharp.Compiler.Interactive.Settings\$(Configuration)\$(TargetFramework)\FSharp.Compiler.Interactive.Settings.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\FSharp.Compiler.Private.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Buffers.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Collections.Immutable.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Memory.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Numerics.Vectors.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Reflection.Metadata.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Resources.Extensions.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Runtime.CompilerServices.Unsafe.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\System.Threading.Tasks.Dataflow.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\Microsoft.Build.Framework.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\Microsoft.Build.Tasks.Core.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Private\$(Configuration)\$(TargetFramework)\Microsoft.Build.Utilities.Core.dll"
file source="$(BinariesFolder)\FSharp.Compiler.Server.Shared\$(Configuration)\$(TargetFramework)\FSharp.Compiler.Server.Shared.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\netstandard2.0\FSharp.Core.dll" vs.file.ngen=yes vs.file.ngenArchitecture=All vs.file.ngenPriority=2
file source="$(BinariesFolder)\FSharp.Core\$(Configuration)\netstandard2.0\FSharp.Core.xml"
@ -113,6 +117,13 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.FSharp.NetSdk.targets"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.FSharp.Overrides.NetSdk.targets"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\$(TargetFramework)\Microsoft.FSharp.Targets"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\netstandard2.0\FSharp.Build.dll" vs.file.ngen=no vs.file.ngenArchitecture=All vs.file.ngenPriority=2
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\netstandard2.0\Microsoft.Portable.FSharp.Targets"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\netstandard2.0\Microsoft.FSharp.NetSdk.props"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\netstandard2.0\Microsoft.FSharp.NetSdk.targets"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\netstandard2.0\Microsoft.FSharp.Overrides.NetSdk.targets"
file source="$(BinariesFolder)\FSharp.Build\$(Configuration)\netstandard2.0\Microsoft.FSharp.Targets"
file source="$(BinariesFolder)\Microsoft.DotNet.DependencyManager\$(Configuration)\net472\Microsoft.DotNet.DependencyManager.dll" vs.file.ngen=no vs.file.ngenArchitecture=All vs.file.ngenPriority=2
@(_BuiltSwrLines)
]]>

Просмотреть файл

@ -12,12 +12,16 @@
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netcoreapp3.0</TargetFrameworks>
<TargetFrameworks Condition="'$(ProtoTargetFramework)' == ''">net472;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netcoreapp3.1</TargetFrameworks>
<TargetFramework Condition="'$(Configuration)' != 'Proto'">netstandard2.0</TargetFramework>
<TargetFrameworks Condition="'$(Configuration)' == 'Proto'">netstandard2.0</TargetFrameworks>
<AssemblyName>FSharp.Build</AssemblyName>
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
<OtherFlags>$(OtherFlags) --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
<NGenBinary>true</NGenBinary>
<DefineConstants>$(DefineConstants);LOCALIZATION_FSBUILD</DefineConstants>
<NoWarn>NU1701;FS0075</NoWarn>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -17,7 +17,7 @@
<AdditionalProperties>TargetFramework=netcoreapp3.1</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="..\FSharp.Build\FSharp.Build.fsproj">
<AdditionalProperties>TargetFramework=netcoreapp3.1</AdditionalProperties>
<AdditionalProperties>TargetFramework=netstandard2.0</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="..\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj">
<AdditionalProperties>TargetFramework=netstandard2.0</AdditionalProperties>

Просмотреть файл

@ -51,7 +51,7 @@
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.dll" target="lib\netcoreapp3.1" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.xml" target="lib\netcoreapp3.1" />
<file src="FSharp.Compiler.Private\$Configuration$\netstandard2.0\FSharp.Compiler.Private.dll" target="lib\netcoreapp3.1" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.1\FSharp.Build.dll" target="lib\netcoreapp3.1" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\FSharp.Build.dll" target="lib\netcoreapp3.1" />
<file src="FSharp.DependencyManager.Nuget\$configuration$\netstandard2.0\FSharp.DependencyManager.Nuget.dll"
target="lib\netcoreapp3.1" />
<file src="Microsoft.DotNet.DependencyManager\$configuration$\netstandard2.0\Microsoft.DotNet.DependencyManager.dll"
@ -61,11 +61,11 @@
<!-- additional files -->
<file src="fsc\$Configuration$\netcoreapp3.1\default.win32manifest" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.1\Microsoft.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.1\Microsoft.Portable.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.1\Microsoft.FSharp.NetSdk.props" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.1\Microsoft.FSharp.NetSdk.targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.1\Microsoft.FSharp.Overrides.NetSdk.targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\Microsoft.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\Microsoft.Portable.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\Microsoft.FSharp.NetSdk.props" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\Microsoft.FSharp.NetSdk.targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\Microsoft.FSharp.Overrides.NetSdk.targets" target="contentFiles\any\any" />
<!-- resources -->
<file src="FSharp.Core\$Configuration$\netstandard2.0\**\FSharp.Core.resources.dll" target="lib\netcoreapp3.1" />
@ -73,7 +73,7 @@
target="lib\netcoreapp3.1" />
<file src="FSharp.Compiler.Interactive.Settings\$Configuration$\netstandard2.0\**\FSharp.Compiler.Interactive.Settings.resources.dll"
target="lib\netcoreapp3.1" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.1\**\FSharp.Build.resources.dll" target="lib\netcoreapp3.1" />
<file src="FSharp.Build\$Configuration$\netstandard2.0\**\FSharp.Build.resources.dll" target="lib\netcoreapp3.1" />
<file src="FSharp.DependencyManager.Nuget\$configuration$\netstandard2.0\**\FSharp.DependencyManager.Nuget.resources.dll"
target="lib\netcoreapp3.1" />
<file src="Microsoft.DotNet.DependencyManager\$Configuration$\netstandard2.0\**\Microsoft.DotNet.DependencyManager.resources.dll"

Просмотреть файл

@ -199,18 +199,16 @@ let requireFile dir path =
let config configurationName envVars =
let SCRIPT_ROOT = __SOURCE_DIRECTORY__
let fsharpCoreArchitecture = "netstandard2.0"
let fsharpBuildArchitecture = "netstandard2.0"
#if NET472
let fscArchitecture = "net472"
let fsiArchitecture = "net472"
let fsharpCoreArchitecture = "netstandard2.0"
let fsharpBuildArchitecture = "net472"
let fsharpCompilerInteractiveSettingsArchitecture = "net472"
let peverifyArchitecture = "net472"
#else
let fscArchitecture = "netcoreapp3.1"
let fsiArchitecture = "netcoreapp3.1"
let fsharpCoreArchitecture = "netstandard2.0"
let fsharpBuildArchitecture = "netcoreapp3.1"
let fsharpCompilerInteractiveSettingsArchitecture = "netstandard2.0"
let peverifyArchitecture = "netcoreapp3.1"
#endif

Просмотреть файл

@ -8,7 +8,7 @@
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<TargetsDirectory>$(MSBuildThisFileDirectory)..\..\..\..\artifacts\bin\FSharp.Build\$(Configuration)\net472</TargetsDirectory>
<TargetsDirectory>$(MSBuildThisFileDirectory)..\..\..\..\artifacts\bin\FSharp.Build\$(Configuration)\netstandard2.0</TargetsDirectory>
<!-- these properties don't really matter, but they're necessary to make MSBuild happy -->
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>

Просмотреть файл

@ -240,7 +240,7 @@ module CoreTests =
[<Test>]
let ``SDKTests`` () =
let cfg = testConfig' "SDKTests"
exec cfg cfg.DotNetExe ("msbuild " + Path.Combine(cfg.Directory, "AllSdkTargetsTests.proj"))
exec cfg cfg.DotNetExe ("msbuild " + Path.Combine(cfg.Directory, "AllSdkTargetsTests.proj") + " /p:Configuration=" + cfg.BUILD_CONFIG)
#if !NETCOREAPP
[<Test>]