diff --git a/FSharp.Compiler.Service.sln b/FSharp.Compiler.Service.sln index 8aed6fa713..c5173d3703 100644 --- a/FSharp.Compiler.Service.sln +++ b/FSharp.Compiler.Service.sln @@ -81,14 +81,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{9020 nuget\projectcracker.template = nuget\projectcracker.template EndProjectSection EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Service.MSBuild.v12", "src\fsharp\FSharp.Compiler.Service.MSBuild.v12\FSharp.Compiler.Service.MSBuild.v12.fsproj", "{8157B50E-397D-4232-A4E0-1977AFC7076D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x86 = Debug|x86 - Proto|Any CPU = Proto|Any CPU - Proto|Mixed Platforms = Proto|Mixed Platforms - Proto|x86 = Proto|x86 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms Release|x86 = Release|x86 @@ -100,12 +99,6 @@ Global {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.Build.0 = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.ActiveCfg = Release|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.Build.0 = Release|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -117,11 +110,6 @@ Global {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Debug|x86.ActiveCfg = Debug|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Proto|Any CPU.Build.0 = Release|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Proto|x86.ActiveCfg = Release|Any CPU {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Release|Any CPU.ActiveCfg = Release|Any CPU {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Release|Any CPU.Build.0 = Release|Any CPU {A40507D6-FA48-43D3-B18A-AE3DAACE4020}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -132,11 +120,6 @@ Global {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Debug|x86.ActiveCfg = Debug|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Proto|Any CPU.Build.0 = Release|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Proto|x86.ActiveCfg = Release|Any CPU {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Release|Any CPU.ActiveCfg = Release|Any CPU {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Release|Any CPU.Build.0 = Release|Any CPU {067E95E5-E3DC-4CA7-813A-4D1E277D2D52}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -147,11 +130,6 @@ Global {92793069-816F-4F69-84AC-0966F8275E65}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {92793069-816F-4F69-84AC-0966F8275E65}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {92793069-816F-4F69-84AC-0966F8275E65}.Debug|x86.ActiveCfg = Debug|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Proto|Any CPU.Build.0 = Release|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {92793069-816F-4F69-84AC-0966F8275E65}.Proto|x86.ActiveCfg = Release|Any CPU {92793069-816F-4F69-84AC-0966F8275E65}.Release|Any CPU.ActiveCfg = Release|Any CPU {92793069-816F-4F69-84AC-0966F8275E65}.Release|Any CPU.Build.0 = Release|Any CPU {92793069-816F-4F69-84AC-0966F8275E65}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -162,11 +140,6 @@ Global {C816728D-BBEA-472D-9F6C-E8913957A673}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C816728D-BBEA-472D-9F6C-E8913957A673}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {C816728D-BBEA-472D-9F6C-E8913957A673}.Debug|x86.ActiveCfg = Debug|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Proto|Any CPU.Build.0 = Release|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {C816728D-BBEA-472D-9F6C-E8913957A673}.Proto|x86.ActiveCfg = Release|Any CPU {C816728D-BBEA-472D-9F6C-E8913957A673}.Release|Any CPU.ActiveCfg = Release|Any CPU {C816728D-BBEA-472D-9F6C-E8913957A673}.Release|Any CPU.Build.0 = Release|Any CPU {C816728D-BBEA-472D-9F6C-E8913957A673}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -177,11 +150,6 @@ Global {5EF9FF95-1C75-458A-983A-168E43945913}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {5EF9FF95-1C75-458A-983A-168E43945913}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {5EF9FF95-1C75-458A-983A-168E43945913}.Debug|x86.ActiveCfg = Debug|Any CPU - {5EF9FF95-1C75-458A-983A-168E43945913}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {5EF9FF95-1C75-458A-983A-168E43945913}.Proto|Any CPU.Build.0 = Release|Any CPU - {5EF9FF95-1C75-458A-983A-168E43945913}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {5EF9FF95-1C75-458A-983A-168E43945913}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {5EF9FF95-1C75-458A-983A-168E43945913}.Proto|x86.ActiveCfg = Release|Any CPU {5EF9FF95-1C75-458A-983A-168E43945913}.Release|Any CPU.ActiveCfg = Release|Any CPU {5EF9FF95-1C75-458A-983A-168E43945913}.Release|Any CPU.Build.0 = Release|Any CPU {5EF9FF95-1C75-458A-983A-168E43945913}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -192,11 +160,6 @@ Global {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|x86.ActiveCfg = Debug|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Any CPU.Build.0 = Release|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|x86.ActiveCfg = Release|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.ActiveCfg = Release|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.Build.0 = Release|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -207,11 +170,6 @@ Global {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|x86.ActiveCfg = Debug|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Any CPU.Build.0 = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|x86.ActiveCfg = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.Build.0 = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -223,12 +181,6 @@ Global {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Debug|x86.ActiveCfg = Debug|Any CPU {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Debug|x86.Build.0 = Debug|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Proto|Any CPU.Build.0 = Release|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Proto|x86.ActiveCfg = Release|Any CPU - {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Proto|x86.Build.0 = Release|Any CPU {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Release|Any CPU.ActiveCfg = Release|Any CPU {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Release|Any CPU.Build.0 = Release|Any CPU {F9540CA8-1CE0-4546-A23A-A461E416E95B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -240,11 +192,6 @@ Global {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Debug|x86.ActiveCfg = Debug|Any CPU - {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Proto|Any CPU.Build.0 = Release|Any CPU - {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Proto|x86.ActiveCfg = Release|Any CPU {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Release|Any CPU.ActiveCfg = Release|Any CPU {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Release|Any CPU.Build.0 = Release|Any CPU {B1BDD96D-47E1-4E65-8107-FBAE23A06DB4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -255,11 +202,6 @@ Global {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Debug|x86.ActiveCfg = Debug|Any CPU - {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Proto|Any CPU.Build.0 = Release|Any CPU - {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Proto|x86.ActiveCfg = Release|Any CPU {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Release|Any CPU.ActiveCfg = Release|Any CPU {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Release|Any CPU.Build.0 = Release|Any CPU {893C3CD9-5AF8-4027-A667-21E62FC2C703}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -271,18 +213,24 @@ Global {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|x86.ActiveCfg = Debug|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|x86.Build.0 = Debug|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Any CPU.Build.0 = Release|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Mixed Platforms.ActiveCfg = Release|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Mixed Platforms.Build.0 = Release|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|x86.ActiveCfg = Release|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|x86.Build.0 = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Any CPU.Build.0 = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|x86.ActiveCfg = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|x86.Build.0 = Release|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|x86.ActiveCfg = Debug|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Debug|x86.Build.0 = Debug|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|Any CPU.Build.0 = Release|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|x86.ActiveCfg = Release|Any CPU + {8157B50E-397D-4232-A4E0-1977AFC7076D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/nuget/FSharp.Compiler.Service.template b/nuget/FSharp.Compiler.Service.template index 33b3aff212..0dfc5c1089 100644 --- a/nuget/FSharp.Compiler.Service.template +++ b/nuget/FSharp.Compiler.Service.template @@ -18,6 +18,8 @@ files ../bin/v4.5/FSharp.Compiler.Service.dll ==> lib/net45 ../bin/v4.5/FSharp.Compiler.Service.xml ==> lib/net45 ../bin/v4.5/FSharp.Compiler.Service.?db ==> lib/net45 + ../bin/v4.5/FSharp.Compiler.Service.dll.?db ==> lib/net45 + ../bin/v4.5/FSharp.Compiler.Service.MSBuild.v12.dll ==> lib/net45 dependencies System.Collections.Immutable >= LOCKEDVERSION System.Reflection.Metadata >= LOCKEDVERSION \ No newline at end of file diff --git a/src/absil/illib.fs b/src/absil/illib.fs index 3b2f844243..5d06388aa2 100755 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -8,7 +8,6 @@ open System open System.Collections open System.Collections.Generic open Internal.Utilities -open Internal.Utilities.Collections #if FX_RESHAPED_REFLECTION open Microsoft.FSharp.Core.ReflectionAdapters diff --git a/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.MSBuild.v12.dll.fs b/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.MSBuild.v12.dll.fs new file mode 100644 index 0000000000..c7f68fe89a --- /dev/null +++ b/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.MSBuild.v12.dll.fs @@ -0,0 +1,14 @@ +// 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. + +namespace Microsoft.FSharp +open System.Reflection +open System.Runtime.InteropServices + +[] +[] +[] +[] + +[] +[] +do() diff --git a/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.MSBuild.v14.dll.fs b/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.MSBuild.v14.dll.fs new file mode 100644 index 0000000000..4eddab4910 --- /dev/null +++ b/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.MSBuild.v14.dll.fs @@ -0,0 +1,14 @@ +// 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. + +namespace Microsoft.FSharp +open System.Reflection +open System.Runtime.InteropServices + +[] +[] +[] +[] + +[] +[] +do() diff --git a/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.dll.fs b/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.dll.fs index a3a1114770..c4bd292e62 100755 --- a/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.dll.fs +++ b/src/assemblyinfo/assemblyinfo.FSharp.Compiler.Service.dll.fs @@ -10,6 +10,12 @@ open System.Runtime.InteropServices [] [] +[] +[] +[] +[] +[] +[] [] #if NO_STRONG_NAMES diff --git a/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj b/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj new file mode 100644 index 0000000000..b5d6cf9cff --- /dev/null +++ b/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj @@ -0,0 +1,105 @@ + + + + + Debug + AnyCPU + Library + FSharp.Compiler.Service.MSBuild.v12 + $(NoWarn);44;62;9 + {8157b50e-397d-4232-a4e0-1977afc7076d} + true + v4.5 + 0x06800000 + $(OtherFlags) /warnon:1182 + true + true + $(OtherFlags) --times + $(NoWarn);69;65;54;61;75 + true + ..\..\..\bin\$(TargetFrameworkVersion) + $(OutputPath)\$(AssemblyName).xml + $(DefineConstants);CROSS_PLATFORM_COMPILER + $(DefineConstants);FX_ATLEAST_45 + $(DefineConstants);FX_ATLEAST_40 + $(DefineConstants);FX_MSBUILDRESOLVER_RUNTIMELIKE + 4.4.0.0 + $(MSBuildProjectDirectory)\..\..\..\ + + false + true + AnyCPU + + + + DEBUG; $(DefineConstants) + false + $(OtherFlags) --no-jit-optimize --jit-tracking + + + true + + + + AssemblyInfo/assemblyinfo.FSharp.Compiler.Service.MSBuild.v12.dll.fs + + + AssemblyInfo/assemblyinfo.shared.fs + + + Service/MSBuildReferenceResolver.fs + + + + + + + + + + + True + + + True + + + True + + + True + + + True + + + False + + + FSharp.Compiler.Service + {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} + True + + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets + + + $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets + + + + + + + + \ No newline at end of file diff --git a/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/paket.references b/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/paket.references new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/project.json b/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/project.json new file mode 100644 index 0000000000..7e75972caa --- /dev/null +++ b/src/fsharp/FSharp.Compiler.Service.MSBuild.v12/project.json @@ -0,0 +1,56 @@ +{ + "version": "8.0.0", + "buildOptions": { + "debugType": "portable", + "compilerName": "fsc", + "compile": { + "includeFiles": [ + "../../assemblyinfo/assemblyinfo.FSharp.Compiler.Service.dll.MSBuild.v12.fs", + "../../assemblyinfo/assemblyinfo.shared.fs", + "../../utils/reshapedmsbuild.fs", + "../MSBuildReferenceResolver.fs" + ] + }, + "define": [ + "FX_ATLEAST_35", + "FX_ATLEAST_40", + "FX_ATLEAST_45", + "FX_ATLEAST_LINQ", + "FX_ATLEAST_PORTABLE", + "TODO_REWORK_ASSEMBLY_LOAD" + ], + "xmlDoc": true, + "delaySign": true, + "warningsAsErrors": true + }, + "dependencies": { + "NETStandard.Library": "1.6.0", + "System.Diagnostics.TraceSource": "4.0.0", + "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*", + "System.Collections.Immutable": "1.2.0", + "System.Security.Cryptography.Algorithms": "4.2.0", + "System.Security.Cryptography.Primitives": "4.0.0", + "System.Reflection.Metadata": "1.4.1-beta-24227-04", + "System.Diagnostics.Process": "4.1.0", + "FSharp.Compiler.Service": { + "version": "8.0.0", + "target": "project" + } + }, + "tools": { + "dotnet-fssrgen": "3.2.*", + "dotnet-mergenupkg": { "version": "1.0.*" }, + "dotnet-compile-fsc": { + "version": "1.0.0-preview2-*", + "imports": "dnxcore50" + } + }, + "frameworks": { + "netstandard1.6": { + "imports": [ + "portable-net45+win81", + "dnxcore50" + ] + } + } +} diff --git a/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index ba9fc020f8..98a5787bcc 100644 --- a/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -604,8 +604,8 @@ Service/reshapedmsbuild.fs - - Service/MSBuildReferenceResolver.fs + + Service/SimulatedMSBuildReferenceResolver.fs Service/service.fsi @@ -633,21 +633,6 @@ - - True - - - True - - - True - - - True - - - True - False diff --git a/src/fsharp/FSharp.Compiler.Service/project.json b/src/fsharp/FSharp.Compiler.Service/project.json index 147e25de89..d4509181c9 100644 --- a/src/fsharp/FSharp.Compiler.Service/project.json +++ b/src/fsharp/FSharp.Compiler.Service/project.json @@ -167,7 +167,7 @@ "../vs/ServiceUntypedParse.fsi", "../vs/ServiceUntypedParse.fs", "../../utils/reshapedmsbuild.fs", - "../MSBuildReferenceResolver.fs", + "../SimulatedMSBuildReferenceResolver.fs", "../vs/service.fsi", "../vs/service.fs", "../vs/SimpleServices.fsi", diff --git a/src/fsharp/MSBuildReferenceResolver.fs b/src/fsharp/MSBuildReferenceResolver.fs index 44b99c02ff..7db8159419 100644 --- a/src/fsharp/MSBuildReferenceResolver.fs +++ b/src/fsharp/MSBuildReferenceResolver.fs @@ -182,15 +182,27 @@ module internal Microsoft.FSharp.Compiler.MSBuildReferenceResolver | AssemblyFolders -> lineIfExists resolvedPath + lineIfExists fusionName +#if CROSS_PLATFORM_COMPILER + + "Found by AssemblyFolders registry key" +#else + FSComp.SR.assemblyResolutionFoundByAssemblyFoldersKey() +#endif | AssemblyFoldersEx -> lineIfExists resolvedPath + lineIfExists fusionName +#if CROSS_PLATFORM_COMPILER + + "Found by AssemblyFoldersEx registry key" +#else + FSComp.SR.assemblyResolutionFoundByAssemblyFoldersExKey() +#endif | TargetFrameworkDirectory -> lineIfExists resolvedPath + lineIfExists fusionName +#if CROSS_PLATFORM_COMPILER + + ".NET Framework" +#else + FSComp.SR.assemblyResolutionNetFramework() +#endif | Unknown -> // Unknown when resolved by plain directory search without help from MSBuild resolver. lineIfExists resolvedPath @@ -199,7 +211,11 @@ module internal Microsoft.FSharp.Compiler.MSBuildReferenceResolver lineIfExists fusionName | GlobalAssemblyCache -> lineIfExists fusionName +#if CROSS_PLATFORM_COMPILER + + "Global Assembly Cache" +#else + lineIfExists (FSComp.SR.assemblyResolutionGAC()) +#endif + lineIfExists redist | Path _ -> lineIfExists resolvedPath diff --git a/src/fsharp/ReferenceResolver.fs b/src/fsharp/ReferenceResolver.fs index 8228ac8da9..5c8737e575 100644 --- a/src/fsharp/ReferenceResolver.fs +++ b/src/fsharp/ReferenceResolver.fs @@ -1,56 +1,56 @@ // 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. -namespace Microsoft.FSharp.Compiler - -module internal ReferenceResolver = - - exception ResolutionFailure - - type ResolutionEnvironment = - /// Indicates a script or source being compiled - | CompileTimeLike - /// Indicates a script or source being interpreted - | RuntimeLike - /// Indicates a script or source being edited - | DesignTimeLike - - type ResolvedFile = - { /// Item specification. - itemSpec:string - /// Prepare textual information about where the assembly was resolved from, used for tooltip output - prepareToolTip: string * string -> string - /// Round-tripped baggage - baggage:string - } - - override this.ToString() = sprintf "ResolvedFile(%s)" this.itemSpec - - type Resolver = - /// Get the "v4.5.1"-style moniker for the highest installed .NET Framework version. - /// This is the value passed back to Resolve if no explicit "mscorlib" has been given. - /// - /// Note: If an explicit "mscorlib" is given, then --noframework is being used, and the whole ReferenceResolver logic is essentially - /// unused. However in the future an option may be added to allow an expicit specification of - /// a .NET Framework version to use for scripts. - abstract HighestInstalledNetFrameworkVersion : unit -> string +module internal Microsoft.FSharp.Compiler.ReferenceResolver + +open System + +exception ResolutionFailure + +type ResolutionEnvironment = + /// Indicates a script or source being compiled + | CompileTimeLike + /// Indicates a script or source being interpreted + | RuntimeLike + /// Indicates a script or source being edited + | DesignTimeLike + +type ResolvedFile = + { /// Item specification. + itemSpec:string + /// Prepare textual information about where the assembly was resolved from, used for tooltip output + prepareToolTip: string * string -> string + /// Round-tripped baggage + baggage:string + } + + override this.ToString() = sprintf "ResolvedFile(%s)" this.itemSpec + +type Resolver = + /// Get the "v4.5.1"-style moniker for the highest installed .NET Framework version. + /// This is the value passed back to Resolve if no explicit "mscorlib" has been given. + /// + /// Note: If an explicit "mscorlib" is given, then --noframework is being used, and the whole ReferenceResolver logic is essentially + /// unused. However in the future an option may be added to allow an expicit specification of + /// a .NET Framework version to use for scripts. + abstract HighestInstalledNetFrameworkVersion : unit -> string - /// Get the Reference Assemblies directory for the .NET Framework (on Windows) - /// This is added to the default resolution path for - /// design-time compilations. - abstract DotNetFrameworkReferenceAssembliesRootDirectory : string - - /// Perform assembly resolution on the given references under the given conditions - abstract Resolve : - resolutionEnvironment: ResolutionEnvironment * - // The actual reference paths or assemby name text, plus baggage - references:(string (* baggage *) * string)[] * - // e.g. v4.5.1 - targetFrameworkVersion:string * - targetFrameworkDirectories:string list * - targetProcessorArchitecture:string * - fsharpCoreDir:string * - explicitIncludeDirs:string list * - implicitIncludeDir:string * - logMessage:(string->unit) * - logErrorOrWarning:(bool -> string -> string -> unit) - -> ResolvedFile[] + /// Get the Reference Assemblies directory for the .NET Framework (on Windows) + /// This is added to the default resolution path for + /// design-time compilations. + abstract DotNetFrameworkReferenceAssembliesRootDirectory : string + + /// Perform assembly resolution on the given references under the given conditions + abstract Resolve : + resolutionEnvironment: ResolutionEnvironment * + // The actual reference paths or assemby name text, plus baggage + references:(string (* baggage *) * string)[] * + // e.g. v4.5.1 + targetFrameworkVersion:string * + targetFrameworkDirectories:string list * + targetProcessorArchitecture:string * + fsharpCoreDir:string * + explicitIncludeDirs:string list * + implicitIncludeDir:string * + logMessage:(string->unit) * + logErrorOrWarning:((*isError*)bool -> string -> string -> unit) + -> ResolvedFile[] diff --git a/src/fsharp/SimulatedMSBuildReferenceResolver.fs b/src/fsharp/SimulatedMSBuildReferenceResolver.fs new file mode 100644 index 0000000000..3fbcf906f4 --- /dev/null +++ b/src/fsharp/SimulatedMSBuildReferenceResolver.fs @@ -0,0 +1,229 @@ +// 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. + +#if INTERACTIVE +#load "../utils/ResizeArray.fs" "../absil/illib.fs" "../fsharp/ReferenceResolver.fs" +#else +module internal Microsoft.FSharp.Compiler.SimulatedMSBuildReferenceResolver +#endif + +open System +open System.IO +open System.Reflection +open Microsoft.Win32 +open Microsoft.FSharp.Compiler +open Microsoft.FSharp.Compiler.ReferenceResolver +open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library + +let internal SimulatedMSBuildResolver = + { new Resolver with + member __.HighestInstalledNetFrameworkVersion() = "v4.5" + member __.DotNetFrameworkReferenceAssembliesRootDirectory = +#if RESHAPED_MSBUILD + "" +#else + if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then + let PF = + match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with + | null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF + | s -> s + PF + @"\Reference Assemblies\Microsoft\Framework\.NETFramework" + else + "" +#endif + + member __.Resolve(resolutionEnvironment, references, targetFrameworkVersion, targetFrameworkDirectories, targetProcessorArchitecture, + fsharpCoreDir, explicitIncludeDirs, implicitIncludeDir, logMessage, logWarningOrError) = + +#if !RESHAPED_MSBUILD + let registrySearchPaths() = + [ let registryKey = @"Software\Microsoft\.NetFramework"; + use key = Registry.LocalMachine.OpenSubKey(registryKey) + match key with + | null -> () + | _ -> + for subKeyName in key.GetSubKeyNames() do + use subKey = key.OpenSubKey(subKeyName) + use subSubKey = subKey.OpenSubKey("AssemblyFoldersEx") + match subSubKey with + | null -> () + | _ -> + for subSubSubKeyName in subSubKey.GetSubKeyNames() do + use subSubSubKey = subSubKey.OpenSubKey(subSubSubKeyName) + match subSubSubKey.GetValue(null) with + | :? string as s -> yield s + | _ -> () + use subSubKey = key.OpenSubKey("AssemblyFolders") + match subSubKey with + | null -> () + | _ -> + for subSubSubKeyName in subSubKey.GetSubKeyNames() do + let subSubSubKey = subSubKey.OpenSubKey(subSubSubKeyName) + match subSubSubKey.GetValue(null) with + | :? string as s -> yield s + | _ -> () ] +#endif + + let results = ResizeArray() + let searchPaths = + [ yield! targetFrameworkDirectories + yield! explicitIncludeDirs + yield fsharpCoreDir + yield implicitIncludeDir +#if !RESHAPED_MSBUILD + if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then + yield! registrySearchPaths() +#endif + ] + + for (r, baggage) in references do + //printfn "resolving %s" r + let mutable found = false + let success path = + if not found then + //printfn "resolved %s --> %s" r path + found <- true + results.Add { itemSpec = path; prepareToolTip = snd; baggage=baggage } + + try + if not found && Path.IsPathRooted(r) then + if FileSystem.SafeExists(r) then + success r + with e -> logWarningOrError false "SR001" (e.ToString()) + +#if !RESHAPED_MSBUILD + // For this one we need to get the version search exactly right, without doing a load + try + if not found && r.StartsWith("FSharp.Core, Version=") && Environment.OSVersion.Platform = PlatformID.Win32NT then + let n = AssemblyName(r) + let fscoreDir0 = + let PF = + match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with + | null -> Environment.GetEnvironmentVariable("ProgramFiles") + | s -> s + PF + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\" + n.Version.ToString() + let trialPath = Path.Combine(fscoreDir0,n.Name + ".dll") + if FileSystem.SafeExists(trialPath) then + success trialPath + with e -> logWarningOrError false "SR001" (e.ToString()) +#endif + + let isFileName = + r.EndsWith("dll",StringComparison.OrdinalIgnoreCase) || + r.EndsWith("exe",StringComparison.OrdinalIgnoreCase) + + let qual = if isFileName then r else try AssemblyName(r).Name + ".dll" with _ -> r + ".dll" + + for searchPath in searchPaths do + try + if not found then + let trialPath = Path.Combine(searchPath,qual) + if FileSystem.SafeExists(trialPath) then + success trialPath + with e -> logWarningOrError false "SR001" (e.ToString()) + +#if !RESHAPED_MSBUILD + try + // Seach the GAC on Windows + if not found && not isFileName && Environment.OSVersion.Platform = PlatformID.Win32NT then + let n = AssemblyName(r) + let netfx = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + let gac = Path.Combine(Path.GetDirectoryName(Path.GetDirectoryName(netfx.TrimEnd('\\'))),"assembly") + match n.Version, n.GetPublicKeyToken() with + | null, _ | _,null -> + let options = + [ for gacdir in Directory.EnumerateDirectories(gac) do + let assdir = Path.Combine(gacdir,n.Name) + if Directory.Exists(assdir) then + for tdir in Directory.EnumerateDirectories(assdir) do + let trialPath = Path.Combine(tdir,qual) + if FileSystem.SafeExists(trialPath) then + yield trialPath ] + //printfn "sorting GAC paths: %A" options + options + |> List.sort // puts latest version last + |> List.tryLast + |> function None -> () | Some p -> success p + + | v,tok -> + for gacdir in Directory.EnumerateDirectories(gac) do + //printfn "searching GAC directory: %s" gacdir + let assdir = Path.Combine(gacdir,n.Name) + if Directory.Exists(assdir) then + //printfn "searching GAC directory: %s" assdir + + let tokText = String.concat "" [| for b in tok -> sprintf "%02x" b |] + let verdir = Path.Combine(assdir,"v4.0_"+v.ToString()+"__"+tokText) + //printfn "searching GAC directory: %s" verdir + + if Directory.Exists(verdir) then + let trialPath = Path.Combine(verdir,qual) + //printfn "searching GAC: %s" trialPath + if FileSystem.SafeExists(trialPath) then + success trialPath + with e -> logWarningOrError false "SR001" (e.ToString()) +#endif + + results.ToArray() } + +let internal GetBestAvailableResolver(msbuildEnabled: bool) = +#if RESHAPED_MSBUILD + ignore msbuildEnabled +#else + let tryMSBuild v = + // Detect if MSBuild is on the machine, if so use the resolver from there + let mb = try Assembly.Load(sprintf "Microsoft.Build.Framework, Version=%s.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" v) |> Option.ofObj with _ -> None + let ass = mb |> Option.bind (fun _ -> try Assembly.Load(sprintf "FSharp.Compiler.Service.MSBuild.v%s" v) |> Option.ofObj with _ -> None) + let ty = ass |> Option.bind (fun ass -> ass.GetType("Microsoft.FSharp.Compiler.MSBuildReferenceResolver") |> Option.ofObj) + let obj = ty |> Option.bind (fun ty -> ty.InvokeMember("get_Resolver",BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.InvokeMethod ||| BindingFlags.NonPublic, null, null, [| |]) |> Option.ofObj) + let resolver = obj |> Option.bind (fun obj -> match obj with :? Resolver as r -> Some r | _ -> None) + resolver + match (if msbuildEnabled then tryMSBuild "12" else None) with + | Some r -> r + | None -> +#endif + SimulatedMSBuildResolver + + +#if INTERACTIVE +// Some manual testing +SimulatedMSBuildResolver.DotNetFrameworkReferenceAssembliesRootDirectory +SimulatedMSBuildResolver.HighestInstalledNetFrameworkVersion() + +let fscoreDir = + if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows + let PF = + match Environment.GetEnvironmentVariable("ProgramFiles(x86)") with + | null -> Environment.GetEnvironmentVariable("ProgramFiles") // if PFx86 is null, then we are 32-bit and just get PF + | s -> s + PF + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.4.0.0" + else + System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + +let resolve s = + SimulatedMSBuildResolver.Resolve(ResolutionEnvironment.CompileTimeLike,[| for a in s -> (a, "") |],"v4.5.1", [SimulatedMSBuildResolver.DotNetFrameworkReferenceAssembliesRootDirectory + @"\v4.5.1" ],"", "", fscoreDir,[],__SOURCE_DIRECTORY__,ignore, (fun _ _ -> ()), (fun _ _-> ())) + +// Resolve partial name to something on search path +resolve ["FSharp.Core" ] + +// Resolve DLL name to something on search path +resolve ["FSharp.Core.dll" ] + +// Resolve from reference assemblies +resolve ["System"; "mscorlib"; "mscorlib.dll" ] + +// Resolve from Registry AssemblyFolders +resolve ["Microsoft.SqlServer.Dmf.dll"; "Microsoft.SqlServer.Dmf" ] + +// Resolve exact version of FSharp.Core +resolve [ "FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" ] + +// Resolve from GAC: +resolve [ "EventViewer, Version=6.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" ] + +// Resolve from GAC: +resolve [ "EventViewer" ] + +resolve [ "Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ] +resolve [ "Microsoft.SharePoint.Client, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ] +#endif + diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 9a9100b3ea..ddeae1ff2f 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -2317,7 +2317,7 @@ let internal DriveFsiEventLoop (fsi: FsiEvaluationSessionHostConfig, fsiConsoleO /// The primary type, representing a full F# Interactive session, reading from the given /// text input, writing to the given text output and error writers. -type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], inReader:TextReader, outWriter:TextWriter, errorWriter: TextWriter, fsiCollectible: bool) = +type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], inReader:TextReader, outWriter:TextWriter, errorWriter: TextWriter, fsiCollectible: bool, msbuildEnabled: bool) = #if DYNAMIC_CODE_REWRITES_CONSOLE_WRITE do Microsoft.FSharp.Core.Printf.setWriter outWriter @@ -2374,7 +2374,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i if containsRequiredFiles then defaultFSharpBinariesDir else Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None).Value - let referenceResolver = MSBuildReferenceResolver.Resolver + let referenceResolver = SimulatedMSBuildReferenceResolver.GetBestAvailableResolver(msbuildEnabled) let tcConfigB = TcConfigBuilder.CreateNew(referenceResolver, defaultFSharpBinariesDir, @@ -2721,12 +2721,9 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i GC.KeepAlive fsiInterruptController.EventHandlers - new (fsiConfig, argv, inReader, outWriter, errorWriter) = - new FsiEvaluationSession (fsiConfig, argv, inReader, outWriter, errorWriter, fsiCollectible=false) - - static member Create(fsiConfig, argv, inReader, outWriter, errorWriter, ?collectible) = - new FsiEvaluationSession(fsiConfig, argv, inReader, outWriter, errorWriter, defaultArg collectible false) - + static member Create(fsiConfig, argv, inReader, outWriter, errorWriter, ?collectible, ?msbuildEnabled) = + new FsiEvaluationSession(fsiConfig, argv, inReader, outWriter, errorWriter, defaultArg collectible false, defaultArg msbuildEnabled true) + static member GetDefaultConfiguration(fsiObj:obj) = FsiEvaluationSession.GetDefaultConfiguration(fsiObj, true) static member GetDefaultConfiguration(fsiObj:obj, useFsiAuxLib) = diff --git a/src/fsharp/fsi/fsi.fsi b/src/fsharp/fsi/fsi.fsi index c76e54a987..6c9c343486 100644 --- a/src/fsharp/fsi/fsi.fsi +++ b/src/fsharp/fsi/fsi.fsi @@ -110,14 +110,11 @@ type public FsiEvaluationSessionHostConfig = /// Represents an F# Interactive evaluation session. +[] type FsiEvaluationSession = interface System.IDisposable - /// Create an FsiEvaluationSession, reading from the given text input, writing to the given text output and error writers. - [] - new : fsiConfig: FsiEvaluationSessionHostConfig * argv:string[] * inReader:TextReader * outWriter:TextWriter * errorWriter: TextWriter -> FsiEvaluationSession - /// Create an FsiEvaluationSession, reading from the given text input, writing to the given text output and error writers. /// /// Create an FsiEvaluationSession, reading from the given text input, writing to the given text output and error writers @@ -127,7 +124,7 @@ type FsiEvaluationSession = /// Read input from the given reader /// Write output to the given writer /// Optionally make the dynamic assmbly for the session collectible - static member Create : fsiConfig: FsiEvaluationSessionHostConfig * argv:string[] * inReader:TextReader * outWriter:TextWriter * errorWriter: TextWriter * ?collectible: bool -> FsiEvaluationSession + static member Create : fsiConfig: FsiEvaluationSessionHostConfig * argv:string[] * inReader:TextReader * outWriter:TextWriter * errorWriter: TextWriter * ?collectible: bool * ?msbuildEnabled: bool -> FsiEvaluationSession /// A host calls this to request an interrupt on the evaluation thread. member Interrupt : unit -> unit @@ -256,6 +253,7 @@ type FsiEvaluationSession = static member GetDefaultConfiguration: unit -> FsiEvaluationSessionHostConfig + /// A default implementation of the 'fsi' object, used by GetDefaultConfiguration() module Settings = /// An event loop used by the currently executing F# Interactive session to execute code diff --git a/src/fsharp/vs/SimpleServices.fs b/src/fsharp/vs/SimpleServices.fs index 3a9fd3025d..e9a596e327 100644 --- a/src/fsharp/vs/SimpleServices.fs +++ b/src/fsharp/vs/SimpleServices.fs @@ -108,12 +108,12 @@ namespace Microsoft.FSharp.Compiler.SimpleSourceCodeServices member x.GetDeclarations(line, col, qualifyingNames, partialName, ?xmlCommentRetriever) = x.GetDeclarationListInfo(Line.fromZ line, col, qualifyingNames, partialName, ?xmlCommentRetriever=xmlCommentRetriever) /// Provides simple services for checking and compiling F# scripts - type public SimpleSourceCodeServices() = + type public SimpleSourceCodeServices(?msbuildEnabled) = - let checker = InteractiveChecker.Create() + let checker = InteractiveChecker.Create(?msbuildEnabled=msbuildEnabled) let fileversion = 0 let loadTime = DateTime.Now - let referenceResolver = MSBuildReferenceResolver.Resolver + let referenceResolver = checker.ReferenceResolver /// Tokenize a single line, returning token information and a tokenization state represented by an integer member x.TokenizeLine (line: string, state: int64) : FSharpTokenInfo[] * int64 = diff --git a/src/fsharp/vs/SimpleServices.fsi b/src/fsharp/vs/SimpleServices.fsi index 328cebb893..e729057b26 100644 --- a/src/fsharp/vs/SimpleServices.fsi +++ b/src/fsharp/vs/SimpleServices.fsi @@ -81,7 +81,7 @@ type SimpleCheckFileResults = type SimpleSourceCodeServices = /// Create a singleton global isntance for checking and compiling F# scripts - new: unit -> SimpleSourceCodeServices + new: ?msbuildEnabled: bool -> SimpleSourceCodeServices /// Tokenize a single line, returning token information and a tokenization state represented by an integer member TokenizeLine: line:string * state:int64 -> FSharpTokenInfo [] * int64 diff --git a/src/fsharp/vs/service.fs b/src/fsharp/vs/service.fs index 182d63ffa0..50bfa1fa57 100755 --- a/src/fsharp/vs/service.fs +++ b/src/fsharp/vs/service.fs @@ -2736,13 +2736,15 @@ type FSharpChecker(referenceResolver, projectCacheSize, keepAssemblyContents, ke let maxMemEvent = new Event() /// Instantiate an interactive checker. - static member Create(?projectCacheSize, ?keepAssemblyContents, ?keepAllBackgroundResolutions) = - let referenceResolver = MSBuildReferenceResolver.Resolver + static member Create(?projectCacheSize, ?keepAssemblyContents, ?keepAllBackgroundResolutions, ?msbuildEnabled) = + let referenceResolver = SimulatedMSBuildReferenceResolver.GetBestAvailableResolver(defaultArg msbuildEnabled true) let keepAssemblyContents = defaultArg keepAssemblyContents false let keepAllBackgroundResolutions = defaultArg keepAllBackgroundResolutions true let projectCacheSizeReal = defaultArg projectCacheSize projectCacheSizeDefault new FSharpChecker(referenceResolver, projectCacheSizeReal,keepAssemblyContents, keepAllBackgroundResolutions) + member ic.ReferenceResolver = referenceResolver + member ic.MatchBracesAlternate(filename, source, options) = async { match braceMatchCache.TryGet (filename, source, options) with diff --git a/src/fsharp/vs/service.fsi b/src/fsharp/vs/service.fsi index 1fc5e64be6..f748925cd7 100755 --- a/src/fsharp/vs/service.fsi +++ b/src/fsharp/vs/service.fsi @@ -413,7 +413,8 @@ type FSharpChecker = /// The optional size of the project checking cache. /// Keep the checked contents of projects. /// If false, do not keep full intermediate checking results from background checking suitable for returning from GetBackgroundCheckResultsForFileInProject. This reduces memory usage. - static member Create : ?projectCacheSize: int * ?keepAssemblyContents: bool * ?keepAllBackgroundResolutions: bool -> FSharpChecker + /// If false, no dependency on MSBuild v12 is assumed. If true, at attempt is made to load MSBuild for reference resolution in scripts + static member Create : ?projectCacheSize: int * ?keepAssemblyContents: bool * ?keepAllBackgroundResolutions: bool * ?msbuildEnabled: bool -> FSharpChecker /// /// Parse a source code file, returning information about brace matching in the file. @@ -730,9 +731,11 @@ type FSharpChecker = [] member TypeCheckSource : parsed: FSharpParseFileResults * filename: string * fileversion: int * source: string * options: FSharpProjectOptions * isResultObsolete: IsResultObsolete * textSnapshotInfo: obj -> FSharpCheckFileAnswer option - // One shared global singleton for use by multiple add-ins + [] static member Instance : FSharpChecker member internal FrameworkImportsCache : FrameworkImportsCache + member internal ReferenceResolver : ReferenceResolver.Resolver + // An object to typecheck source in a given typechecking environment. diff --git a/tests/service/FSharp.Compiler.Service.Tests.fsproj b/tests/service/FSharp.Compiler.Service.Tests.fsproj index 0d2ad6bb97..178fab3b46 100644 --- a/tests/service/FSharp.Compiler.Service.Tests.fsproj +++ b/tests/service/FSharp.Compiler.Service.Tests.fsproj @@ -99,11 +99,6 @@ {887630a3-4b1d-40ea-b8b3-2d842e9c40db} True - - TestTP - {ff76bd3c-5e0a-4752-b6c3-044f6e15719b} - True - diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 095abdbaac..2f2dd0a4f9 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -4510,15 +4510,6 @@ module Project35b = let options = checker.GetProjectOptionsFromScript(fileName1, fileSource1) |> Async.RunSynchronously #endif -[] -let ``Test project35b Dependency files for ParseFileInProject`` () = - // This is testing legacy functionality - let parseFileResults = checker.ParseFileInProject(Project35b.fileName1, Project35b.fileSource1, Project35b.options) |> Async.RunSynchronously - for d in parseFileResults.DependencyFiles do - printfn "ParseFileInProject dependency: %s" d - parseFileResults.DependencyFiles |> List.exists (fun s -> s.Contains "notexist.dll") |> shouldEqual true - parseFileResults.DependencyFiles |> List.exists (fun s -> s.Contains Project35b.fileName1) |> shouldEqual true - [] let ``Test project35b Dependency files for ParseAndCheckFileInProject`` () = let checkFileResults =