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

Merge pull request #8158 from dotnet/merges/merge-master-to-release/dev16.5

merge master to release/dev16.5
......@@ -9,7 +9,6 @@ artifacts/
# Patches that may have been generated by scripts.
# (These aren't generally useful to commit directly; if anything, they should be applied.)
scripts/*.patch
/fcs/FSharp.Compiler.Service/illex.fs
/fcs/FSharp.Compiler.Service/ilpars.fs
/fcs/FSharp.Compiler.Service/ilpars.fsi
......
......@@ -5,6 +5,8 @@ VisualStudioVersion = 16.0.28729.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private", "src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Server.Shared", "src\fsharp\FSharp.Compiler.Server.Shared\FSharp.Compiler.Server.Shared.fsproj", "{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Core", "src\fsharp\FSharp.Core\FSharp.Core.fsproj", "{DED3BBD7-53F4-428A-8C9F-27968E768605}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}"
......@@ -17,6 +19,11 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Interactive
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsi", "src\fsharp\fsi\fsi.fsproj", "{D0E98C0D-490B-4C61-9329-0862F6E87645}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsharp\fsiAnyCpu\fsiAnyCpu.fsproj", "{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}"
ProjectSection(ProjectDependencies) = postProject
{649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E}
EndProjectSection
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}"
......@@ -39,10 +46,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageSer
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer.UnitTests", "tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj", "{C97819B0-B428-4B96-9CD7-497D2D1C738C}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.DependencyManager", "src\fsharp\FSharp.DependencyManager\FSharp.DependencyManager.fsproj", "{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private.Scripting", "src\fsharp\FSharp.Compiler.Private.Scripting\FSharp.Compiler.Private.Scripting.fsproj", "{6771860A-614D-4FDD-A655-4C70EBCC91B0}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private.Scripting.UnitTests", "tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj", "{4FEDF286-0252-4EBC-9E75-879CCA3B85DC}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.DependencyManager.UnitTests", "tests\FSharp.DependencyManager.UnitTests\FSharp.DependencyManager.UnitTests.fsproj", "{388FFDAE-A659-422E-9407-6A9062E1986E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -65,6 +76,18 @@ Global
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.Build.0 = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.ActiveCfg = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.Build.0 = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|Any CPU.ActiveCfg = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|Any CPU.Build.0 = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|x86.ActiveCfg = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|x86.Build.0 = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|Any CPU.Build.0 = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|x86.ActiveCfg = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|x86.Build.0 = Release|Any CPU
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -125,6 +148,18 @@ Global
{D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|Any CPU.Build.0 = Release|Any CPU
{D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|x86.ActiveCfg = Release|Any CPU
{D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|x86.Build.0 = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|x86.ActiveCfg = Debug|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|x86.Build.0 = Debug|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|Any CPU.ActiveCfg = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|Any CPU.Build.0 = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|x86.ActiveCfg = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|x86.Build.0 = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.Build.0 = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|x86.ActiveCfg = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|x86.Build.0 = Release|Any CPU
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -209,6 +244,18 @@ Global
{C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|Any CPU.Build.0 = Release|Any CPU
{C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|x86.ActiveCfg = Release|Any CPU
{C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|x86.Build.0 = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Debug|x86.ActiveCfg = Debug|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Debug|x86.Build.0 = Debug|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Proto|Any CPU.ActiveCfg = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Proto|Any CPU.Build.0 = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Proto|x86.ActiveCfg = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Proto|x86.Build.0 = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Release|Any CPU.Build.0 = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Release|x86.ActiveCfg = Release|Any CPU
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851}.Release|x86.Build.0 = Release|Any CPU
{6771860A-614D-4FDD-A655-4C70EBCC91B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6771860A-614D-4FDD-A655-4C70EBCC91B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6771860A-614D-4FDD-A655-4C70EBCC91B0}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -233,6 +280,18 @@ Global
{4FEDF286-0252-4EBC-9E75-879CCA3B85DC}.Release|Any CPU.Build.0 = Release|Any CPU
{4FEDF286-0252-4EBC-9E75-879CCA3B85DC}.Release|x86.ActiveCfg = Release|Any CPU
{4FEDF286-0252-4EBC-9E75-879CCA3B85DC}.Release|x86.Build.0 = Release|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Debug|x86.ActiveCfg = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Debug|x86.Build.0 = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Proto|Any CPU.Build.0 = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Proto|x86.ActiveCfg = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Proto|x86.Build.0 = Debug|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Release|Any CPU.Build.0 = Release|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Release|x86.ActiveCfg = Release|Any CPU
{388FFDAE-A659-422E-9407-6A9062E1986E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -244,6 +303,7 @@ Global
{C94C257C-3C0A-4858-B5D8-D746498D1F08} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
{649FA588-F02E-457C-9FCF-87E46407481E} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{D0E98C0D-490B-4C61-9329-0862F6E87645} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{C163E892-5BF7-4B59-AA99-B0E8079C67C4} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{88E2D422-6852-46E3-A740-83E391DC7973} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
......@@ -251,8 +311,10 @@ Global
{81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7} = {3840F2E7-3898-45F7-8CF7-1E6829E56DB8}
{99B3F4A5-80B4-41D9-A073-117DB6D7DBBA} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{C97819B0-B428-4B96-9CD7-497D2D1C738C} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{8B7BF62E-7D8C-4928-BE40-4E392A9EE851} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
{6771860A-614D-4FDD-A655-4C70EBCC91B0} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{4FEDF286-0252-4EBC-9E75-879CCA3B85DC} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{388FFDAE-A659-422E-9407-6A9062E1986E} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8}
......
......@@ -22,18 +22,18 @@
<FscToolPath>$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))</FscToolPath>
<FscToolExe Condition="'$(OS)' != 'Unix'">dotnet.exe</FscToolExe>
<FscToolExe Condition="'$(OS)' == 'Unix'">dotnet</FscToolExe>
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp2.1\fsc.exe</DotnetFscCompilerPath>
<DotnetFscCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp3.0\fsc.exe</DotnetFscCompilerPath>
<FsiToolPath>$([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)'))</FsiToolPath>
<FsiToolExe Condition="'$(OS)' != 'Unix'">dotnet.exe</FsiToolExe>
<FsiToolExe Condition="'$(OS)' == 'Unix'">dotnet</FsiToolExe>
<DotnetFsiCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp2.1\fsi.exe</DotnetFsiCompilerPath>
<DotnetFsiCompilerPath>$(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp3.0\fsi.exe</DotnetFsiCompilerPath>
</PropertyGroup>
<!-- SDK targets override -->
<PropertyGroup>
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472</_FSharpBuildTargetFramework>
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp2.1</_FSharpBuildTargetFramework>
<_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp3.0</_FSharpBuildTargetFramework>
<_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework)</_FSharpBuildBinPath>
<FSharpBuildAssemblyFile>$(_FSharpBuildBinPath)\FSharp.Build.dll</FSharpBuildAssemblyFile>
......
<Project>
<UsingTask TaskName="Fsi" AssemblyFile="$(FSharpBuildAssemblyFile)" />
<UsingTask TaskName="Fsi" AssemblyFile="$(FSharpBuildAssemblyFile)" />
<Target
Name="RunFSharpScript"
......@@ -35,8 +35,8 @@
<Output TaskParameter="CommandLineArgs" ItemName="FsiCommandLineArgs" />
</Fsi>
<ItemGroup>
<_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
</ItemGroup>
</Target>
<ItemGroup>
<_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
</ItemGroup>
</Target>
</Project>
......@@ -15,7 +15,7 @@ proto: tools
$(DotNetExe) restore src/fsharp/fsc/fsc.fsproj
$(DotNetExe) build src/buildtools/buildtools.proj -c Proto
$(DotNetExe) build src/fsharp/FSharp.Build/FSharp.Build.fsproj -f netstandard2.0 -c Proto
$(DotNetExe) build src/fsharp/fsc/fsc.fsproj -f netcoreapp2.1 -c Proto
$(DotNetExe) build src/fsharp/fsc/fsc.fsproj -f netcoreapp3.0 -c Proto
restore:
$(DotNetExe) restore src/fsharp/FSharp.Core/FSharp.Core.fsproj
......@@ -32,15 +32,15 @@ build: proto restore
$(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Core/FSharp.Core.fsproj
$(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Build/FSharp.Build.fsproj
$(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp2.1 src/fsharp/fsc/fsc.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp3.0 src/fsharp/fsc/fsc.fsproj
$(DotNetExe) build -c $(Configuration) -f netstandard2.0 src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp2.1 src/fsharp/fsi/fsi.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp2.0 tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp2.0 tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp3.0 src/fsharp/fsi/fsi.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp3.0 tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
$(DotNetExe) build -c $(Configuration) -f netcoreapp3.0 tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj
test: build
$(DotNetExe) test -f netcoreapp2.0 -c $(Configuration) --no-restore --no-build tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Core.UnitTests.coreclr.trx"
$(DotNetExe) test -f netcoreapp2.0 -c $(Configuration) --no-restore --no-build tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Build.UnitTests.coreclr.trx"
$(DotNetExe) test -f netcoreapp3.0 -c $(Configuration) --no-restore --no-build tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Core.UnitTests.coreclr.trx"
$(DotNetExe) test -f netcoreapp3.0 -c $(Configuration) --no-restore --no-build tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj -l "trx;LogFileName=$(CURDIR)/tests/TestResults/FSharp.Build.UnitTests.coreclr.trx"
clean:
rm -rf $(CURDIR)/artifacts
......@@ -34,8 +34,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private", "
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpTemplates", "vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj", "{025CE01B-98F3-4C3C-B486-2C0BD038D011}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Server.Shared", "src\fsharp\FSharp.Compiler.Server.Shared\FSharp.Compiler.Server.Shared.fsproj", "{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Core", "src\fsharp\FSharp.Core\FSharp.Core.fsproj", "{DED3BBD7-53F4-428A-8C9F-27968E768605}"
......@@ -144,14 +142,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{647810D0
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FSharp.Compiler", "src\fsharp\FSharp.Compiler.nuget\Microsoft.FSharp.Compiler.csproj", "{04C59F6E-1C76-4F6A-AC21-2EA7F296A1B8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProjectTemplates", "ProjectTemplates", "{BED74F9E-A0D2-48E2-9EE7-449832100487}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleProject", "vsintegration\ProjectTemplates\ConsoleProject\ConsoleProject.csproj", "{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibraryProject", "vsintegration\ProjectTemplates\LibraryProject\LibraryProject.csproj", "{C32806E0-71C2-40E4-AEC4-517F73F6A18A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TutorialProject", "vsintegration\ProjectTemplates\TutorialProject\TutorialProject.csproj", "{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.Core.nuget", "src\fsharp\FSharp.Core.nuget\FSharp.Core.nuget.csproj", "{8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer", "src\fsharp\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{60BAFFA5-6631-4328-B044-2E012AB76DCA}"
......@@ -164,6 +154,10 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private.Scr
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Private.Scripting.UnitTests", "tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj", "{09F56540-AFA5-4694-B7A6-0DBF6D4618C2}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.DependencyManager", "src\fsharp\FSharp.DependencyManager\FSharp.DependencyManager.fsproj", "{DFA30881-C0B1-4813-B087-C21B5AF9B77F}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.DependencyManager.UnitTests", "tests\FSharp.DependencyManager.UnitTests\FSharp.DependencyManager.UnitTests.fsproj", "{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -210,18 +204,6 @@ Global
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU
{59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.Build.0 = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Debug|Any CPU.Build.0 = Debug|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Debug|x86.ActiveCfg = Debug|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Debug|x86.Build.0 = Debug|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Proto|Any CPU.ActiveCfg = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Proto|Any CPU.Build.0 = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Proto|x86.ActiveCfg = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Proto|x86.Build.0 = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Release|Any CPU.ActiveCfg = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Release|Any CPU.Build.0 = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Release|x86.ActiveCfg = Release|Any CPU
{025CE01B-98F3-4C3C-B486-2C0BD038D011}.Release|x86.Build.0 = Release|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -846,42 +828,6 @@ Global
{04C59F6E-1C76-4F6A-AC21-2EA7F296A1B8}.Release|Any CPU.Build.0 = Release|Any CPU
{04C59F6E-1C76-4F6A-AC21-2EA7F296A1B8}.Release|x86.ActiveCfg = Release|Any CPU
{04C59F6E-1C76-4F6A-AC21-2EA7F296A1B8}.Release|x86.Build.0 = Release|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Debug|x86.ActiveCfg = Debug|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Debug|x86.Build.0 = Debug|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Proto|Any CPU.ActiveCfg = Proto|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Proto|Any CPU.Build.0 = Proto|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Proto|x86.ActiveCfg = Proto|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Proto|x86.Build.0 = Proto|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Release|Any CPU.Build.0 = Release|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Release|x86.ActiveCfg = Release|Any CPU
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8}.Release|x86.Build.0 = Release|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Debug|x86.ActiveCfg = Debug|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Debug|x86.Build.0 = Debug|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Proto|Any CPU.ActiveCfg = Proto|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Proto|Any CPU.Build.0 = Proto|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Proto|x86.ActiveCfg = Proto|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Proto|x86.Build.0 = Proto|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Release|Any CPU.Build.0 = Release|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Release|x86.ActiveCfg = Release|Any CPU
{C32806E0-71C2-40E4-AEC4-517F73F6A18A}.Release|x86.Build.0 = Release|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Debug|x86.ActiveCfg = Debug|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Debug|x86.Build.0 = Debug|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Proto|Any CPU.ActiveCfg = Proto|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Proto|Any CPU.Build.0 = Proto|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Proto|x86.ActiveCfg = Proto|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Proto|x86.Build.0 = Proto|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Release|Any CPU.Build.0 = Release|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Release|x86.ActiveCfg = Release|Any CPU
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1}.Release|x86.Build.0 = Release|Any CPU
{8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Debug|x86.ActiveCfg = Debug|Any CPU
......@@ -954,6 +900,30 @@ Global
{09F56540-AFA5-4694-B7A6-0DBF6D4618C2}.Release|Any CPU.Build.0 = Release|Any CPU
{09F56540-AFA5-4694-B7A6-0DBF6D4618C2}.Release|x86.ActiveCfg = Release|Any CPU
{09F56540-AFA5-4694-B7A6-0DBF6D4618C2}.Release|x86.Build.0 = Release|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Debug|x86.ActiveCfg = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Debug|x86.Build.0 = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Proto|Any CPU.Build.0 = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Proto|x86.ActiveCfg = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Proto|x86.Build.0 = Debug|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Release|Any CPU.Build.0 = Release|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Release|x86.ActiveCfg = Release|Any CPU
{DFA30881-C0B1-4813-B087-C21B5AF9B77F}.Release|x86.Build.0 = Release|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Debug|x86.ActiveCfg = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Debug|x86.Build.0 = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Proto|Any CPU.ActiveCfg = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Proto|Any CPU.Build.0 = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Proto|x86.ActiveCfg = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Proto|x86.Build.0 = Debug|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Release|Any CPU.Build.0 = Release|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Release|x86.ActiveCfg = Release|Any CPU
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -968,7 +938,6 @@ Global
{991DCF75-C2EB-42B6-9A0D-AA1D2409D519} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
{59ADCE46-9740-4079-834D-9A03A3494EBC} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{025CE01B-98F3-4C3C-B486-2C0BD038D011} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{DED3BBD7-53F4-428A-8C9F-27968E768605} = {3058BC79-8E79-4645-B05D-48CC182FA8A6}
{EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
......@@ -1021,16 +990,14 @@ Global
{E93E7D28-1C6B-4E04-BE83-68428CF7E039} = {6235B3AF-774D-4EA1-8F37-789E767F6368}
{9482211E-23D0-4BD0-9893-E4AA5559F67A} = {6235B3AF-774D-4EA1-8F37-789E767F6368}
{04C59F6E-1C76-4F6A-AC21-2EA7F296A1B8} = {647810D0-5307-448F-99A2-E83917010DAE}
{BED74F9E-A0D2-48E2-9EE7-449832100487} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{1D8D778E-8D6B-4A8C-88A6-BE578988FBE8} = {BED74F9E-A0D2-48E2-9EE7-449832100487}
{C32806E0-71C2-40E4-AEC4-517F73F6A18A} = {BED74F9E-A0D2-48E2-9EE7-449832100487}
{7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1} = {BED74F9E-A0D2-48E2-9EE7-449832100487}
{8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC} = {647810D0-5307-448F-99A2-E83917010DAE}
{60BAFFA5-6631-4328-B044-2E012AB76DCA} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{AAF2D233-1C38-4090-8FFA-F7C545625E06} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{79255A92-ED00-40BA-9D64-12FCC664A976} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D}
{20B7BC36-CF51-4D75-9E13-66681C07977F} = {B8DDA694-7939-42E3-95E5-265C2217C142}
{09F56540-AFA5-4694-B7A6-0DBF6D4618C2} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
{DFA30881-C0B1-4813-B087-C21B5AF9B77F} = {3881429D-A97A-49EB-B7AE-A82BA5FE9C77}
{AF7AE565-E1C4-4A24-BD4B-D7983FC84768} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37}
......
......@@ -48,8 +48,10 @@ param (
[switch]$testCoreClr,
[switch]$testCambridge,
[switch]$testCompiler,
[switch]$testDependencyManager,
[switch]$testFSharpCore,
[switch]$testFSharpQA,
[switch]$testScripting,
[switch]$testVs,
[switch]$testAll,
[string]$officialSkipTests = "false",
......@@ -82,10 +84,12 @@ function Print-Usage() {
Write-Host " -testAll Run all tests"
Write-Host " -testCambridge Run Cambridge tests"
Write-Host " -testCompiler Run FSharpCompiler unit tests"
Write-Host " -testDependencyManager Run FSharp.DependencyManager.UnitTests"
Write-Host " -testDesktop Run tests against full .NET Framework"
Write-Host " -testCoreClr Run tests against CoreCLR"
Write-Host " -testFSharpCore Run FSharpCore unit tests"
Write-Host " -testFSharpQA Run F# Cambridge tests"
Write-Host " -testScripting Run Scripting tests"
Write-Host " -testVs Run F# editor unit tests"
Write-Host " -officialSkipTests <bool> Set to 'true' to skip running tests"
Write-Host ""
......@@ -122,6 +126,7 @@ function Process-Arguments() {
$script:testAll = $False
$script:testCambridge = $False
$script:testCompiler = $False
$script:testDependencyManager = $False
$script:testDesktop = $False
$script:testCoreClr = $False
$script:testFSharpCore = $False
......@@ -148,11 +153,11 @@ function Process-Arguments() {
function Update-Arguments() {
if ($script:noVisualStudio) {
$script:bootstrapTfm = "netcoreapp2.1"
$script:bootstrapTfm = "netcoreapp3.0"
$script:msbuildEngine = "dotnet"
}
if ($bootstrapTfm -eq "netcoreapp2.1") {
if ($bootstrapTfm -eq "netcoreapp3.0") {
if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) {
$script:bootstrap = $True
}
......@@ -256,7 +261,7 @@ function TestUsingNUnit([string] $testProject, [string] $targetFramework) {
}
function BuildCompiler() {
if ($bootstrapTfm -eq "netcoreapp2.1") {
if ($bootstrapTfm -eq "netcoreapp3.0") {
$dotnetPath = InitializeDotNetCli
$dotnetExe = Join-Path $dotnetPath "dotnet.exe"
$fscProject = "$RepoRoot\src\fsharp\fsc\fsc.fsproj"
......@@ -265,10 +270,10 @@ function BuildCompiler() {
$argNoRestore = if ($norestore) { " --no-restore" } else { "" }
$argNoIncremental = if ($rebuild) { " --no-incremental" } else { "" }
$args = "build $fscProject -c $configuration -v $verbosity -f netcoreapp2.1" + $argNoRestore + $argNoIncremental
$args = "build $fscProject -c $configuration -v $verbosity -f netcoreapp3.0" + $argNoRestore + $argNoIncremental
Exec-Console $dotnetExe $args
$args = "build $fsiProject -c $configuration -v $verbosity -f netcoreapp2.1" + $argNoRestore + $argNoIncremental
$args = "build $fsiProject -c $configuration -v $verbosity -f netcoreapp3.0" + $argNoRestore + $argNoIncremental
Exec-Console $dotnetExe $args
}
}
......@@ -309,11 +314,6 @@ try {
if ($ci) {
Prepare-TempDir
EnablePreviewSdks
# enable us to build netcoreapp2.1 product binaries
$global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet"
InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet
InstallDotNetSdk $global:_DotNetInstallDir "2.1.503"
}
if ($bootstrap) {
......@@ -339,6 +339,7 @@ try {
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.DependencyManager.UnitTests\FSharp.DependencyManager.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework
......@@ -348,6 +349,7 @@ try {
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.DependencyManager.UnitTests\FSharp.DependencyManager.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework
......@@ -387,6 +389,13 @@ try {
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
}
if ($testDependencyManager) {
if (-not $noVisualStudio) {
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.DependencyManager.UnitTests\FSharp.DependencyManager.UnitTests.fsproj" -targetFramework $desktopTargetFramework
}
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.DependencyManager.UnitTests\FSharp.DependencyManager.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
}
if ($testCambridge) {
if (-not $noVisualStudio) {
TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework
......@@ -394,6 +403,13 @@ try {
TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework
}
if ($testScripting) {
if (-not $noVisualStudio) {
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $desktopTargetFramework
}
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
}
if ($testVs -and -not $noVisualStudio) {
TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\GetTypesVS.UnitTests\GetTypesVS.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $desktopTargetFramework
......
......@@ -3,9 +3,9 @@
<ProductDependencies>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19616.5">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20057.5">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>d4a1ce6278134f5dc25843e228d0498203031e61</Sha>
<Sha>d0833c8e5e58cfc507ce3c8da364e55931190263</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
......@@ -68,6 +68,7 @@
<!-- System.* packages -->
<SystemCollectionsImmutableVersion>1.5.0</SystemCollectionsImmutableVersion>
<SystemConsoleVersion>4.3.0</SystemConsoleVersion>
<SystemDataSqlClientPackageVersion>4.3.0</SystemDataSqlClientPackageVersion>
<SystemDesignVersion>4.0.0</SystemDesignVersion>
<SystemDiagnosticsProcessVersion>4.3.0</SystemDiagnosticsProcessVersion>
<SystemDiagnosticsTraceSourceVersion>4.3.0</SystemDiagnosticsTraceSourceVersion>
......@@ -88,6 +89,7 @@
<SystemSecurityClaimsVersion>4.3.0</SystemSecurityClaimsVersion>
<SystemSecurityCryptographyAlgorithmsVersion>4.3.0</SystemSecurityCryptographyAlgorithmsVersion>
<SystemSecurityPrincipalVersion>4.3.0</SystemSecurityPrincipalVersion>
<SystemThreadingTasksDataflowPackageVersion>4.6.0</SystemThreadingTasksDataflowPackageVersion>
<SystemThreadingTasksParallelVersion>4.3.0</SystemThreadingTasksParallelVersion>
<SystemThreadingTasksDataflow>4.11.0</SystemThreadingTasksDataflow>
<SystemThreadingThreadVersion>4.3.0</SystemThreadingThreadVersion>
......
......@@ -238,9 +238,9 @@ function Make-BootstrapBuild() {
# prepare FsLex and Fsyacc and AssemblyCheck
Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Publish /p:PublishWindowsPdb=false" -logFileName "BuildTools" -configuration $bootstrapConfiguration
Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fslex" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fsyacc" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\AssemblyCheck" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp3.0\publish" -Destination "$dir\fslex" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp3.0\publish" -Destination "$dir\fsyacc" -Force -Recurse
Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\netcoreapp3.0\publish" -Destination "$dir\AssemblyCheck" -Force -Recurse
# prepare compiler
$projectPath = "$RepoRoot\proto.proj"
......
......@@ -239,8 +239,8 @@ function BuildSolution {
}
mkdir -p "$bootstrap_dir"
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fslex
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fsyacc
cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp3.0/publish $bootstrap_dir/fslex
cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp3.0/publish $bootstrap_dir/fsyacc
fi
if [ ! -f "$bootstrap_dir/fsc.exe" ]; then
MSBuild "$repo_root/proto.proj" \
......@@ -252,7 +252,7 @@ function BuildSolution {
ExitWithExitCode $exit_code
}
cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fsc
cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp3.0/publish $bootstrap_dir/fsc
fi
# do real build
......@@ -280,11 +280,6 @@ function BuildSolution {
InitializeDotNetCli $restore
# enable us to build netcoreapp2.1 binaries
if [[ "$source_build" != true ]]; then
InstallDotNetSdk $_InitializeDotNetCli 2.1.503
fi
BuildSolution
if [[ "$test_core_clr" == true ]]; then
......@@ -292,6 +287,7 @@ if [[ "$test_core_clr" == true ]]; then
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj" --targetframework $coreclrtestframework
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.Private.Scripting.UnitTests/FSharp.Compiler.Private.Scripting.UnitTests.fsproj" --targetframework $coreclrtestframework
TestUsingNUnit --testproject "$repo_root/tests/FSharp.DependencyManager.UnitTests/FSharp.DependencyManager.UnitTests.fsproj" --targetframework $coreclrtestframework
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework
TestUsingNUnit --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework
fi
......
......@@ -14,6 +14,8 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
version='Latest'
architecture=''
runtime='dotnet'
runtimeSourceFeed=''
runtimeSourceFeedKey=''
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
......@@ -29,6 +31,14 @@ while [[ $# > 0 ]]; do
shift
runtime="$1"
;;
-runtimesourcefeed)
shift
runtimeSourceFeed="$1"
;;
-runtimesourcefeedkey)
shift
runtimeSourceFeedKey="$1"
;;
*)
echo "Invalid argument: $1"
exit 1
......
......@@ -29,7 +29,7 @@
</Target>
<Target Name="_GenerateBuildPropertiesFile"
Outputs="$(IntermediateOutputPath)$(ProjectName)\buildproperties.fs"
Outputs="$(IntermediateOutputPath)$(ProjectName).BuildProperties.fs"
BeforeTargets="BeforeBuild"
Condition="'$(Language)'=='F#'">
......@@ -44,15 +44,12 @@
<_BuildPropertyLines Include="let fsLanguageVersion = &quot;$(FSLANGUAGEVERSION)&quot;" />
</ItemGroup>
<MakeDir
Directories="$(IntermediateOutputPath)$(ProjectName)"
Condition="!Exists('$(IntermediateOutputPath)$(ProjectName)')" />
<WriteLinesToFile File="$(IntermediateOutputPath)$(ProjectName)\buildproperties.fs" Lines="@(_BuildPropertyLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<WriteLinesToFile File="$(IntermediateOutputPath)$(ProjectName).BuildProperties.fs" Lines="@(_BuildPropertyLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<!-- Make sure it will get cleaned -->
<ItemGroup>
<FileWrites Include="$(IntermediateOutputPath)$(ProjectName)\buildproperties.fs" />
<CompileBefore Include="$(IntermediateOutputPath)$(ProjectName)\buildproperties.fs" />
<FileWrites Include="$(IntermediateOutputPath)$(ProjectName).BuildProperties.fs" />
<CompileBefore Include="$(IntermediateOutputPath)$(ProjectName).BuildProperties.fs" />
</ItemGroup>
</Target>
......
......@@ -6,7 +6,7 @@ open System.Runtime.Serialization.Json
module Program =
#if !NETCOREAPP2_0
#if !NETCOREAPP
let addMSBuildv14BackupResolution () =
let onResolveEvent = new ResolveEventHandler(fun sender evArgs ->
let requestedAssembly = AssemblyName(evArgs.Name)
......@@ -40,7 +40,7 @@ module Program =
let asText = Array.exists (fun (s: string) -> s = "--text") argv
let argv = Array.filter (fun (s: string) -> s <> "--text") argv
#if !NETCOREAPP2_0
#if !NETCOREAPP
addMSBuildv14BackupResolution ()
#endif
crackAndSendOutput asText argv
......@@ -10,7 +10,7 @@ module internal ProjectCrackerTool =
open System.Collections.Generic
let runningOnMono =
#if NETCOREAPP2_0
#if NETCOREAPP
false
#else
try match System.Type.GetType("Mono.Runtime") with null -> false | _ -> true
......@@ -127,7 +127,7 @@ module internal ProjectCrackerTool =
outFileOpt, directory, getItems, references, projectReferences, getprop project, project.FullPath
#if !NETCOREAPP2_0
#if !NETCOREAPP
let CrackProjectUsingOldBuildAPI (fsprojFile:string) properties logOpt =
let engine = new Microsoft.Build.BuildEngine.Engine()
Option.iter (fun l -> engine.RegisterLogger(l)) logOpt
......@@ -200,7 +200,7 @@ module internal ProjectCrackerTool =
let outFileOpt, directory, getItems, references, projectReferences, getProp, fsprojFullPath =
try
#if NETCOREAPP2_0
#if NETCOREAPP
CrackProjectUsingNewBuildAPI fsprojFileName properties logOpt
with
#else
......
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\netfx.props" />
<PropertyGroup>
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp3.0</TargetFrameworks>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DefaultFSharpPackageVersion>4.1.19</DefaultFSharpPackageVersion>
<NoWarn>$(NoWarn);44;75;</NoWarn>
......@@ -11,7 +11,7 @@
<IsTestProject>true</IsTestProject>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <!-- Tests won't run without this, at least on OSX, see https://github.com/NuGet/Home/issues/4837#issuecomment-354536302 -->
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<DefineConstants>$(DefineConstants);NO_PROJECTCRACKER</DefineConstants>
</PropertyGroup>
<ItemGroup>
......@@ -66,7 +66,7 @@
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\TreeVisitorTests.fs">
<Link>TreeVisitorTests.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\Program.fs" Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<Compile Include="$(FSharpSourcesRoot)\..\tests\service\Program.fs" Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<Link>Program.fs</Link>
</Compile>
<NoneSubstituteText Include="App.config">
......@@ -101,6 +101,5 @@
<Reference Include="UIAutomationTypes" />
<ProjectReference Include="CSharp_Analysis\CSharp_Analysis.csproj" />
<ProjectReference Include="..\FSharp.Compiler.Service.ProjectCracker\FSharp.Compiler.Service.ProjectCracker.fsproj" />
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj" />
</ItemGroup>
</Project>
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\netfx.props" />
<Import Project="..\..\src\buildtools\buildtools.targets" />
<PropertyGroup>
......@@ -518,6 +519,12 @@
<Compile Include="$(FSharpSourcesRoot)/fsharp/DotNetFrameworkDependencies.fs">
<Link>Driver\DotNetFrameworkDependencies.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/DependencyManager.Integration.fsi">
<Link>Driver/DependencyManager.Integration.fsi</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/DependencyManager.Integration.fs">
<Link>Driver/DependencyManager.Integration.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/CompileOps.fsi">
<Link>Driver/CompileOps.fsi</Link>
</Compile>
......
......@@ -64,8 +64,8 @@ Target.create "BuildVersion" (fun _ ->
Target.create "Build" (fun _ ->
runDotnet __SOURCE_DIRECTORY__ "build" "../src/buildtools/buildtools.proj -v n -c Proto"
let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp2.1/fslex.dll"
let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp2.1/fsyacc.dll"
let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp3.0/fslex.dll"
let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp3.0/fsyacc.dll"
runDotnet __SOURCE_DIRECTORY__ "build" (sprintf "FSharp.Compiler.Service.sln -nodereuse:false -v n -c Release /p:DisableCompilerRedirection=true /p:FsLexPath=%s /p:FsYaccPath=%s" fslexPath fsyaccPath)
)
......
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\netfx.props" />
<PropertyGroup>
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>$(FcsTargetNetFxFramework);netcoreapp3.0</TargetFrameworks>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
......
......@@ -264,10 +264,6 @@ module Driver =
if runningOnMono && hasArgument "resident" argv then
let argv = stripArgument "resident" argv
//if not (hasArgument "nologo" argv) then
// printfn "%s" (FSComp.SR.buildProductName(FSharpEnvironment.FSharpTeamVersionNumber))
// printfn "%s" (FSComp.SR.optsCopyright())
let fscServerExe = typeof<TypeInThisAssembly>.Assembly.Location
let exitCodeOpt = FSharpResidentCompiler.FSharpCompilationServer.TryCompileUsingServer (fscServerExe, argv)
match exitCodeOpt with
......
......@@ -7,13 +7,13 @@
<ItemGroup>
<Projects Include="src\fsharp\FSharp.Build\FSharp.Build.fsproj">
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp2.1</AdditionalProperties>
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.0</AdditionalProperties>
</Projects>
<Projects Include="src\fsharp\fsc\fsc.fsproj">
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp2.1</AdditionalProperties>
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.0</AdditionalProperties>
</Projects>
<Projects Include="src\fsharp\fsi\fsi.fsproj">
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp2.1</AdditionalProperties>
<AdditionalProperties Condition="'$(OS)' == 'Unix'">TargetFramework=netcoreapp3.0</AdditionalProperties>
</Projects>
</ItemGroup>
......
......@@ -188,7 +188,7 @@ function GetHTTPResponse([Uri] $Uri)
}
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
# 10 minutes allows it to work over much slower connections.
$HttpClient.Timeout = New-TimeSpan -Minutes 20
$HttpClient.Timeout = New-TimeSpan -Minutes 40
$Response = $HttpClient.GetAsync($Uri).Result
if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode)))
{
......
......@@ -218,35 +218,26 @@ type RawByteMemory(addr: nativeptr<byte>, length: int, hold: obj) =
[<Struct;NoEquality;NoComparison>]
type ReadOnlyByteMemory(bytes: ByteMemory) =
member _.Item with [<MethodImpl(MethodImplOptions.AggressiveInlining)>] get i = bytes.[i]
member _.Item with get i = bytes.[i]
member _.Length with [<MethodImpl(MethodImplOptions.AggressiveInlining)>] get () = bytes.Length
member _.Length with get () = bytes.Length
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.ReadBytes(pos, count) = bytes.ReadBytes(pos, count)
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.ReadInt32 pos = bytes.ReadInt32 pos
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.ReadUInt16 pos = bytes.ReadUInt16 pos
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.ReadUtf8String(pos, count) = bytes.ReadUtf8String(pos, count)
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.Slice(pos, count) = bytes.Slice(pos, count) |> ReadOnlyByteMemory
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.CopyTo stream = bytes.CopyTo stream
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.Copy(srcOffset, dest, destOffset, count) = bytes.Copy(srcOffset, dest, destOffset, count)
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.ToArray() = bytes.ToArray()
[<MethodImpl(MethodImplOptions.AggressiveInlining)>]
member _.AsStream() = bytes.AsReadOnlyStream()
type ByteMemory with
......
......@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>
......
......@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant)</DefineConstants>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>
......
......@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<DefineConstants>INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant)</DefineConstants>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>
......
......@@ -4,6 +4,7 @@
/// on items from name resolution
module internal FSharp.Compiler.AttributeChecking
open System
open System.Collections.Generic
open FSharp.Compiler.AbstractIL.IL
open FSharp.Compiler.AbstractIL.Internal.Library
......@@ -246,7 +247,6 @@ let MethInfoHasAttribute g m attribSpec minfo =
|> Option.isSome
/// Check IL attributes for 'ObsoleteAttribute', returning errors and warnings as data
let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m =
let (AttribInfo(tref,_)) = g.attrib_SystemObsolete
......@@ -267,9 +267,16 @@ let private CheckILAttributes (g: TcGlobals) isByrefLikeTyconRef cattrs m =
/// Check F# attributes for 'ObsoleteAttribute', 'CompilerMessageAttribute' and 'ExperimentalAttribute',
/// returning errors and warnings as data
let CheckFSharpAttributes g attribs m =
if isNil attribs then CompleteD
else
let langVersionPrefix = "--langversion:preview"
let CheckFSharpAttributes (g:TcGlobals) attribs m =
let isExperimentalAttributeDisabled (s:string) =
if g.compilingFslib then
true
else
g.langVersion.IsPreviewEnabled && (s.IndexOf(langVersionPrefix, StringComparison.OrdinalIgnoreCase) >= 0)
if isNil attribs then CompleteD
else
(match TryFindFSharpAttribute g g.attrib_SystemObsolete attribs with
| Some(Attrib(_, _, [ AttribStringArg s ], _, _, _, _)) ->
WarnD(ObsoleteWarning(s, m))
......@@ -283,28 +290,30 @@ let CheckFSharpAttributes g attribs m =
| None ->
CompleteD
) ++ (fun () ->
match TryFindFSharpAttribute g g.attrib_CompilerMessageAttribute attribs with
| Some(Attrib(_, _, [ AttribStringArg s ; AttribInt32Arg n ], namedArgs, _, _, _)) ->
| Some(Attrib(_, _, [ AttribStringArg s ; AttribInt32Arg n ], namedArgs, _, _, _)) ->
let msg = UserCompilerMessage(s, n, m)
let isError =
match namedArgs with
| ExtractAttribNamedArg "IsError" (AttribBoolArg v) -> v
| _ -> false
if isError && (not g.compilingFslib || n <> 1204) then ErrorD msg else WarnD msg
| _ ->
CompleteD
) ++ (fun () ->
match TryFindFSharpAttribute g g.attrib_ExperimentalAttribute attribs with
| Some(Attrib(_, _, [ AttribStringArg(s) ], _, _, _, _)) ->
WarnD(Experimental(s, m))
| Some _ ->
| Some(Attrib(_, _, [ AttribStringArg(s) ], _, _, _, _)) ->
if isExperimentalAttributeDisabled s then
CompleteD
else
WarnD(Experimental(s, m))
| Some _ ->
WarnD(Experimental(FSComp.SR.experimentalConstruct (), m))
| _ ->
| _ ->
CompleteD
) ++ (fun () ->
) ++ (fun () ->
match TryFindFSharpAttribute g g.attrib_UnverifiableAttribute attribs with
| Some _ ->
......
此差异已折叠。
......@@ -268,9 +268,11 @@ type TcConfigBuilder =
mutable light: bool option
mutable conditionalCompilationDefines: string list
/// Sources added into the build with #load
mutable loadedSources: (range * string) list
mutable loadedSources: (range * string * string) list
mutable compilerToolPaths: string list
mutable referencedDLLs: AssemblyReference list
mutable packageManagerLines: Map<string, (bool * string * range) list>
mutable projectReferences: IProjectReference list
mutable knownUnresolvedReferences: UnresolvedAssemblyReference list
reduceMemoryUsage: ReduceMemoryFlag
......@@ -282,6 +284,7 @@ type TcConfigBuilder =
mutable mlCompatibility:bool
mutable checkOverflow:bool
mutable showReferenceResolutions:bool
mutable outputDir: string option
mutable outputFile: string option
mutable platform: ILPlatform option
mutable prefer32Bit: bool
......@@ -386,6 +389,8 @@ type TcConfigBuilder =
mutable pathMap : PathMap
mutable langVersion : LanguageVersion
mutable includePathAdded : string -> unit
}
static member Initial: TcConfigBuilder
......@@ -398,13 +403,15 @@ type TcConfigBuilder =
isInteractive: bool *
isInvalidationSupported: bool *
defaultCopyFSharpCore: CopyFSharpCoreFlag *
tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot
tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot *
?includePathAdded: (string -> unit)
-> TcConfigBuilder
member DecideNames: string list -> outfile: string * pdbfile: string option * assemblyName: string
member TurnWarningOff: range * string -> unit
member TurnWarningOn: range * string -> unit
member AddIncludePath: range * string * string -> unit
member AddCompilerToolsByPath: string -> unit
member AddReferencedAssemblyByPath: range * string -> unit
member RemoveReferencedAssemblyByPath: range * string -> unit
member AddEmbeddedSourceFile: string -> unit
......@@ -434,6 +441,7 @@ type TcConfig =
member conditionalCompilationDefines: string list
member subsystemVersion: int * int
member useHighEntropyVA: bool
member compilerToolPaths: string list
member referencedDLLs: AssemblyReference list
member reduceMemoryUsage: ReduceMemoryFlag
member inputCodePage: int option
......@@ -442,6 +450,7 @@ type TcConfig =
member mlCompatibility:bool
member checkOverflow:bool
member showReferenceResolutions:bool
member outputDir: string option
member outputFile: string option
member platform: ILPlatform option
member prefer32Bit: bool
......@@ -678,8 +687,8 @@ val WriteOptimizationData: TcGlobals * filename: string * inMem: bool * CcuThunk
val RequireDLL: CompilationThreadToken * TcImports * TcEnv * thisAssemblyName: string * referenceRange: range * file: string * assemblyReferenceAdded: (string -> unit) -> TcEnv * (ImportedBinary list * ImportedAssembly list)
/// Processing # commands
val ProcessMetaCommandsFromInput:
(('T -> range * string -> 'T) * ('T -> range * string -> 'T) * ('T -> range * string -> unit))
val ProcessMetaCommandsFromInput :
(('T -> range * string -> 'T) * ('T -> range * string -> 'T) * ('T -> DependencyManagerIntegration.IDependencyManagerProvider * range * string -> 'T) * ('T -> range * string -> unit))
-> TcConfigBuilder * Ast.ParsedInput * string * 'T
-> 'T
......@@ -800,7 +809,7 @@ type LoadClosure =
Inputs: LoadClosureInput list
/// The original #load references, including those that didn't resolve
OriginalLoadReferences: (range * string) list
OriginalLoadReferences: (range * string * string) list
/// The #nowarns
NoWarns: (string * range list) list
......
......@@ -6,6 +6,7 @@ module internal FSharp.Compiler.CompileOptions
open Internal.Utilities
open System
open System.IO
open FSharp.Compiler
open FSharp.Compiler.AbstractIL
open FSharp.Compiler.AbstractIL.IL
......@@ -502,8 +503,10 @@ let SetDebugSwitch (tcConfigB: TcConfigBuilder) (dtype: string option) (s: Optio
let SetEmbedAllSourceSwitch (tcConfigB: TcConfigBuilder) switch =
if (switch = OptionSwitch.On) then tcConfigB.embedAllSource <- true else tcConfigB.embedAllSource <- false
let setOutFileName tcConfigB s =
tcConfigB.outputFile <- Some s
let setOutFileName tcConfigB path =
let outputDir = Path.GetDirectoryName(path)
tcConfigB.outputDir <- Some outputDir
tcConfigB.outputFile <- Some path
let setSignatureFile tcConfigB s =
tcConfigB.printSignature <- true
......@@ -559,17 +562,24 @@ let PrintOptionInfo (tcConfigB:TcConfigBuilder) =
// OptionBlock: Input files
//-------------------------
let inputFileFlagsBoth (tcConfigB: TcConfigBuilder) =
[ CompilerOption("reference", tagFile, OptionString (fun s -> tcConfigB.AddReferencedAssemblyByPath (rangeStartup, s)), None, Some (FSComp.SR.optsReference()))
let inputFileFlagsBoth (tcConfigB : TcConfigBuilder) = [
CompilerOption("reference", tagFile, OptionString (fun s -> tcConfigB.AddReferencedAssemblyByPath (rangeStartup, s)), None, Some (FSComp.SR.optsReference()))
CompilerOption("compilertool", tagFile, OptionString (fun s -> tcConfigB.AddCompilerToolsByPath s), None, Some (FSComp.SR.optsCompilerTool()))
]
let inputFileFlagsFsc tcConfigB = inputFileFlagsBoth tcConfigB
let referenceFlagAbbrev (tcConfigB : TcConfigBuilder) =
CompilerOption("r", tagFile, OptionString (fun s -> tcConfigB.AddReferencedAssemblyByPath (rangeStartup, s)), None, Some(FSComp.SR.optsShortFormOf("--reference")))
let compilerToolFlagAbbrev (tcConfigB : TcConfigBuilder) =
CompilerOption("t", tagFile, OptionString (fun s -> tcConfigB.AddCompilerToolsByPath s), None, Some(FSComp.SR.optsShortFormOf("--compilertool")))
let inputFileFlagsFsc tcConfigB = inputFileFlagsBoth tcConfigB
let inputFileFlagsFsiBase (_tcConfigB: TcConfigBuilder) =
#if NETSTANDARD
[ CompilerOption("usesdkrefs", tagNone, OptionSwitch (SetUseSdkSwitch _tcConfigB), None, Some (FSComp.SR.useSdkRefs())) ]
[ CompilerOption("usesdkrefs", tagNone, OptionSwitch (SetUseSdkSwitch _tcConfigB), None, Some (FSComp.SR.useSdkRefs())) ]
#else
List.empty<CompilerOption>
List.empty<CompilerOption>
#endif
let inputFileFlagsFsi (tcConfigB: TcConfigBuilder) =
......
......@@ -2,6 +2,7 @@
module internal FSharp.Compiler.CompileOptions
open System
open FSharp.Compiler
open FSharp.Compiler.AbstractIL.Internal.Library
open FSharp.Compiler.CompileOps
......@@ -12,7 +13,7 @@ open FSharp.Compiler.TcGlobals
//----------------------------------------------------------------------------
// Compiler Option Parser
//--------------------------------------------------------------------------
//----------------------------------------------------------------------------
// For command-line options that can be suffixed with +/-
[<RequireQualifiedAccess>]
......@@ -89,7 +90,7 @@ val NormalizeAssemblyRefs : CompilationThreadToken * TcImports -> (AbstractIL.IL
// Miscellany
val ignoreFailureOnMono1_1_16 : (unit -> unit) -> unit
val mutable enableConsoleColoring : bool
val DoWithColor : System.ConsoleColor -> (unit -> 'a) -> 'a
val DoWithColor : ConsoleColor -> (unit -> 'a) -> 'a
val DoWithErrorColor : bool -> (unit -> 'a) -> 'a
val ReportTime : TcConfig -> string -> unit
val GetAbbrevFlagSet : TcConfigBuilder -> bool -> Set<string>
......
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
/// Helper members to integrate DependencyManagers into F# codebase
module internal FSharp.Compiler.DependencyManagerIntegration
open System
open System.IO
open System.Reflection
open FSharp.Compiler.DotNetFrameworkDependencies
open FSharp.Compiler.ErrorLogger
open Internal.Utilities.FSharpEnvironment
// Contract strings
let dependencyManagerPattern = "*DependencyManager*.dll"
let dependencyManagerAttributeName= "DependencyManagerAttribute"
let resolveDependenciesMethodName = "ResolveDependencies"
let namePropertyName = "Name"
let keyPropertyName = "Key"
module ReflectionHelper =
let assemblyHasAttribute (theAssembly: Assembly) attributeName =
try
CustomAttributeExtensions.GetCustomAttributes(theAssembly)
|> Seq.exists (fun a -> a.GetType().Name = attributeName)
with | _ -> false
let getAttributeNamed (theType: Type) attributeName =
try
theType.GetTypeInfo().GetCustomAttributes false
|> Seq.tryFind (fun a -> a.GetType().Name = attributeName)
with | _ -> None
let getInstanceProperty<'treturn> (theType: Type) propertyName =
try
let property = theType.GetProperty(propertyName, typeof<'treturn>)
if isNull property then
None
elif not (property.GetGetMethod().IsStatic)
&& property.GetIndexParameters() = Array.empty
then
Some property
else
None
with | _ -> None
let getInstanceMethod<'treturn> (theType: Type) (parameterTypes: Type array) methodName =
try
let theMethod = theType.GetMethod(methodName, parameterTypes)
if isNull theMethod then
None
else
Some theMethod
with | _ -> None
let stripTieWrapper (e:Exception) =
match e with
| :? TargetInvocationException as e->
e.InnerException
| _ -> e
(* Shape of Dependency Manager contract, resolved using reflection *)
type internal IDependencyManagerProvider =
abstract Name: string
abstract Key: string
abstract ResolveDependencies: scriptDir: string * mainScriptName: string * scriptName: string * packageManagerTextLines: string seq * tfm: string -> bool * string list * string list
abstract DependencyAdding: IEvent<string * string>
abstract DependencyAdded: IEvent<string * string>
abstract DependencyFailed: IEvent<string * string>
[<RequireQualifiedAccess>]
type ReferenceType =
| RegisteredDependencyManager of IDependencyManagerProvider
| Library of string
| UnknownType
type ReflectionDependencyManagerProvider(theType: Type, nameProperty: PropertyInfo, keyProperty: PropertyInfo, resolveDeps: MethodInfo, outputDir: string option) =
let instance = Activator.CreateInstance(theType, [|outputDir :> obj|])
let nameProperty = nameProperty.GetValue >> string
let keyProperty = keyProperty.GetValue >> string
let dependencyAddingEvent = Event<_>()
let dependencyAddedEvent = Event<_>()
let dependencyFailedEvent = Event<_>()
static member InstanceMaker (theType: System.Type, outputDir: string option) =
match ReflectionHelper.getAttributeNamed theType dependencyManagerAttributeName,
ReflectionHelper.getInstanceProperty<string> theType namePropertyName,
ReflectionHelper.getInstanceProperty<string> theType keyPropertyName,
ReflectionHelper.getInstanceMethod<bool * string list * string list> theType [| typeof<string>; typeof<string>; typeof<string>; typeof<string seq>; typeof<string> |] resolveDependenciesMethodName
with
| None, _, _, _ -> None
| _, None, _, _ -> None
| _, _, None, _ -> None
| _, _, _, None -> None
| Some _, Some nameProperty, Some keyProperty, Some resolveDependenciesMethod ->
Some (fun () -> new ReflectionDependencyManagerProvider(theType, nameProperty, keyProperty, resolveDependenciesMethod, outputDir) :> IDependencyManagerProvider)
interface IDependencyManagerProvider with
member __.Name = instance |> nameProperty
member __.Key = instance |> keyProperty
member this.ResolveDependencies(scriptDir, mainScriptName, scriptName, packageManagerTextLines, tfm) =
let key = (this :> IDependencyManagerProvider).Key
let triggerEvent (evt: Event<string * string>) =
for prLine in packageManagerTextLines do
evt.Trigger(key, prLine)
triggerEvent dependencyAddingEvent
let arguments = [| box scriptDir; box mainScriptName; box scriptName; box packageManagerTextLines; box tfm |]
let succeeded, generatedScripts, additionalIncludeFolders = resolveDeps.Invoke(instance, arguments) :?> _
if succeeded then triggerEvent dependencyAddedEvent
else triggerEvent dependencyFailedEvent
succeeded, generatedScripts, additionalIncludeFolders
member __.DependencyAdding = dependencyAddingEvent.Publish
member __.DependencyAdded = dependencyAddedEvent.Publish
member __.DependencyFailed = dependencyFailedEvent.Publish
// Resolution Path = Location of FSharp.Compiler.Private.dll
let assemblySearchPaths = lazy (
[
let assemblyLocation = typeof<IDependencyManagerProvider>.GetTypeInfo().Assembly.Location
yield Path.GetDirectoryName assemblyLocation
yield AppDomain.CurrentDomain.BaseDirectory
])
let enumerateDependencyManagerAssemblies compilerTools m =
getCompilerToolsDesignTimeAssemblyPaths compilerTools
|> Seq.append (assemblySearchPaths.Force())
|> Seq.collect (fun path ->
try
if Directory.Exists(path) then Directory.EnumerateFiles(path, dependencyManagerPattern)
else Seq.empty
with _ -> Seq.empty)
|> Seq.choose (fun path ->
try
Some(AbstractIL.Internal.Library.Shim.FileSystem.AssemblyLoadFrom path)
with
| e ->
let e = ReflectionHelper.stripTieWrapper e
warning(Error(FSComp.SR.couldNotLoadDependencyManagerExtension(path,e.Message),m))
None)
|> Seq.filter (fun a -> ReflectionHelper.assemblyHasAttribute a dependencyManagerAttributeName)
let registeredDependencyManagers = ref None
let RegisteredDependencyManagers (compilerTools: string list) (outputDir: string option) m =
match !registeredDependencyManagers with
| Some managers -> managers
| None ->
let defaultProviders =[]
let loadedProviders =
enumerateDependencyManagerAssemblies compilerTools m
|> Seq.collect (fun a -> a.GetTypes())
|> Seq.choose (fun t -> ReflectionDependencyManagerProvider.InstanceMaker(t, outputDir))
|> Seq.map (fun maker -> maker ())
defaultProviders
|> Seq.append loadedProviders
|> Seq.map (fun pm -> pm.Key, pm)
|> Map.ofSeq
let createPackageManagerUnknownError (compilerTools: string list) (outputDir:string option) packageManagerKey m =
let registeredKeys = String.Join(", ", RegisteredDependencyManagers compilerTools outputDir m |> Seq.map (fun kv -> kv.Value.Key))
let searchPaths = assemblySearchPaths.Force()
Error(FSComp.SR.packageManagerUnknown(packageManagerKey, String.Join(", ", searchPaths, compilerTools), registeredKeys),m)
let tryFindDependencyManagerInPath (compilerTools:string list) (outputDir:string option) m (path:string) : ReferenceType =
try
if path.Contains ":" && not (System.IO.Path.IsPathRooted path) then
let managers = RegisteredDependencyManagers compilerTools outputDir m
match managers |> Seq.tryFind (fun kv -> path.StartsWith(kv.Value.Key + ":" )) with
| None ->
errorR(createPackageManagerUnknownError compilerTools outputDir (path.Split(':').[0]) m)
ReferenceType.UnknownType
| Some kv -> ReferenceType.RegisteredDependencyManager kv.Value
else
ReferenceType.Library path
with
| e ->
let e = ReflectionHelper.stripTieWrapper e
errorR(Error(FSComp.SR.packageManagerError(e.Message),m))
ReferenceType.UnknownType
let removeDependencyManagerKey (packageManagerKey:string) (path:string) = path.Substring(packageManagerKey.Length + 1).Trim()
let tryFindDependencyManagerByKey (compilerTools: string list) (outputDir:string option) m (key:string) : IDependencyManagerProvider option =
try
RegisteredDependencyManagers compilerTools outputDir m |> Map.tryFind key
with
| e ->
let e = ReflectionHelper.stripTieWrapper e
errorR(Error(FSComp.SR.packageManagerError(e.Message), m))
None
let resolve (packageManager:IDependencyManagerProvider) implicitIncludeDir mainScriptName fileName m packageManagerTextLines =
try
Some(packageManager.ResolveDependencies(implicitIncludeDir, mainScriptName, fileName, packageManagerTextLines, executionTfm))
with e ->
let e = ReflectionHelper.stripTieWrapper e
errorR(Error(FSComp.SR.packageManagerError(e.Message), m))
None
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
/// Helper members to integrate DependencyManagers into F# codebase
module internal FSharp.Compiler.DependencyManagerIntegration
open FSharp.Compiler.Range
type IDependencyManagerProvider =
abstract Name: string
abstract Key: string
abstract ResolveDependencies: scriptDir: string * mainScriptName: string * scriptName: string * packageManagerTextLines: string seq * tfm: string -> bool * string list * string list
abstract DependencyAdding: IEvent<string * string>
abstract DependencyAdded: IEvent<string * string>
abstract DependencyFailed: IEvent<string * string>
[<RequireQualifiedAccess>]
type ReferenceType =
| RegisteredDependencyManager of IDependencyManagerProvider
| Library of string
| UnknownType
val tryFindDependencyManagerInPath: string list -> string option -> range -> string -> ReferenceType
val tryFindDependencyManagerByKey: string list -> string option -> range -> string -> IDependencyManagerProvider option
val removeDependencyManagerKey: string -> string -> string
val createPackageManagerUnknownError: string list -> string option -> string -> range -> exn
val resolve: IDependencyManagerProvider -> string -> string -> string -> range -> string seq -> (bool * string list * string list) option
......@@ -13,7 +13,6 @@ module internal FSharp.Compiler.DotNetFrameworkDependencies
type private TypeInThisAssembly = class end
let implementationAssemblyDir = Path.GetDirectoryName(typeof<obj>.Assembly.Location)
let fSharpCompilerLocation =
let location = Path.GetDirectoryName(typeof<TypeInThisAssembly>.Assembly.Location)
match FSharpEnvironment.BinFolderOfDefaultFSharpCompiler (Some location) with
......@@ -29,6 +28,8 @@ module internal FSharp.Compiler.DotNetFrameworkDependencies
let getFsiLibraryName = "FSharp.Compiler.Interactive.Settings"
let getDefaultFSharpCoreLocation = Path.Combine(fSharpCompilerLocation, getFSharpCoreLibraryName + ".dll")
let getDefaultFsiLibraryLocation = Path.Combine(fSharpCompilerLocation, getFsiLibraryName + ".dll")
let implementationAssemblyDir = Path.GetDirectoryName(typeof<obj>.Assembly.Location)
let isRunningOnCoreClr = (typeof<obj>.Assembly).FullName.StartsWith("System.Private.CoreLib", StringComparison.InvariantCultureIgnoreCase)
// Use the ValueTuple that is executing with the compiler if it is from System.ValueTuple
// or the System.ValueTuple.dll that sits alongside the compiler. (Note we always ship one with the compiler)
......@@ -67,6 +68,90 @@ module internal FSharp.Compiler.DotNetFrameworkDependencies
Some version, None
with | _ -> None, None
// Tries to figure out the tfm for the compiler instance.
// On coreclr it uses the deps.json file
let netcoreTfm =
let file =
try
let asm = Assembly.GetEntryAssembly()
match asm with
| null -> ""
| asm ->
let depsJsonPath = Path.ChangeExtension(asm.Location, "deps.json")
if File.Exists(depsJsonPath) then
File.ReadAllText(depsJsonPath)
else
""
with _ -> ""
let tfmPrefix=".NETCoreApp,Version=v"
let pattern = "\"name\": \"" + tfmPrefix
let startPos =
let startPos = file.IndexOf(pattern, StringComparison.OrdinalIgnoreCase)
if startPos >= 0 then startPos + (pattern.Length) else startPos
let length =
if startPos >= 0 then
let ep = file.IndexOf("\"", startPos)
if ep >= 0 then ep - startPos else ep
else -1
match startPos, length with
| -1, _
| _, -1 ->
if isRunningOnCoreClr then
// Running on coreclr but no deps.json was deployed with the host so default to 3.0
Some "netcoreapp3.0"
else
// Running on desktop
None
| pos, length ->
// use value from the deps.json file
Some ("netcoreapp" + file.Substring(pos, length))
// Tries to figure out the tfm for the compiler instance on the Windows desktop.
// On full clr it uses the mscorlib version number
let getWindowsDesktopTfm () =
let defaultMscorlibVersion = 4,8,3815,0
let desktopProductVersionMonikers = [|
// major, minor, build, revision, moniker
4, 8, 3815, 0, "net48"
4, 7, 3190, 0, "net472"
4, 7, 2600, 0, "net471"
4, 7, 2053, 0, "net47"
4, 6, 1590, 0, "net462"
4, 6, 1055, 0, "net461"
4, 6, 81, 0, "net46"
4, 0, 30319, 34209, "net452"
4, 0, 30319, 18408, "net451"
4, 0, 30319, 17929, "net45"
4, 0, 30319, 1, "net4"
|]
let majorPart, minorPart, buildPart, privatePart=
try
let attrOpt = typeof<Object>.Assembly.GetCustomAttributes(typeof<AssemblyFileVersionAttribute>) |> Seq.tryHead
match attrOpt with
| Some attr ->
let fv = (downcast attr : AssemblyFileVersionAttribute).Version.Split([|'.'|]) |> Array.map(fun e -> Int32.Parse(e))
fv.[0], fv.[1], fv.[2], fv.[3]
| _ -> defaultMscorlibVersion
with _ -> defaultMscorlibVersion
// Get the ProductVersion of this framework compare with table yield compatible monikers
let _, _, _, _, moniker =
desktopProductVersionMonikers
|> Array.find (fun (major, minor, build, revision, _) ->
(majorPart >= major) &&
(minorPart >= minor) &&
(buildPart >= build) &&
(privatePart >= revision))
moniker
/// Gets the tfm E.g netcore3.0, net472
let executionTfm =
match netcoreTfm with
| Some tfm -> tfm
| _ -> getWindowsDesktopTfm ()
let isInReferenceAssemblyPackDirectory filename =
match frameworkRefsPackDirectoryRoot with
| Some root ->
......
......@@ -16,11 +16,14 @@ module internal ExtensionTyping =
open FSharp.Compiler.Range
open FSharp.Compiler.AbstractIL.IL
open FSharp.Compiler.AbstractIL.Internal.Library // frontAndBack
open Internal.Utilities.FSharpEnvironment
type TypeProviderDesignation = TypeProviderDesignation of string
exception ProvidedTypeResolution of range * System.Exception
exception ProvidedTypeResolutionNoRange of System.Exception
exception ProvidedTypeResolution of range * System.Exception
exception ProvidedTypeResolutionNoRange of System.Exception
let toolingCompatiblePaths() = toolingCompatiblePaths ()
/// Represents some of the configuration parameters passed to type provider components
type ResolutionEnvironment =
......@@ -28,101 +31,18 @@ module internal ExtensionTyping =
outputFile : string option
showResolutionMessages : bool
referencedAssemblies : string[]
temporaryFolder : string }
// Specify the tooling-compatible fragments of a path such as:
// typeproviders/fsharp41/net461/MyProvider.DesignTime.dll
// tools/fsharp41/net461/MyProvider.DesignTime.dll
// See https://github.com/Microsoft/visualfsharp/issues/3736
// Represents the FF#-compiler <-> type provider protocol.
// When the API or protocol updates, add a new version moniker to the front of the list here.
let toolingCompatibleTypeProviderProtocolMonikers() =
[ "fsharp41" ]
// Detect the host tooling context
let toolingCompatibleVersions() =
if typeof<obj>.Assembly.GetName().Name = "mscorlib" then
[ "net461"; "net452"; "net451"; "net45"; "netstandard2.0"]
elif typeof<obj>.Assembly.GetName().Name = "System.Private.CoreLib" then
[ "netcoreapp2.0"; "netstandard2.0"]
else
System.Diagnostics.Debug.Assert(false, "Couldn't determine runtime tooling context, assuming it supports at least .NET Standard 2.0")
[ "netstandard2.0"]
let toolingCompatiblePaths() =
[ for protocol in toolingCompatibleTypeProviderProtocolMonikers() do
for netRuntime in toolingCompatibleVersions() do
yield Path.Combine("typeproviders", protocol, netRuntime)
yield Path.Combine("tools", protocol, netRuntime)
]
temporaryFolder : string }
/// Load a the design-time part of a type-provider into the host process, and look for types
/// marked with the TypeProviderAttribute attribute.
let GetTypeProviderImplementationTypes (runTimeAssemblyFileName, designTimeAssemblyNameString, m: range) =
let GetTypeProviderImplementationTypes (runTimeAssemblyFileName, designTimeAssemblyNameString, m:range, compilerToolPaths:string list) =
// Report an error, blaming the particular type provider component
let raiseError (e: exn) =
raise (TypeProviderError(FSComp.SR.etProviderHasWrongDesignerAssembly(typeof<TypeProviderAssemblyAttribute>.Name, designTimeAssemblyNameString, e.Message), runTimeAssemblyFileName, m))
// Find and load the designer assembly for the type provider component.
//
// We look in the directories stepping up from the location of the runtime assembly.
let loadFromLocation designTimeAssemblyPath =
try
Some (FileSystem.AssemblyLoadFrom designTimeAssemblyPath)
with e ->
raiseError e
let designTimeAssemblyOpt = getTypeProviderAssembly (runTimeAssemblyFileName, designTimeAssemblyNameString, compilerToolPaths, raiseError)
let rec searchParentDirChain dir designTimeAssemblyName =
seq {
for subdir in toolingCompatiblePaths() do
let designTimeAssemblyPath = Path.Combine (dir, subdir, designTimeAssemblyName)
if FileSystem.SafeExists designTimeAssemblyPath then
yield loadFromLocation designTimeAssemblyPath
match Path.GetDirectoryName dir with
| s when s = "" || s = null || Path.GetFileName dir = "packages" || s = dir -> ()
| parentDir -> yield! searchParentDirChain parentDir designTimeAssemblyName
}
let loadFromParentDirRelativeToRuntimeAssemblyLocation designTimeAssemblyName =
let runTimeAssemblyPath = Path.GetDirectoryName runTimeAssemblyFileName
searchParentDirChain runTimeAssemblyPath designTimeAssemblyName
|> Seq.tryHead
|> function
| Some res -> res
| None ->
// The search failed, just load from the first location and report an error
let runTimeAssemblyPath = Path.GetDirectoryName runTimeAssemblyFileName
loadFromLocation (Path.Combine (runTimeAssemblyPath, designTimeAssemblyName))
let designTimeAssemblyOpt =
if designTimeAssemblyNameString.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) then
loadFromParentDirRelativeToRuntimeAssemblyLocation designTimeAssemblyNameString
else
// Cover the case where the ".dll" extension has been left off and no version etc. has been used in the assembly
// string specification. The Name=FullName comparison is particularly strange, and was there to support
// design-time DLLs specified using "x.DesignTIme, Version= ..." long assembly names and GAC loads.
// These kind of design-time assembly specifications are no longer used to our knowledge so that comparison is basically legacy
// and will always succeed.
let name = System.Reflection.AssemblyName (Path.GetFileNameWithoutExtension designTimeAssemblyNameString)
if name.Name.Equals(name.FullName, StringComparison.OrdinalIgnoreCase) then
let designTimeAssemblyName = designTimeAssemblyNameString+".dll"
loadFromParentDirRelativeToRuntimeAssemblyLocation designTimeAssemblyName
else
// Load from the GAC using Assembly.Load. This is legacy since type provider design-time components are
// never in the GAC these days and "x.DesignTIme, Version= ..." specifications are never used.
try
let asmName = System.Reflection.AssemblyName designTimeAssemblyNameString
Some (FileSystem.AssemblyLoad asmName)
with e ->
raiseError e
// If we've find a design-time assembly, look for the public types with TypeProviderAttribute
match designTimeAssemblyOpt with
| Some loadedDesignTimeAssembly ->
try
......@@ -193,7 +113,8 @@ module internal ExtensionTyping =
isInteractive: bool,
systemRuntimeContainsType : string -> bool,
systemRuntimeAssemblyVersion : System.Version,
m: range) =
compilerToolPaths: string list,
m:range) =
let providerSpecs =
try
......@@ -213,7 +134,7 @@ module internal ExtensionTyping =
| Some designTimeAssemblyName, Some path when String.Compare(designTimeAssemblyName.Name, Path.GetFileNameWithoutExtension path, StringComparison.OrdinalIgnoreCase) = 0 ->
()
| Some _, _ ->
for t in GetTypeProviderImplementationTypes (runTimeAssemblyFileName, designTimeAssemblyNameString, m) do
for t in GetTypeProviderImplementationTypes (runTimeAssemblyFileName, designTimeAssemblyNameString, m, compilerToolPaths) do
let resolver = CreateTypeProvider (t, runTimeAssemblyFileName, resolutionEnvironment, isInvalidationSupported, isInteractive, systemRuntimeContainsType, systemRuntimeAssemblyVersion, m)
match box resolver with
| null -> ()
......@@ -222,7 +143,7 @@ module internal ExtensionTyping =
() ]
with :? TypeProviderError as tpe ->
tpe.Iter(fun e -> errorR(NumberedError((e.Number, e.ContextualErrorMessage), m)) )
tpe.Iter(fun e -> errorR(NumberedError((e.Number, e.ContextualErrorMessage), m)) )
[]
let providers = Tainted<_>.CreateAll providerSpecs
......
......@@ -54,6 +54,7 @@ module internal ExtensionTyping =
* isInteractive: bool
* systemRuntimeContainsType : (string -> bool)
* systemRuntimeAssemblyVersion : System.Version
* compilerToolsPath : string list
* range -> Tainted<ITypeProvider> list
/// Given an extension type resolver, supply a human-readable name suitable for error messages.
......
......@@ -845,6 +845,7 @@ optsNoOpt,"Only include optimization information essential for implementing inli
optsNoInterface,"Don't add a resource to the generated assembly containing F#-specific metadata"
optsSig,"Print the inferred interface of the assembly to a file"
optsReference,"Reference an assembly (Short form: -r)"
optsCompilerTool,"Reference an assembly or directory containing a design time tool (Short form: -t)"
optsWin32res,"Specify a Win32 resource file (.res)"
optsWin32manifest,"Specify a Win32 manifest file"
optsNowin32manifest,"Do not include the default Win32 manifest"
......@@ -1351,6 +1352,8 @@ tcGlobalsSystemTypeNotFound,"The system type '%s' was required but no referenced
3213,typrelMemberHasMultiplePossibleDispatchSlots,"The member '%s' matches multiple overloads of the same method.\nPlease restrict it to one of the following:%s."
3214,methodIsNotStatic,"Method or object constructor '%s' is not static"
3215,parsUnexpectedSymbolEqualsInsteadOfIn,"Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead?"
3216,packageManagerUnknown,"Package manager key '%s' was not registered in %s. Currently registered: %s"
3217,packageManagerError,"%s"
tcAnonRecdCcuMismatch,"Two anonymous record types are from different assemblies '%s' and '%s'"
tcAnonRecdFieldNameMismatch,"This anonymous record does not exactly match the expected shape. Add the missing fields %s and remove the extra fields %s."
tcAnonRecdFieldNameSubset,"This anonymous record does not have enough fields. Add the missing fields %s."
......@@ -1465,13 +1468,16 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl
3244,parsInvalidAnonRecdType,"Invalid anonymous record type"
3245,tcCopyAndUpdateNeedsRecordType,"The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record"
3246,tcAugmentationsCannotHaveAttributes,"Attributes cannot be applied to type extensions."
3247,couldNotLoadDependencyManagerExtension,"The dependency manager extension %s could not be loaded. Message: %s"
3250,expressionHasNoName,"Expression does not have a name."
3251,chkNoFirstClassNameOf,"Using the 'nameof' operator as a first-class function value is not permitted."
3300,chkInvalidFunctionParameterType,"The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL."
3301,chkInvalidFunctionReturnType,"The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL."
3302,packageManagementRequiresVFive,"The package management feature requires language version 5.0 use /langversion:preview"
3303,fromEndSlicingRequiresVFive,"From the end slicing with requires language version 5.0, use /langversion:preview."
useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)."
fSharpBannerVersion,"%s for F# %s"
nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format."
nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed."
optsLangVersion,"Display the allowed values for language version, specify language version such as 'latest' or 'preview'"
optsSupportedLangVersions,"Supported language versions:"
nativeResourceFormatError,"Stream does not begin with a null resource and is not in '.RES' format."
nativeResourceHeaderMalformed,"Resource header beginning at offset %s is malformed."
......@@ -324,6 +324,9 @@
<data name="Parser.TOKEN.DOT.DOT" xml:space="preserve">
<value>symbol '..'</value>
</data>
<data name="Parser.TOKEN.DOT.DOT.HAT" xml:space="preserve">
<value>symbol '..^'</value>
</data>
<data name="Parser.TOKEN.QUOTE" xml:space="preserve">
<value>quote symbol</value>
</data>
......
......@@ -5,8 +5,8 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks Condition="'$(ProtoTargetFramework)' != ''">$(ProtoTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(ProtoTargetFramework)' == ''">net472;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(ProtoTargetFramework)' == ''">net472;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netcoreapp3.0</TargetFrameworks>
<AssemblyName>FSharp.Build</AssemblyName>
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
......@@ -32,10 +32,10 @@
<None Include="Microsoft.FSharp.NetSdk.targets" CopyToOutputDirectory="PreserveNewest" />
<NoneSubstituteText Include="Microsoft.FSharp.NetSdk.props" CopyToOutputDirectory="PreserveNewest">
<TargetFileName>Microsoft.FSharp.NetSdk.props</TargetFileName>
<Pattern1>{{FSharpCoreShippedPackageVersion}}</Pattern1>
<Replacement1>$(FSharpCoreShippedPackageVersion)</Replacement1>
<Pattern2>{{FSharpCorePreviewPackageVersion}}</Pattern2>
<Replacement2>$(FSharpCorePreviewPackageVersion)</Replacement2>
<Pattern1>{{FSharpCoreShippedVersion}}</Pattern1>
<Replacement1>$(FSharpCoreShippedVersion)</Replacement1>
<Pattern2>{{FSharpCorePreviewVersion}}</Pattern2>
<Replacement2>$(FSharpCorePreviewVersion)</Replacement2>
</NoneSubstituteText>
<None Include="Microsoft.FSharp.Overrides.NetSdk.targets" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
......
......@@ -27,6 +27,7 @@ type public Fsc () as this =
let mutable checksumAlgorithm: string = null
let mutable codePage : string = null
let mutable commandLineArgs : ITaskItem list = []
let mutable compilerTools: ITaskItem [] = [||]
let mutable debugSymbols = false
let mutable debugType : string = null
let mutable defineConstants : ITaskItem[] = [||]
......@@ -162,6 +163,12 @@ type public Fsc () as this =
// VersionFile
builder.AppendSwitchIfNotNull("--versionfile:", versionFile)
// CompilerTools
if compilerTools <> null then
for item in compilerTools do
builder.AppendSwitchIfNotNull("--compilertool:", item.ItemSpec)
// References
if references <> null then
for item in references do
......@@ -276,6 +283,11 @@ type public Fsc () as this =
with get() = codePage
and set(s) = codePage <- s
// -r <string>: Reference an F# or .NET assembly.
member fsc.CompilerTools
with get() = compilerTools
and set(a) = compilerTools <- a
// -g: Produce debug file. Disables optimizations if a -O flag is not given.
member fsc.DebugSymbols
with get() = debugSymbols
......
......@@ -98,4 +98,10 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<PackageReference Include="FSharp.Core" Version="$(FSharpCoreImplicitPackageVersion)" />
</ItemGroup>
<ItemDefinitionGroup>
<PackageReference>
<GeneratePathProperty>true</GeneratePathProperty>
</PackageReference>
</ItemDefinitionGroup>
</Project>
......@@ -58,6 +58,25 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<RestoreSources>$(RestoreSources); https://dotnet.myget.org/F/fsharp/api/v3/index.json</RestoreSources>
</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)' == '' "/>
<PropertyNames Include = "Pkg$([System.String]::Copy('%(PackageReference.FileName)%(PackageReference.Extension)').Replace('.','_'))" Condition = " '%(PackageReference.IsFSharpDesignTimeProvider)' == 'true' and '%(PackageReference.Extension)' != '' "/>
<FscCompilerTools Include = "$(%(PropertyNames.Identity))" />
</ItemGroup>
</Target>
<Target Name='ComputePackageRoots'
BeforeTargets='CoreCompile;FSI-PackageManagement'
DependsOnTargets='CollectPackageReferences'>
<ItemGroup>
<EnhancedResolvedFile Include='@(ResolvedCompileFileDefinitions)'>
<PackageRootProperty>Pkg$([System.String]::Copy('%(ResolvedCompileFileDefinitions.NugetPackageId)').Replace('.','_'))</PackageRootProperty>
<FsxInitializeSourcePath>$(%(EnhancedResolvedFile.PackageRootProperty))\content\%(ResolvedCompileFileDefinitions.FileName)%(ResolvedCompileFileDefinitions.Extension).fsx</FsxInitializeSourcePath>
</EnhancedResolvedFile>
</ItemGroup>
</Target>
<Target Name="PackageFSharpDesignTimeTools" DependsOnTargets="_GetFrameworkAssemblyReferences">
<PropertyGroup>
<FSharpDesignTimeProtocol Condition = " '$(FSharpDesignTimeProtocol)' == '' ">fsharp41</FSharpDesignTimeProtocol>
......@@ -68,17 +87,43 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
<Error Text="The 'FSharpDesignTimeProtocol' property can be only 'fsharp41'" Condition="'$(FSharpDesignTimeProtocol)' != 'fsharp41'" />
<ItemGroup>
<_ResolvedProjectOutputFiles
Include="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/*"
Exclude="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/FSharp.Core.dll;%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/System.ValueTuple.dll"
<_ResolvedOutputFiles
Include="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/*"
Exclude="%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/FSharp.Core.dll;%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/System.ValueTuple.dll"
Condition="'%(_ResolvedProjectReferencePaths.IsFSharpDesignTimeProvider)' == 'true'">
<NearestTargetFramework>%(_ResolvedProjectReferencePaths.NearestTargetFramework)</NearestTargetFramework>
</_ResolvedProjectOutputFiles>
</_ResolvedOutputFiles>
<_ResolvedOutputFiles
Include="@(BuiltProjectOutputGroupKeyOutput)"
Condition=" '$(IsFSharpDesignTimeProvider)' == 'true' and '%(BuiltProjectOutputGroupKeyOutput->Filename)%(BuiltProjectOutputGroupKeyOutput->Extension)' != 'FSharp.Core.dll' and '%(BuiltProjectOutputGroupKeyOutput->Filename)%(BuiltProjectOutputGroupKeyOutput->Extension)' != 'System.ValueTuple.dll' ">
<NearestTargetFramework>$(TargetFramework)</NearestTargetFramework>
</_ResolvedOutputFiles>
<TfmSpecificPackageFile Include="@(_ResolvedProjectOutputFiles)">
<PackagePath>$(FSharpToolsDirectory)/$(FSharpDesignTimeProtocol)/%(_ResolvedProjectOutputFiles.NearestTargetFramework)/%(_ResolvedProjectOutputFiles.FileName)%(_ResolvedProjectOutputFiles.Extension)</PackagePath>
<TfmSpecificPackageFile Include="@(_ResolvedOutputFiles)">
<PackagePath>$(FSharpToolsDirectory)/$(FSharpDesignTimeProtocol)/%(_ResolvedOutputFiles.NearestTargetFramework)/%(_ResolvedOutputFiles.FileName)%(_ResolvedOutputFiles.Extension)</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
<Target Name="CollectFSharpDesignTimeTools" BeforeTargets="BeforeCompile" DependsOnTargets="_GetFrameworkAssemblyReferences">
<ItemGroup>
<PropertyNames Include = "Pkg$([System.String]::Copy('%(PackageReference.FileName)').Replace('.','_'))" Condition = " '%(PackageReference.IsFSharpDesignTimeProvider)' == 'true' and '%(PackageReference.Extension)' == '' "/>
<PropertyNames Include = "Pkg$([System.String]::Copy('%(PackageReference.FileName)%(PackageReference.Extension)').Replace('.','_'))" Condition = " '%(PackageReference.IsFSharpDesignTimeProvider)' == 'true' and '%(PackageReference.Extension)' != '' "/>
<FscCompilerTools Include = "$(%(PropertyNames.Identity))" />
</ItemGroup>
</Target>
<Target Name='ComputePackageRoots'
BeforeTargets='CoreCompile;FSI-PackageManagement'
DependsOnTargets='CollectPackageReferences'>
<ItemGroup>
<FsxResolvedFile Include='@(ResolvedCompileFileDefinitions)'>
<PackageRootProperty>Pkg$([System.String]::Copy('%(ResolvedCompileFileDefinitions.NugetPackageId)').Replace('.','_'))</PackageRootProperty>
<PackageRoot>$(%(FsxResolvedFile.PackageRootProperty))</PackageRoot>
<InitializeSourcePath>$(%(FsxResolvedFile.PackageRootProperty))\content\%(ResolvedCompileFileDefinitions.FileName)%(ResolvedCompileFileDefinitions.Extension).fsx</InitializeSourcePath>
</FsxResolvedFile>
</ItemGroup>
</Target>
</Project>
......@@ -19,7 +19,7 @@ this file.
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<FSharpBuildAssemblyFile Condition=" '$(FSharpBuildAssemblyFile)' =='' ">FSharp.Build.dll</FSharpBuildAssemblyFile>
<FSharpBuildAssemblyFile Condition=" '$(FSharpBuildAssemblyFile)' =='' ">$(MSBuildThisFileDirectory)FSharp.Build.dll</FSharpBuildAssemblyFile>
</PropertyGroup>
<UsingTask TaskName="Fsc" AssemblyFile="$(FSharpBuildAssemblyFile)" />
......@@ -211,6 +211,7 @@ this file.
@(CompileBefore);
@(Compile);
@(CompileAfter);
@(FscCompilerTools);
@(_CoreCompileResourceInputs);
@(ManifestNonResxWithNoCultureOnDisk);
$(ApplicationIcon);
......@@ -279,6 +280,7 @@ this file.
BaseAddress="$(BaseAddress)"
ChecksumAlgorithm="$(PdbChecksumAlgorithm)"
CodePage="$(CodePage)"
CompilerTools="@(FscCompilerTools)"
DebugSymbols="$(DebugSymbols)"
DebugType="$(DebugType)"
DefineConstants="$(DefineConstants)"
......
......@@ -20,6 +20,7 @@
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.DependencyManager\FSharp.DependencyManager.fsproj" />
</ItemGroup>
</Project>
......@@ -15,5 +15,7 @@
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Private.Scripting.xml" target="lib\netstandard2.0" />
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Private.dll" target="lib\netstandard2.0" />
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.Compiler.Private.xml" target="lib\netstandard2.0" />
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.DependencyManager.dll" target="lib\netstandard2.0" />
<file src="FSharp.Compiler.Private.Scripting\$Configuration$\$TargetFramework$\FSharp.DependencyManager.xml" target="lib\netstandard2.0" />
</files>
</package>
......@@ -17,12 +17,25 @@ type FSharpScript(?additionalArgs: string[]) =
else "netcore"
let baseArgs = [| typeof<FSharpScript>.Assembly.Location; "--noninteractive"; "--targetprofile:" + computedProfile; "--quiet" |]
let argv = Array.append baseArgs additionalArgs
let fsi = FsiEvaluationSession.Create (config, argv, stdin, stdout, stderr, collectible=true)
let fsi = FsiEvaluationSession.Create (config, argv, stdin, stdout, stderr)
[<CLIEvent>]
member __.AssemblyReferenceAdded = fsi.AssemblyReferenceAdded
member __.ValueBound = fsi.ValueBound
[<CLIEvent>]
member __.IncludePathAdded = fsi.IncludePathAdded
[<CLIEvent>]
member __.DependencyAdding = fsi.DependencyAdding
[<CLIEvent>]
member __.DependencyAdded = fsi.DependencyAdded
[<CLIEvent>]
member __.DependencyFailed = fsi.DependencyFailed
member __.Fsi = fsi
member __.Eval(code: string, ?cancellationToken: CancellationToken) =
......
......@@ -16,14 +16,6 @@
<Tailcalls>true</Tailcalls> <!-- .tail annotations always emitted for this binary, even in debug mode -->
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net472|AnyCPU'">
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<Target Name="CopyToBuiltBin" BeforeTargets="BuiltProjectOutputGroup" AfterTargets="CoreCompile">
<PropertyGroup>
<BuildOutputGroupLocation>$(BaseOutputPath)\$(Configuration)\$(TargetFramework)</BuildOutputGroupLocation>
......@@ -224,7 +216,7 @@
<Compile Include="..\..\absil\ilmorph.fs">
<Link>AbsIL\ilmorph.fs</Link>
</Compile>
<Compile Include="..\..\absil\ilsign.fs" Condition="$(TargetFramework.StartsWith(netstandard))">
<Compile Include="..\..\absil\ilsign.fs" Condition="$(TargetFramework.StartsWith('netstandard'))">
<Link>AbsIL\ilsign.fs</Link>
</Compile>
<Compile Include="..\..\absil\ilnativeres.fsi">
......@@ -524,11 +516,16 @@
<Compile Include="..\IlxGen.fs">
<Link>CodeGen\IlxGen.fs</Link>
</Compile>
<!-- includes the core of the F# Compiler fsc.exe implementation -->
<Compile Include="..\DotNetFrameworkDependencies.fs">
<Link>Driver\DotNetFrameworkDependencies.fs</Link>
</Compile>
<Compile Include="..\DependencyManager.Integration.fsi">
<Link>Driver\DependencyManager.Integration.fsi</Link>
</Compile>
<Compile Include="..\DependencyManager.Integration.fs">
<Link>Driver\DependencyManager.Integration.fs</Link>
</Compile>
<Compile Include="..\CompileOps.fsi">
<Link>Driver\CompileOps.fsi</Link>
</Compile>
......@@ -641,6 +638,9 @@
<Compile Include="..\service\ServiceXmlDocParser.fs">
<Link>Service/ServiceXmlDocParser.fs</Link>
</Compile>
<Compile Include="..\SimulatedMSBuildReferenceResolver.fs">
<Link>Service/SimulatedMSBuildReferenceResolver.fs</Link>
</Compile>
<Compile Include="..\service\ExternalSymbol.fsi">
<Link>Service/ExternalSymbol.fsi</Link>
</Compile>
......@@ -706,6 +706,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
</ItemGroup>
......
......@@ -23,6 +23,7 @@
<dependency id="System.Linq.Queryable" version="4.0.1" />
<dependency id="System.Net.Requests" version="4.0.11" />
<dependency id="System.Reflection.Emit" version="4.0.1" />
<dependency id="System.Reflection.Extensions" version="4.0.1" />
<dependency id="System.Reflection.Metadata" version="1.6.0" />
<dependency id="System.Reflection.TypeExtensions" version="4.1.0" />
<dependency id="System.Runtime.InteropServices" version="4.1.0" />
......
......@@ -2,7 +2,7 @@
<PropertyGroup>
<PreRelease>true</PreRelease>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<NuspecFile>Microsoft.FSharp.Compiler.nuspec</NuspecFile>
<IsPackable>true</IsPackable>
<PackageDescription>.NET Core compatible version of the F# compiler fsc.exe.</PackageDescription>
......@@ -10,13 +10,13 @@
<ItemGroup>
<ProjectReference Include="..\fsc\fsc.fsproj">
<AdditionalProperties>TargetFramework=netcoreapp2.1</AdditionalProperties>
<AdditionalProperties>TargetFramework=netcoreapp3.0</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="..\fsi\fsi.fsproj">
<AdditionalProperties>TargetFramework=netcoreapp2.1</AdditionalProperties>
<AdditionalProperties>TargetFramework=netcoreapp3.0</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="..\FSharp.Build\FSharp.Build.fsproj">
<AdditionalProperties>TargetFramework=netcoreapp2.1</AdditionalProperties>
<AdditionalProperties>TargetFramework=netcoreapp3.0</AdditionalProperties>
</ProjectReference>
<ProjectReference Include="..\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj">
<AdditionalProperties>TargetFramework=netstandard2.0</AdditionalProperties>
......
......@@ -4,7 +4,7 @@
$CommonMetadataElements$
<language>en-US</language>
<dependencies>
<group targetFramework=".NETCoreApp2.1">
<group targetFramework=".NETCoreApp3.0">
<dependency id="Microsoft.NETCore.Platforms" version="2.0.0" />
<dependency id="NETStandard.Library" version="2.0.0" />
<dependency id="System.Collections.Immutable" version="1.5.0" />
......@@ -44,27 +44,30 @@
this approach gives a very small deployment. Which is kind of necessary.
-->
<!-- assemblies -->
<file src="fsc\$Configuration$\netcoreapp2.1\fsc.exe" target="lib\netcoreapp2.1" />
<file src="fsi\$Configuration$\netcoreapp2.1\fsi.exe" target="lib\netcoreapp2.1" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Compiler.Private\$Configuration$\netstandard2.0\FSharp.Compiler.Private.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\FSharp.Build.dll" target="lib\netcoreapp2.1" />
<file src="fsc\$Configuration$\netcoreapp3.0\fsc.exe" target="lib\netcoreapp3.0" />
<file src="fsi\$Configuration$\netcoreapp3.0\fsi.exe" target="lib\netcoreapp3.0" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.dll" target="lib\netcoreapp3.0" />
<file src="FSharp.Compiler.Private\$Configuration$\netstandard2.0\FSharp.Compiler.Private.dll" target="lib\netcoreapp3.0" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.0\FSharp.Build.dll" target="lib\netcoreapp3.0" />
<file src="FSharp.DependencyManager\$configuration$\netstandard2.0\FSharp.DependencyManager.dll" target="lib\netcoreapp3.0" />
<file src="FSharp.Compiler.Interactive.Settings\$Configuration$\netstandard2.0\FSharp.Compiler.Interactive.Settings.dll"
target="lib\netcoreapp2.1" />
target="lib\netcoreapp3.0" />
<!-- additional files -->
<file src="fsc\$Configuration$\netcoreapp2.1\default.win32manifest" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\Microsoft.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\Microsoft.Portable.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\Microsoft.FSharp.NetSdk.props" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\Microsoft.FSharp.NetSdk.targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\Microsoft.FSharp.Overrides.NetSdk.targets" target="contentFiles\any\any" />
<file src="fsc\$Configuration$\netcoreapp3.0\default.win32manifest" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.0\Microsoft.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.0\Microsoft.Portable.FSharp.Targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.0\Microsoft.FSharp.NetSdk.props" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.0\Microsoft.FSharp.NetSdk.targets" target="contentFiles\any\any" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.0\Microsoft.FSharp.Overrides.NetSdk.targets" target="contentFiles\any\any" />
<!-- resources -->
<file src="FSharp.Core\$Configuration$\netstandard2.0\**\FSharp.Core.resources.dll" target="lib\netcoreapp2.1" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\**\FSharp.Core.resources.dll" target="lib\netcoreapp3.0" />
<file src="FSharp.Compiler.Private\$Configuration$\netstandard2.0\**\FSharp.Compiler.Private.resources.dll"
target="lib\netcoreapp2.1" />
target="lib\netcoreapp3.0" />
<file src="FSharp.Compiler.Interactive.Settings\$Configuration$\netstandard2.0\**\FSharp.Compiler.Interactive.Settings.resources.dll"
target="lib\netcoreapp2.1" />
<file src="FSharp.Build\$Configuration$\netcoreapp2.1\**\FSharp.Build.resources.dll" target="lib\netcoreapp2.1" />
target="lib\netcoreapp3.0" />
<file src="FSharp.Build\$Configuration$\netcoreapp3.0\**\FSharp.Build.resources.dll" target="lib\netcoreapp3.0" />
<file src="FSharp.DependencyManager\$configuration$\netstandard2.0\**\FSharp.DependencyManager.resources.dll"
target="lib\netcoreapp3.0" />
</files>
</package>
......@@ -10,7 +10,7 @@
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);FSHARP_CORE</DefineConstants>
<DefineConstants Condition="'$(Configuration)' == 'Proto'">BUILDING_WITH_LKG;$(DefineConstants)</DefineConstants>
<OtherFlags>$(OtherFlags) --warnon:1182 --compiling-fslib --compiling-fslib-40 --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
<OtherFlags>$(OtherFlags) --warnon:1182 --compiling-fslib --compiling-fslib-40 --maxerrors:20 --extraoptimizationloops:1 --nowarn:57</OtherFlags>
<Tailcalls>true</Tailcalls> <!-- .tail annotations always emitted for this binary, even in debug mode -->
<NGenBinary>true</NGenBinary>
</PropertyGroup>
......
FSharp.DependencyManager.nuget.props
\ No newline at end of file
# FSharp.Build resource strings
notUsed,"Not used."
\ No newline at end of file
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
namespace FSharp.DependencyManager
open System
open System.Collections
open System.Collections.Generic
open System.Diagnostics
open System.IO
open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.Versioning
open Internal.Utilities.FSharpEnvironment
#if !(NETSTANDARD || NETCOREAPP)
open Microsoft.Build.Evaluation
open Microsoft.Build.Framework
#endif
[<AttributeUsage(AttributeTargets.Assembly ||| AttributeTargets.Class , AllowMultiple = false)>]
type DependencyManagerAttribute() = inherit System.Attribute()
module Utilities =
/// Return a string array delimited by commas
/// Note that a quoted string is not going to be mangled into pieces.
let trimChars = [| ' '; '\t'; '\''; '\"' |]
let inline private isNotQuotedQuotation (text: string) n = n > 0 && text.[n-1] <> '\\'
let getOptions text =
let split (option:string) =
let pos = option.IndexOf('=')
let stringAsOpt text =
if String.IsNullOrEmpty(text) then None
else Some text
let nameOpt =
if pos <= 0 then None
else stringAsOpt (option.Substring(0, pos).Trim(trimChars).ToLowerInvariant())
let valueOpt =
let valueText =
if pos < 0 then option
else if pos < option.Length then
option.Substring(pos + 1)
else ""
stringAsOpt (valueText.Trim(trimChars))
nameOpt,valueOpt
let last = String.length text - 1
let result = ResizeArray()
let mutable insideSQ = false
let mutable start = 0
let isSeperator c = c = ','
for i = 0 to last do
match text.[i], insideSQ with
| c, false when isSeperator c -> // split when seeing a separator
result.Add(text.Substring(start, i - start))
insideSQ <- false
start <- i + 1
| _, _ when i = last ->
result.Add(text.Substring(start, i - start + 1))
| c, true when isSeperator c -> // keep reading if a separator is inside quotation
insideSQ <- true
| '\'', _ when isNotQuotedQuotation text i -> // open or close quotation
insideSQ <- not insideSQ // keep reading
| _ -> ()
result
|> List.ofSeq
|> List.map (fun option -> split option)
// Path to the directory containing the fsharp compilers
let fsharpCompilerPath = Path.GetDirectoryName(typeof<DependencyManagerAttribute>.GetTypeInfo().Assembly.Location)
// We are running on dotnet core if the executing mscorlib is System.Private.CoreLib
let isRunningOnCoreClr = (typeof<obj>.Assembly).FullName.StartsWith("System.Private.CoreLib", StringComparison.InvariantCultureIgnoreCase)
let isWindows =
match Environment.OSVersion.Platform with
| PlatformID.Unix -> false
| PlatformID.MacOSX -> false
| _ -> true
let dotnet =
if isWindows then "dotnet.exe" else "dotnet"
let sdks = "Sdks"
#if !(NETSTANDARD || NETCOREAPP)
let msbuildExePath =
// Find msbuild.exe when invoked from desktop compiler.
// 1. Look relative to F# compiler location Normal retail build
// 2. Use VSAPPDIR Nightly when started from VS, or F5
// 3. Use VSINSTALLDIR -- When app is run outside of VS, and
// is not copied relative to a vs install.
let vsRootFromVSAPPIDDIR =
let vsappiddir = Environment.GetEnvironmentVariable("VSAPPIDDIR")
if not (String.IsNullOrEmpty(vsappiddir)) then
Path.GetFullPath(Path.Combine(vsappiddir, "../.."))
else
null
let roots = [|
Path.GetFullPath(Path.Combine(fsharpCompilerPath, "../../../../.."))
vsRootFromVSAPPIDDIR
Environment.GetEnvironmentVariable("VSINSTALLDIR")
|]
let msbuildPath root = Path.GetFullPath(Path.Combine(root, "MSBuild/Current/Bin/MSBuild.exe"))
let msbuildPathExists root =
if String.IsNullOrEmpty(root) then
false
else
File.Exists(msbuildPath root)
let msbuildOption rootOpt =
match rootOpt with
| Some root -> Some (msbuildPath root)
| _ -> None
roots |> Array.tryFind(fun root -> msbuildPathExists root) |> msbuildOption
#else
let dotnetHostPath =
// How to find dotnet.exe --- woe is me; probing rules make me sad.
// Algorithm:
// 1. Look for DOTNET_HOST_PATH environment variable
// this is the main user programable override .. provided by user to find a specific dotnet.exe
// 2. Probe for are we part of an .NetSDK install
// In an sdk install we are always installed in: sdk\3.0.100-rc2-014234\FSharp
// dotnet or dotnet.exe will be found in the directory that contains the sdk directory
// 3. We are loaded in-process to some other application ... Eg. try .net
// See if the host is dotnet.exe ... from netcoreapp3.0 on this is fairly unlikely
// 4. If it's none of the above we are going to have to rely on the path containing the way to find dotnet.exe
//
if isRunningOnCoreClr then
match (Environment.GetEnvironmentVariable("DOTNET_HOST_PATH")) with
| value when not (String.IsNullOrEmpty(value)) ->
Some value // Value set externally
| _ ->
// Probe for netsdk install
let dotnetLocation =
let dotnetApp =
let platform = Environment.OSVersion.Platform
if platform = PlatformID.Unix then "dotnet" else "dotnet.exe"
let assemblyLocation = typeof<DependencyManagerAttribute>.GetTypeInfo().Assembly.Location
Path.Combine(assemblyLocation, "../../..", dotnetApp)
if File.Exists(dotnetLocation) then
Some dotnetLocation
else
let main = Process.GetCurrentProcess().MainModule
if main.ModuleName ="dotnet" then
Some main.FileName
else
Some dotnet
else
None
#endif
let drainStreamToFile (stream: StreamReader) filename =
use file = File.OpenWrite(filename)
use writer = new StreamWriter(file)
let rec copyLines () =
match stream.ReadLine() with
| null -> ()
| line ->
writer.WriteLine(line)
copyLines ()
copyLines ()
let executeBuild pathToExe arguments workingDir =
match pathToExe with
| Some path ->
let psi = ProcessStartInfo()
psi.FileName <- path
psi.WorkingDirectory <- workingDir
psi.RedirectStandardOutput <- true
psi.RedirectStandardError <- true
psi.Arguments <- arguments
psi.CreateNoWindow <- true
psi.UseShellExecute <- false
use p = new Process()
p.StartInfo <- psi
p.Start() |> ignore
drainStreamToFile p.StandardOutput (Path.Combine(workingDir, "StandardOutput.txt"))
drainStreamToFile p.StandardError (Path.Combine(workingDir, "StandardError.txt"))
p.WaitForExit()
p.ExitCode = 0
| None -> false
let buildProject projectPath binLogPath =
let binLoggingArguments =
match binLogPath with
| Some(path) ->
let path = match path with
| Some path -> path // specific file
| None -> Path.Combine(Path.GetDirectoryName(projectPath), "msbuild.binlog") // auto-generated file
sprintf "/bl:\"%s\"" path
| None -> ""
let arguments prefix =
sprintf "%s -restore %s %c%s%c /t:FSI-PackageManagement" prefix binLoggingArguments '\"' projectPath '\"'
let workingDir = Path.GetDirectoryName projectPath
let succeeded =
#if !(NETSTANDARD || NETCOREAPP)
// The Desktop build uses "msbuild" to build
executeBuild msbuildExePath (arguments "") workingDir
#else
// The coreclr uses "dotnet msbuild" to build
executeBuild dotnetHostPath (arguments "msbuild") workingDir
#endif
let outputFile = projectPath + ".fsx"
let resultOutFile = if succeeded && File.Exists(outputFile) then Some outputFile else None
succeeded, resultOutFile
// Generate a project files for dependencymanager projects
let generateLibrarySource = @"// Generated dependencymanager library
namespace lib"
let generateProjectBody = @"
<Project Sdk='Microsoft.NET.Sdk'>
<PropertyGroup>
<TargetFramework>$(TARGETFRAMEWORK)</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<Compile Include='Library.fs' />
</ItemGroup>
$(PACKAGEREFERENCES)
<Target Name='CollectFSharpDesignTimeTools' BeforeTargets='BeforeCompile' DependsOnTargets='_GetFrameworkAssemblyReferences'>
<ItemGroup>
<PropertyNames Include = ""Pkg$([System.String]::Copy('%(PackageReference.FileName)').Replace('.','_'))"" Condition = "" '%(PackageReference.IsFSharpDesignTimeProvider)' == 'true' and '%(PackageReference.Extension)' == '' ""/>
<PropertyNames Include = ""Pkg$([System.String]::Copy('%(PackageReference.FileName)%(PackageReference.Extension)').Replace('.','_'))"" Condition = "" '%(PackageReference.IsFSharpDesignTimeProvider)' == 'true' and '%(PackageReference.Extension)' != '' ""/>
<FscCompilerTools Include = ""$(%(PropertyNames.Identity))"" />
</ItemGroup>
</Target>
<Target Name=""PackageFSharpDesignTimeTools"" DependsOnTargets=""_GetFrameworkAssemblyReferences"">
<PropertyGroup>
<FSharpDesignTimeProtocol Condition = "" '$(FSharpDesignTimeProtocol)' == '' "">fsharp41</FSharpDesignTimeProtocol>
<FSharpToolsDirectory Condition = "" '$(FSharpToolsDirectory)' == '' "">tools</FSharpToolsDirectory>
</PropertyGroup>
<Error Text=""'$(FSharpToolsDirectory)' is an invalid value for 'FSharpToolsDirectory' valid values are 'typeproviders' and 'tools'."" Condition=""'$(FSharpToolsDirectory)' != 'typeproviders' and '$(FSharpToolsDirectory)' != 'tools'"" />
<Error Text=""The 'FSharpDesignTimeProtocol' property can be only 'fsharp41'"" Condition=""'$(FSharpDesignTimeProtocol)' != 'fsharp41'"" />
<ItemGroup>
<_ResolvedOutputFiles
Include=""%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/*""
Exclude=""%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/FSharp.Core.dll;%(_ResolvedProjectReferencePaths.RootDir)%(_ResolvedProjectReferencePaths.Directory)/**/System.ValueTuple.dll""
Condition=""'%(_ResolvedProjectReferencePaths.IsFSharpDesignTimeProvider)' == 'true'"">
<NearestTargetFramework>%(_ResolvedProjectReferencePaths.NearestTargetFramework)</NearestTargetFramework>
</_ResolvedOutputFiles>
<_ResolvedOutputFiles
Include=""@(BuiltProjectOutputGroupKeyOutput)""
Condition=""'$(IsFSharpDesignTimeProvider)' == 'true' and '%(BuiltProjectOutputGroupKeyOutput->Filename)%(BuiltProjectOutputGroupKeyOutput->Extension)' != 'FSharp.Core.dll' and '%(BuiltProjectOutputGroupKeyOutput->Filename)%(BuiltProjectOutputGroupKeyOutput->Extension)' != 'System.ValueTuple.dll'"">
<NearestTargetFramework>$(TargetFramework)</NearestTargetFramework>
</_ResolvedOutputFiles>
<TfmSpecificPackageFile Include=""@(_ResolvedOutputFiles)"">
<PackagePath>$(FSharpToolsDirectory)/$(FSharpDesignTimeProtocol)/%(_ResolvedOutputFiles.NearestTargetFramework)/%(_ResolvedOutputFiles.FileName)%(_ResolvedOutputFiles.Extension)</PackagePath>
</TfmSpecificPackageFile>
</ItemGroup>
</Target>
<Target Name='ComputePackageRoots'
BeforeTargets='CoreCompile;FSI-PackageManagement'
DependsOnTargets='CollectPackageReferences'>
<ItemGroup>
<FsxResolvedFile Include='@(ResolvedCompileFileDefinitions)'>
<PackageRootProperty>Pkg$([System.String]::Copy('%(ResolvedCompileFileDefinitions.NugetPackageId)').Replace('.','_'))</PackageRootProperty>
<PackageRoot>$([MSBuild]::EnsureTrailingSlash('$(%(FsxResolvedFile.PackageRootProperty))'))</PackageRoot>
<InitializeSourcePath>$(%(FsxResolvedFile.PackageRootProperty))\content\%(ResolvedCompileFileDefinitions.FileName)%(ResolvedCompileFileDefinitions.Extension).fsx</InitializeSourcePath>
</FsxResolvedFile>
<NativeIncludeRoots
Include='@(RuntimeTargetsCopyLocalItems)'
Condition=""'%(RuntimeTargetsCopyLocalItems.AssetType)' == 'native'"">
<Path>$([MSBuild]::EnsureTrailingSlash('$([System.String]::Copy('%(FullPath)').Substring(0, $([System.String]::Copy('%(FullPath)').LastIndexOf('runtimes'))))'))</Path>
</NativeIncludeRoots>
</ItemGroup>
</Target>
<Target Name='FSI-PackageManagement' DependsOnTargets='ResolvePackageAssets'>
<ItemGroup>
<ReferenceLines Remove='@(ReferenceLines)' />
<ReferenceLines Include='// Generated from #r ""nuget:Package References""' />
<ReferenceLines Include='// ============================================' />
<ReferenceLines Include='//' />
<ReferenceLines Include='// DOTNET_HOST_PATH:($(DOTNET_HOST_PATH))' />
<ReferenceLines Include='// MSBuildSDKsPath:($(MSBuildSDKsPath))' />
<ReferenceLines Include='// MSBuildExtensionsPath:($(MSBuildExtensionsPath))' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#r @""%(FsxResolvedFile.HintPath)""' Condition = ""'%(FsxResolvedFile.NugetPackageId)' != '' and '%(FsxResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(FsxResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(FsxResolvedFile.NugetPackageId)' != 'System.ValueTuple' and Exists('%(FsxResolvedFile.HintPath)')"" KeepDuplicates='false' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#I @""%(FsxResolvedFile.PackageRoot)""' Condition= ""'%(FsxResolvedFile.PackageRoot)' != ''"" KeepDuplicates='false' />
<ReferenceLines Include='#I @""%(NativeIncludeRoots.Path)""' Condition= ""'%(NativeIncludeRoots.Path)' != ''"" KeepDuplicates='false' />
<ReferenceLines Include='//' />
<ReferenceLines Include='#load @""%(FsxResolvedFile.InitializeSourcePath)""' Condition = ""'%(FsxResolvedFile.InitializeSourcePath)' != '' and '%(FsxResolvedFile.NugetPackageId)' != 'Microsoft.NETCore.App' and '%(FsxResolvedFile.NugetPackageId)' != 'FSharp.Core' and '%(FsxResolvedFile.NugetPackageId)' != 'System.ValueTuple' and Exists('%(FsxResolvedFile.InitializeSourcePath)')"" KeepDuplicates='false' />
</ItemGroup>
<WriteLinesToFile Lines='@(ReferenceLines)' File='$(MSBuildProjectFullPath).fsx' Overwrite='True' WriteOnlyWhenDifferent='True' />
<ItemGroup>
<FileWrites Include='$(MSBuildProjectFullPath).fsx' />
</ItemGroup>
</Target>
</Project>"
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
namespace FSharp.DependencyManager
open System
open System.Collections.Concurrent
open System.Diagnostics
open System.IO
open FSharp.DependencyManager
open FSharp.DependencyManager.Utilities
module Attributes =
[<assembly: DependencyManagerAttribute()>]
do ()
type PackageReference = { Include:string; Version:string; RestoreSources:string; Script:string }
module FSharpDependencyManager =
let private concat (s:string) (v:string) : string =
match String.IsNullOrEmpty(s), String.IsNullOrEmpty(v) with
| false, false -> s + ";" + v
| false, true -> s
| true, false -> v
| _ -> ""
let formatPackageReference p =
let { Include=inc; Version=ver; RestoreSources=src; Script=script } = p
seq {
match not (String.IsNullOrEmpty(inc)), not (String.IsNullOrEmpty(ver)), not (String.IsNullOrEmpty(script)) with
| true, true, false -> yield sprintf @" <ItemGroup><PackageReference Include='%s' Version='%s'><GeneratePathProperty>true</GeneratePathProperty></PackageReference></ItemGroup>" inc ver
| true, true, true -> yield sprintf @" <ItemGroup><PackageReference Include='%s' Version='%s' Script='%s'><GeneratePathProperty>true</GeneratePathProperty></PackageReference></ItemGroup>" inc ver script
| true, false, false -> yield sprintf @" <ItemGroup><PackageReference Include='%s'><GeneratePathProperty>true</GeneratePathProperty></PackageReference></ItemGroup>" inc
| true, false, true -> yield sprintf @" <ItemGroup><PackageReference Include='%s' Script='%s'><GeneratePathProperty>true</GeneratePathProperty></PackageReference></ItemGroup>" inc script
| _ -> ()
match not (String.IsNullOrEmpty(src)) with
| true -> yield sprintf @" <PropertyGroup><RestoreAdditionalProjectSources>%s</RestoreAdditionalProjectSources></PropertyGroup>" (concat "$(RestoreAdditionalProjectSources)" src)
| _ -> ()
}
let parsePackageReference (lines: string list) =
let mutable binLogPath = None
let parsePackageReferenceOption (line: string) =
let validatePackageName package packageName =
if String.Compare(packageName, package, StringComparison.OrdinalIgnoreCase) = 0 then
raise (ArgumentException(sprintf "PackageManager can not reference the System Package '%s'" packageName)) // @@@@@@@@@@@@@@@@@@@@@@@ Globalize me please
let rec parsePackageReferenceOption' (options: (string option * string option) list) (implicitArgumentCount: int) (packageReference: PackageReference option) =
let current =
match packageReference with
| Some p -> p
| None -> { Include = ""; Version = "*"; RestoreSources = ""; Script = "" }
match options with
| [] -> packageReference
| opt :: rest ->
let addInclude v =
validatePackageName v "mscorlib"
validatePackageName v "FSharp.Core"
validatePackageName v "System.ValueTuple"
validatePackageName v "NETStandard.Library"
Some { current with Include = v }
let setVersion v = Some { current with Version = v }
match opt with
| Some "include", Some v -> addInclude v |> parsePackageReferenceOption' rest implicitArgumentCount
| Some "include", None -> raise (ArgumentException(sprintf "%s requires a value" "Include")) // @@@@@@@@@@@@@@@@@@@@@@@ Globalize me please
| Some "version", Some v -> setVersion v |> parsePackageReferenceOption' rest implicitArgumentCount
| Some "version", None -> raise (ArgumentException(sprintf "%s requires a value" "Version")) // @@@@@@@@@@@@@@@@@@@@@@@ Globalize me please
| Some "restoresources", Some v -> Some { current with RestoreSources = concat current.RestoreSources v } |> parsePackageReferenceOption' rest implicitArgumentCount
| Some "restoresources", None -> raise (ArgumentException(sprintf "%s requires a value" "RestoreSources")) // @@@@@@@@@@@@@@@@@@@@@@@ Globalize me please
| Some "script", Some v -> Some { current with Script = v } |> parsePackageReferenceOption' rest implicitArgumentCount
| Some "bl", value ->
match value with
| Some v when v.ToLowerInvariant() = "true" -> binLogPath <- Some None // auto-generated logging location
| Some v when v.ToLowerInvariant() = "false" -> binLogPath <- None // no logging
| Some path -> binLogPath <- Some(Some path) // explicit logging location
| None ->
// parser shouldn't get here because unkeyed values follow a different path, but for the sake of completeness and keeping the compiler happy,
// this is fine
binLogPath <- Some None // auto-generated logging location
parsePackageReferenceOption' rest implicitArgumentCount packageReference
| None, Some v ->
match v.ToLowerInvariant() with
| "bl" ->
// a bare 'bl' enables binary logging and is NOT interpreted as one of the positional arguments. On the off chance that the user actually wants
// to reference a package named 'bl' they still have the 'Include=bl' syntax as a fallback.
binLogPath <- Some None // auto-generated logging location
parsePackageReferenceOption' rest implicitArgumentCount packageReference
| _ ->
match implicitArgumentCount with
| 0 -> addInclude v
| 1 -> setVersion v
| _ -> raise (ArgumentException(sprintf "Unable to apply implicit argument number %d" (implicitArgumentCount + 1))) // @@@@@@@@@@@@@@@@@@@@@@@ Globalize me please
|> parsePackageReferenceOption' rest (implicitArgumentCount + 1)
| _ -> parsePackageReferenceOption' rest implicitArgumentCount packageReference
let options = getOptions line
parsePackageReferenceOption' options 0 None
lines
|> List.choose parsePackageReferenceOption
|> List.distinct
|> (fun l -> l, binLogPath)
type [<DependencyManagerAttribute>] FSharpDependencyManager (outputDir:string option) =
let key = "nuget"
let name = "MsBuild Nuget DependencyManager"
let scriptsPath =
let path = Path.Combine(Path.GetTempPath(), key, Process.GetCurrentProcess().Id.ToString())
match outputDir with
| None -> path
| Some v -> Path.Combine(path, v)
let generatedScripts = new ConcurrentDictionary<string,string>()
let deleteScripts () =
try
if Directory.Exists(scriptsPath) then
() //Directory.Delete(scriptsPath, true)
with | _ -> ()
let deleteAtExit =
try
if not (File.Exists(scriptsPath)) then
Directory.CreateDirectory(scriptsPath) |> ignore
true
with | _ -> false
let emitFile filename (body:string) =
try
// Create a file to write to
use sw = File.CreateText(filename)
sw.WriteLine(body)
with | _ -> ()
do if deleteAtExit then AppDomain.CurrentDomain.ProcessExit |> Event.add(fun _ -> deleteScripts () )
member __.Name = name
member __.Key = key
member __.ResolveDependencies(_scriptDir:string, _mainScriptName:string, _scriptName:string, packageManagerTextLines:string seq, tfm: string) : bool * string list * string list =
let packageReferences, binLogPath =
packageManagerTextLines
|> List.ofSeq
|> FSharpDependencyManager.parsePackageReference
let packageReferenceLines =
packageReferences
|> List.map FSharpDependencyManager.formatPackageReference
|> Seq.concat
let packageReferenceText = String.Join(Environment.NewLine, packageReferenceLines)
// Generate a project files
let generateAndBuildProjectArtifacts =
let writeFile path body =
if not (generatedScripts.ContainsKey(body.GetHashCode().ToString())) then
emitFile path body
let fsProjectPath = Path.Combine(scriptsPath, "Project.fsproj")
let generateProjBody =
generateProjectBody.Replace("$(TARGETFRAMEWORK)", tfm)
.Replace("$(PACKAGEREFERENCES)", packageReferenceText)
writeFile (Path.Combine(scriptsPath, "Library.fs")) generateLibrarySource
writeFile fsProjectPath generateProjBody
let succeeded, resultingFsx = buildProject fsProjectPath binLogPath
let fsx =
match resultingFsx with
| Some fsx -> [fsx]
| None -> []
succeeded, fsx, List.empty<string>
generateAndBuildProjectArtifacts
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net472;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netstandard2.0</TargetFrameworks>
<AssemblyName>FSharp.DependencyManager</AssemblyName>
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
<DefineConstants>$(DefineConstants);COMPILER</DefineConstants>
<DefineConstants>$(DefineConstants);MSBUILD_AT_LEAST_15</DefineConstants>
<OtherFlags>$(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
<Tailcalls>true</Tailcalls> <!-- .tail annotations always emitted for this binary, even in debug mode -->
</PropertyGroup>
<Target Name="CopyToBuiltBin" BeforeTargets="BuiltProjectOutputGroup" AfterTargets="CoreCompile">
<PropertyGroup>
<BuildOutputGroupLocation>$(BaseOutputPath)\$(Configuration)\$(TargetFramework)</BuildOutputGroupLocation>
</PropertyGroup>
<ItemGroup>
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.Framework.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.Utilities.Core.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\Microsoft.Build.Tasks.Core.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\System.Collections.Immutable.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\System.Reflection.Metadata.dll" />
<BuiltProjectOutputGroupKeyOutput Include="$(BuildOutputGroupLocation)\System.Threading.Tasks.Dataflow.dll" />
</ItemGroup>
</Target>
<ItemGroup>
<EmbeddedText Include="FSDependencyManager.txt" />
<Compile Include="$(FSharpSourcesRoot)\utils\CompilerLocationUtils.fs" />
<Compile Include="$(FSharpSourcesRoot)\fsharp\FSharp.DependencyManager\FSharp.DependencyManager.Utilities.fs" />
<Compile Include="$(FSharpSourcesRoot)\fsharp\FSharp.DependencyManager\FSharp.DependencyManager.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\FSharp.Core\FSharp.Core.fsproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="ISymWrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildVersion)" />
<PackageReference Include="System.IO.Compression" Version="$(SystemIoCompressionVersion)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.Startswith('netstandard'))">
<PackageReference Include="System.Runtime.Loader" Version="$(SystemRuntimeLoaderVersion)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
<PackageReference Include="System.Diagnostics.Process" Version="$(SystemDiagnosticsProcessVersion)" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="$(SystemDiagnosticsTraceSourceVersion)" />
<PackageReference Include="System.Linq.Expressions" Version="$(SystemLinqExpressionsVersion)" />
<PackageReference Include="System.Linq.Queryable" Version="$(SystemLinqExpressionsVersion)" />
<PackageReference Include="System.Net.Requests" Version="$(SystemNetRequestsVersion)" />
<PackageReference Include="System.Net.Security" Version="$(SystemNetSecurityVersion)" />
<PackageReference Include="System.Reflection.Emit" Version="$(SystemReflectionEmitVersion)" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="$(SystemReflectionTypeExtensionsVersion)" />
<PackageReference Include="System.Runtime" Version="$(SystemRuntimeVersion)" />
<PackageReference Include="System.Runtime.InteropServices" Version="$(SystemRuntimeInteropServicesVersion)" />
<PackageReference Include="System.Security.Claims" Version="$(SystemSecurityClaimsVersion)" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="$(SystemSecurityCryptographyAlgorithmsVersion)" />
<PackageReference Include="System.Security.Principal" Version="$(SystemSecurityPrincipalVersion)" />
<PackageReference Include="System.Threading.Tasks.Parallel" Version="$(SystemThreadingTasksParallelVersion)" />
<PackageReference Include="System.Threading.Thread" Version="$(SystemThreadingThreadVersion)" />
<PackageReference Include="System.Threading.ThreadPool" Version="$(SystemThreadingThreadPoolVersion)" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="cs" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">Další informace o F# najdete na https://fsharp.org.</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Pokud potřebujete další nápovědu, viz projekt Výukový kurz F#.</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">vrátit celočíselný ukončovací kód</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="de" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">Weitere Informationen zu F# unter https://fsharp.org.</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Weitere Hilfe finden Sie im Projekt "F#-Tutorial".</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">Integer-Exitcode zurückgeben</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="en" original="../FSDependencyManager.resx">
<body>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="es" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">Más información sobre F# en https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Vea el proyecto "Tutorial de F#" para obtener más ayuda.</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">devolver un código de salida entero</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="fr" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">En savoir plus sur F# : https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Voir le projet 'Didacticiel F#' pour obtenir de l'aide.</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">retourne du code de sortie entier</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="it" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">Altre informazioni su F# disponibili all'indirizzo https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Per altre informazioni, vedere il progetto 'Esercitazione su F#'.</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">restituisce un intero come codice di uscita</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="ja" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">F# の詳細については、https://fsharp.org をご覧ください</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">詳細については、'F# チュートリアル' プロジェクトを参照してください。</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">整数の終了コードを返します</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="ko" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">https://fsharp.org에서 F#에 대해 자세히 알아보기</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">자세한 도움말은 'F# 자습서' 프로젝트를 참조하세요.</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">정수 종료 코드 반환</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../Script.fsx">
<file datatype="xml" source-language="en" target-language="pl" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">Dowiedz się więcej o języku F# na stronie https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Aby uzyskać dodatkową pomoc, zobacz projekt „Samouczek języka F#”.</target>
<note />
</trans-unit>
<trans-unit id="Define">
<source>Define your library scripting code here</source>
<target state="translated">Tutaj zdefiniuj kod skryptu biblioteki</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">Saiba mais sobre o F# em https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Veja o projeto 'F# Tutorial' para obter mais ajuda.</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">retornar um código de saída inteiro</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="ru" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">Дополнительные сведения об F# см. на странице https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Дополнительную справку см. в проекте "Учебник по F#".</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">возвращение целочисленного кода выхода</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="tr" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="tr" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">F# hakkında daha fazla bilgi edinmek için bkz. https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">Daha fazla yardım almak için 'F# Öğreticisi' projesine göz atın.</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">bir tamsayı çıkış kodu döndürür</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">前往 https://fsharp.org 深入了解 F#</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">請參閱「F# 教學課程」專案,取得更多說明。</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">傳回整數的結束代碼</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../Program.fs">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../FSDependencyManager.resx">
<body>
<trans-unit id="LearnMore">
<source>Learn more about F# at https://fsharp.org</source>
<target state="translated">了解更多关于 F# 的信息,请访问 https://fsharp.org</target>
<note />
</trans-unit>
<trans-unit id="SeeTutorial">
<source>See the 'F# Tutorial' project for more help.</source>
<target state="translated">请参阅“F# 教程”项目以获取更多帮助。</target>
<note />
</trans-unit>
<trans-unit id="Return">
<source>return an integer exit code</source>
<target state="translated">返回整数退出代码</target>
<trans-unit id="notUsed">
<source>Not used.</source>
<target state="new">Not used.</target>
<note />
</trans-unit>
</body>
......
......@@ -24,6 +24,10 @@ type LanguageFeature =
| NameOf
| ImplicitYield
| OpenStaticClasses
| DotlessFloat32Literal
| PackageManagement
| FromEndSlicing
| FixedIndexSlice3d4d
/// LanguageVersion management
type LanguageVersion (specifiedVersionAsString) =
......@@ -31,13 +35,14 @@ type LanguageVersion (specifiedVersionAsString) =
// When we increment language versions here preview is higher than current RTM version
static let languageVersion46 = 4.6m
static let languageVersion47 = 4.7m
static let languageVersion50 = 5.0m
static let previewVersion = 9999m // Language version when preview specified
static let defaultVersion = languageVersion47 // Language version when default specified
static let latestVersion = defaultVersion // Language version when latest specified
static let latestMajorVersion = languageVersion46 // Language version when latestmajor specified
static let latestMajorVersion = languageVersion47 // Language version when latestmajor specified
static let validOptions = [| "preview"; "default"; "latest"; "latestmajor" |]
static let languageVersions = set [| languageVersion46; languageVersion47 |]
static let languageVersions = set [| languageVersion46; languageVersion47 (*; languageVersion50 *) |]
static let features =
dict [
......@@ -47,9 +52,15 @@ type LanguageVersion (specifiedVersionAsString) =
LanguageFeature.RelaxWhitespace, languageVersion47
LanguageFeature.ImplicitYield, languageVersion47
// F# 5.0
LanguageFeature.FixedIndexSlice3d4d, languageVersion50
LanguageFeature.FromEndSlicing, languageVersion50
// F# preview
LanguageFeature.NameOf, previewVersion
LanguageFeature.OpenStaticClasses, previewVersion
LanguageFeature.DotlessFloat32Literal, languageVersion50
LanguageFeature.PackageManagement, previewVersion
]
let specified =
......@@ -61,6 +72,7 @@ type LanguageVersion (specifiedVersionAsString) =
| "latestmajor" -> latestMajorVersion
| "4.6" -> languageVersion46
| "4.7" -> languageVersion47
(* | "5.0" -> languageVersion50 *)
| _ -> 0m
/// Check if this feature is supported by the selected langversion
......@@ -69,6 +81,10 @@ type LanguageVersion (specifiedVersionAsString) =
| true, v -> v <= specified
| false, _ -> false
/// Has preview been explicitly specified
member __.IsPreviewEnabled =
specified = previewVersion
/// Does the languageVersion support this version string
member __.ContainsVersion version =
match version with
......
......@@ -12,6 +12,11 @@ type LanguageFeature =
| NameOf
| ImplicitYield
| OpenStaticClasses
| DotlessFloat32Literal
| PackageManagement
| FromEndSlicing
| FixedIndexSlice3d4d
/// LanguageVersion management
type LanguageVersion =
......@@ -22,7 +27,10 @@ type LanguageVersion =
/// Get the list of valid versions
member ContainsVersion: string -> bool
/// Does the specified LanguageVersion support the specified feature
/// Has preview been explicitly specified
member IsPreviewEnabled: bool
/// Does the selected LanguageVersion support the specified feature
member SupportsFeature: LanguageFeature -> bool
/// Get the list of valid versions
......
......@@ -2209,6 +2209,15 @@ type LexFilterImpl (lightSyntaxStatus: LightSyntaxStatus, compilingFsLib, lexer,
pool.Return lessTokenTup
true
// ..^1 will get parsed as DOT_DOT_HAT 1 while 1..^2 will get parsed as 1 DOT_DOT HAT 2
// because of processing rule underneath this.
| (DOT_DOT_HAT) ->
let hatPos = new LexbufState(tokenTup.EndPos.ShiftColumnBy(-1), tokenTup.EndPos, false)
delayToken(let rented = pool.Rent() in rented.Token <- INFIX_AT_HAT_OP("^"); rented.LexbufState <- hatPos; rented.LastTokenPos <- tokenTup.LastTokenPos; rented)
delayToken(pool.UseShiftedLocation(tokenTup, DOT_DOT, 0, -1))
pool.Return tokenTup
true
// Split this token to allow "1..2" for range specification
| INT32_DOT_DOT (i, v) ->
let dotDotPos = new LexbufState(tokenTup.EndPos.ShiftColumnBy(-2), tokenTup.EndPos, false)
......
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
//----------------------------------------------------------------------------
// Some general F# utilities for mangling / demangling / manipulating names.
// Some general F# utilities for mangling / unmangling / manipulating names.
//--------------------------------------------------------------------------
/// Anything to do with special names of identifiers and other lexical rules
......
此差异已折叠。
......@@ -898,13 +898,13 @@ and
[<NoEquality; NoComparison; RequireQualifiedAccess>]
SynIndexerArg =
| Two of SynExpr * SynExpr
| Two of SynExpr * fromEnd1: bool * SynExpr * fromEnd2: bool * range1: range * range2: range
| One of SynExpr
| One of SynExpr * fromEnd: bool * range
member x.Range = match x with Two (e1, e2) -> unionRanges e1.Range e2.Range | One e -> e.Range
member x.Range = match x with Two (e1, _, e2, _, _, _) -> unionRanges e1.Range e2.Range | One (e, _, _) -> e.Range
member x.Exprs = match x with Two (e1, e2) -> [e1;e2] | One e -> [e]
member x.Exprs = match x with Two (e1, _, e2, _, _, _) -> [e1;e2] | One (e, _, _) -> [e]
and
[<NoEquality; NoComparison; RequireQualifiedAccess>]
......@@ -1944,19 +1944,12 @@ let mkSynApp3 f x1 x2 x3 m = mkSynApp1 (mkSynApp2 f x1 x2 m) x3 m
let mkSynApp4 f x1 x2 x3 x4 m = mkSynApp1 (mkSynApp3 f x1 x2 x3 m) x4 m
let mkSynApp5 f x1 x2 x3 x4 x5 m = mkSynApp1 (mkSynApp4 f x1 x2 x3 x4 m) x5 m
let mkSynDotParenSet m a b c = mkSynTrifix m parenSet a b c
let mkSynDotBrackGet m mDot a b = SynExpr.DotIndexedGet (a, [SynIndexerArg.One b], mDot, m)
let mkSynDotBrackGet m mDot a b fromEnd = SynExpr.DotIndexedGet (a, [SynIndexerArg.One (b, fromEnd, m)], mDot, m)
let mkSynQMarkSet m a b c = mkSynTrifix m qmarkSet a b c
let mkSynDotBrackSliceGet m mDot arr sliceArg = SynExpr.DotIndexedGet (arr, [sliceArg], mDot, m)
let mkSynDotBrackSeqSliceGet m mDot arr (argsList: list<SynIndexerArg>) =
let notSliced=[ for arg in argsList do
match arg with
| SynIndexerArg.One x -> yield x
| _ -> () ]
if notSliced.Length = argsList.Length then
SynExpr.DotIndexedGet (arr, [SynIndexerArg.One (SynExpr.Tuple (false, notSliced, [], unionRanges (List.head notSliced).Range (List.last notSliced).Range))], mDot, m)
else
SynExpr.DotIndexedGet (arr, argsList, mDot, m)
SynExpr.DotIndexedGet (arr, argsList, mDot, m)
let mkSynDotParenGet lhsm dotm a b =
match b with
......
......@@ -8,10 +8,10 @@
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="2.0.0.0-{{FSCoreVersion}}" newVersion="{{FSCoreVersion}}"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.3.0" newVersion="1.2.3.0" />
</dependentAssembly>
</assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.2.3.0" newVersion="1.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
</configuration>
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册