diff --git a/.paket/Paket.Restore.targets b/.paket/Paket.Restore.targets index d93abfef..e33a731f 100644 --- a/.paket/Paket.Restore.targets +++ b/.paket/Paket.Restore.targets @@ -17,23 +17,43 @@ native /Library/Frameworks/Mono.framework/Commands/mono mono - - $(PaketToolsPath)paket - $(PaketRootPath)paket.exe - $(PaketToolsPath)paket.exe - $(PaketToolsPath)paket.exe - $(PaketToolsPath)paket + + $(PaketRootPath)paket.bootstrapper.exe + $(PaketToolsPath)paket.bootstrapper.exe + $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\ + + + + + $(PaketRootPath)paket.exe + $(PaketToolsPath)paket.exe + $(PaketToolsPath)paket.exe + $(_PaketBootStrapperExeDir)paket.exe + paket.exe + + + $(PaketRootPath)paket + $(PaketToolsPath)paket + $(PaketToolsPath)paket + + + $(PaketRootPath)paket.exe + $(PaketToolsPath)paket.exe + + + $(PaketBootStrapperExeDir)paket.exe + + + paket <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)")) dotnet "$(PaketExePath)" - "$(PaketExePath)" $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" - "$(PaketExePath)" + "$(PaketExePath)" + - $(PaketRootPath)paket.bootstrapper.exe - $(PaketToolsPath)paket.bootstrapper.exe "$(PaketBootStrapperExePath)" $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)" @@ -42,6 +62,9 @@ true true + + + True @@ -82,7 +105,11 @@ true - + + true @@ -163,6 +190,7 @@ runtime runtime true + true @@ -200,6 +228,7 @@ + <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> @@ -209,12 +238,14 @@ $(MSBuildProjectDirectory)/$(MSBuildProjectFile) true + false + true false - true + true false - true + true false - true + true $(BaseIntermediateOutputPath)$(Configuration) $(BaseIntermediateOutputPath) @@ -230,6 +261,53 @@ + + ReleaseNotesHelper.parseReleaseNotes let useMsBuildToolchain = environVar "USE_MSBUILD" <> null -let dotnetSdkVersion = "2.1.403" +let dotnetSdkVersion = "2.2.105" let sdkPath = lazy DotNetCli.InstallDotNetSDK dotnetSdkVersion let getSdkPath() = sdkPath.Value diff --git a/src/ProvidedTypes.fs b/src/ProvidedTypes.fs index cc66f353..fe45b6fd 100644 --- a/src/ProvidedTypes.fs +++ b/src/ProvidedTypes.fs @@ -9226,66 +9226,7 @@ namespace ProviderImplementation.ProvidedTypes // Use the reflection hack to determine the set of referenced assemblies by reflecting over the SystemRuntimeContainsType // closure in the TypeProviderConfig object. - let referencedAssemblyPaths = - try - - let hostConfigType = config.GetType() - let hostAssembly = hostConfigType.Assembly - let hostAssemblyLocation = hostAssembly.Location - - let msg = sprintf "Host is assembly '%A' at location '%s'" (hostAssembly.GetName()) hostAssemblyLocation - - if isNull (hostConfigType.GetField("systemRuntimeContainsType",bindAll)) then - failwithf "Invalid host of cross-targeting type provider: a field called systemRuntimeContainsType must exist in the TypeProviderConfiguration object. Please check that the type provider being hosted by the F# compiler tools or a simulation of them. %s" msg - - let systemRuntimeContainsTypeObj = config.GetField("systemRuntimeContainsType") - - // Account for https://github.com/Microsoft/visualfsharp/pull/591 - let systemRuntimeContainsTypeObj2 = - if systemRuntimeContainsTypeObj.HasField("systemRuntimeContainsTypeRef") then - systemRuntimeContainsTypeObj.GetField("systemRuntimeContainsTypeRef").GetProperty("Value") - else - systemRuntimeContainsTypeObj - - if not (systemRuntimeContainsTypeObj2.HasField("tcImports")) then - failwithf "Invalid host of cross-targeting type provider: a field called tcImports must exist in the systemRuntimeContainsType closure. Please check that the type provider being hosted by the F# compiler tools or a simulation of them. %s" msg - - let tcImports = systemRuntimeContainsTypeObj2.GetField("tcImports") - - if not (tcImports.HasField("dllInfos")) then - failwithf "Invalid host of cross-targeting type provider: a field called dllInfos must exist in the tcImports object. Please check that the type provider being hosted by the F# compiler tools or a simulation of them. %s" msg - - if not (tcImports.HasProperty("Base")) then - failwithf "Invalid host of cross-targeting type provider: a field called Base must exist in the tcImports object. Please check that the type provider being hosted by the F# compiler tools or a simulation of them. %s" msg - - let dllInfos = tcImports.GetField("dllInfos") - if isNull dllInfos then - let ty = dllInfos.GetType() - let fld = ty.GetField("dllInfos", bindAll) - failwithf """Invalid host of cross-targeting type provider: unexpected 'null' value in dllInfos field of TcImports, ty = %A, fld = %A. %s""" ty fld msg - - let baseObj = tcImports.GetProperty("Base") - - [ for dllInfo in dllInfos.GetElements() -> (dllInfo.GetProperty("FileName") :?> string) - if not (isNull baseObj) then - let baseObjValue = baseObj.GetProperty("Value") - if isNull baseObjValue then - let ty = baseObjValue.GetType() - let prop = ty.GetProperty("Value", bindAll) - failwithf """Invalid host of cross-targeting type provider: unexpected 'null' value in Value property of baseObj, ty = %A, prop = %A. %s""" ty prop msg - - let baseDllInfos = baseObjValue.GetField("dllInfos") - - if isNull baseDllInfos then - let ty = baseDllInfos.GetType() - let fld = ty.GetField("dllInfos", bindAll) - failwithf """Invalid host of cross-targeting type provider: unexpected 'null' value in dllInfos field of baseDllInfos, ty = %A, fld = %A. %s""" ty fld msg - - for baseDllInfo in baseDllInfos.GetElements() -> (baseDllInfo.GetProperty("FileName") :?> string) ] - with e -> - failwithf "Invalid host of cross-targeting type provider. Exception: %A" e - - + let referencedAssemblyPaths = config.ReferencedAssemblies |> Array.toList ProvidedTypesContext(referencedAssemblyPaths, assemblyReplacementMap, sourceAssemblies) diff --git a/src/ProvidedTypesTesting.fs b/src/ProvidedTypesTesting.fs index e41d72a9..8685cb01 100644 --- a/src/ProvidedTypesTesting.fs +++ b/src/ProvidedTypesTesting.fs @@ -19,51 +19,16 @@ open Microsoft.FSharp.Reflection module Utils = let isNull x = match x with null -> true | _ -> false - -/// Simulate a real host of TypeProviderConfig -type internal DllInfo(path: string) = - member __.FileName = path - -/// Simulate a real host of TypeProviderConfig -type internal TcImports(bas: TcImports option, dllInfos: DllInfo list) = - member __.Base = bas - member __.DllInfos = dllInfos - - type internal Testing() = /// Simulates a real instance of TypeProviderConfig static member MakeSimulatedTypeProviderConfig (resolutionFolder: string, runtimeAssembly: string, runtimeAssemblyRefs: string list, ?isHostedExecution, ?isInvalidationSupported) = - - let cfg = TypeProviderConfig(fun _ -> false) + let cfg = TypeProviderConfig(fun _ -> failwith "SystemRuntimeContainsType is deprecated and should never be called") cfg.IsHostedExecution <- defaultArg isHostedExecution false cfg.IsInvalidationSupported <- defaultArg isInvalidationSupported true - let (?<-) cfg prop value = - let ty = cfg.GetType() - match ty.GetProperty(prop,BindingFlags.Instance ||| BindingFlags.Public ||| BindingFlags.NonPublic) with - | null -> - let fld = ty.GetField(prop,BindingFlags.Instance ||| BindingFlags.Public ||| BindingFlags.NonPublic) - if fld = null then failwith ("expected TypeProviderConfig to have a property or field "+prop) - fld.SetValue(cfg, value)|> ignore - | p -> - p.GetSetMethod(nonPublic = true).Invoke(cfg, [| box value |]) |> ignore - cfg?ResolutionFolder <- resolutionFolder - cfg?RuntimeAssembly <- runtimeAssembly - cfg?ReferencedAssemblies <- Array.zeroCreate 0 - - // Fake an implementation of SystemRuntimeContainsType the shape expected by AssemblyResolver.fs. - let dllInfos = [yield DllInfo(runtimeAssembly); for r in runtimeAssemblyRefs do yield DllInfo(r)] - let tcImports = TcImports(Some(TcImports(None,[])),dllInfos) - let systemRuntimeContainsType = (fun (_s:string) -> if tcImports.DllInfos.Length = 1 then true else true) - cfg?systemRuntimeContainsType <- systemRuntimeContainsType - - //Diagnostics.Debugger.Launch() |> ignore - Diagnostics.Debug.Assert(cfg.GetType().GetField("systemRuntimeContainsType",BindingFlags.NonPublic ||| BindingFlags.Public ||| BindingFlags.Instance) |> isNull |> not) - Diagnostics.Debug.Assert(systemRuntimeContainsType.GetType().GetField("tcImports",BindingFlags.NonPublic ||| BindingFlags.Public ||| BindingFlags.Instance) |> isNull |> not) - Diagnostics.Debug.Assert(typeof.GetField("dllInfos",BindingFlags.NonPublic ||| BindingFlags.Public ||| BindingFlags.Instance) |> isNull |> not) - Diagnostics.Debug.Assert(typeof.GetProperty("Base",BindingFlags.NonPublic ||| BindingFlags.Public ||| BindingFlags.Instance) |> isNull |> not) - Diagnostics.Debug.Assert(typeof.GetProperty("FileName",BindingFlags.NonPublic ||| BindingFlags.Public ||| BindingFlags.Instance) |> isNull |> not) - + cfg.ResolutionFolder <- resolutionFolder + cfg.RuntimeAssembly <- runtimeAssembly + cfg.ReferencedAssemblies <- Array.ofList runtimeAssemblyRefs cfg /// Simulates a real instance of TypeProviderConfig and then creates an instance of the last