Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FSharp.Core to netstandard2.0 #6771

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions FSharp.Profiles.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BEGINEND_READWRITE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_BINARY_SERIALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CONVERTER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_DEFAULT_DEPENDENCY_TYPE</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_CORHOST_SIGNER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_EVENTWAITHANDLE_IDISPOSABLE</DefineConstants>
Expand All @@ -24,7 +23,6 @@
<DefineConstants>$(DefineConstants);FX_NO_PARAMETERIZED_THREAD_START</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_READER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_PDB_WRITER</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_MODULE_HANDLES</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_REFLECTION_ONLY</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
<DefineConstants>$(DefineConstants);FX_NO_SECURITY_PERMISSIONS</DefineConstants>
Expand Down
2 changes: 1 addition & 1 deletion src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PreRelease>true</PreRelease>
<TargetFrameworks>net45;netstandard1.6</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<PackageId>FSharp.Core</PackageId>
<NuspecFile>FSharp.Core.nuspec</NuspecFile>
<IsPackable>true</IsPackable>
Expand Down
44 changes: 10 additions & 34 deletions src/fsharp/FSharp.Core.nuget/FSharp.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,26 @@
<iconUrl>http://fsharp.org/img/logo.png</iconUrl>
<language>en-US</language>
<dependencies>
<group targetFramework=".NETStandard1.6">
<dependency id="System.Collections" version="4.0.11" />
<dependency id="System.Console" version="4.0.0" />
<dependency id="System.Diagnostics.Debug" version="4.0.11" />
<dependency id="System.Diagnostics.Tools" version="4.0.1" />
<dependency id="System.Globalization" version="4.0.11" />
<dependency id="System.IO" version="4.1.0" />
<dependency id="System.Linq" version="4.1.0" />
<dependency id="System.Linq.Expressions" version="4.1.0" />
<dependency id="System.Linq.Queryable" version="4.0.1" />
<dependency id="System.Net.Requests" version="4.0.11" />
<dependency id="System.Reflection" version="4.1.0" />
<dependency id="System.Reflection.Extensions" version="4.0.1" />
<dependency id="System.Resources.ResourceManager" version="4.0.1" />
<dependency id="System.Runtime" version="4.1.0" />
<dependency id="System.Runtime.Extensions" version="4.1.0" />
<dependency id="System.Runtime.Numerics" version="4.0.1" />
<dependency id="System.Text.RegularExpressions" version="4.1.0" />
<dependency id="System.Threading" version="4.0.11" />
<dependency id="System.Threading.Tasks" version="4.0.11" />
<dependency id="System.Threading.Tasks.Parallel" version="4.0.1" />
<dependency id="System.Threading.Thread" version="4.0.0" />
<dependency id="System.Threading.ThreadPool" version="4.0.10" />
<dependency id="System.Threading.Timer" version="4.0.1" />
</group>
<group targetFramework=".NETStandard2.0">
<dependency id="NETStandard.Library" version="2.0.3" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to specify this dependency explicitly?

</group>
<group targetFramework="net45">
</group>
</dependencies>
</metadata>
<files>
<file src="FSharp.Core\$Configuration$\netstandard1.6\FSharp.Core.dll" target="lib\netstandard1.6" />
<file src="FSharp.Core\$Configuration$\netstandard1.6\FSharp.Core.sigdata" target="lib\netstandard1.6" />
<file src="FSharp.Core\$Configuration$\netstandard1.6\FSharp.Core.optdata" target="lib\netstandard1.6" />
<file src="FSharp.Core\$Configuration$\netstandard1.6\FSharp.Core.xml" target="lib\netstandard1.6" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.dll" target="lib\netstandard2.0" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.sigdata" target="lib\netstandard2.0" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.optdata" target="lib\netstandard2.0" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\FSharp.Core.xml" target="lib\netstandard2.0" />

<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.dll" target="lib\net45" />
<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.sigdata" target="lib\net45" />
<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.optdata" target="lib\net45" />
<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.xml" target="lib\net45" />
<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.dll" target="lib\net45" />
<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.sigdata" target="lib\net45" />
<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.optdata" target="lib\net45" />
<file src="FSharp.Core\$Configuration$\net45\FSharp.Core.xml" target="lib\net45" />

<!-- resources -->
<file src="FSharp.Core\$Configuration$\netstandard1.6\**\FSharp.Core.resources.dll" target="lib\netstandard1.6" />
<file src="FSharp.Core\$Configuration$\netstandard2.0\**\FSharp.Core.resources.dll" target="lib\netstandard2.0" />
<file src="FSharp.Core\$Configuration$\net45\**\FSharp.Core.resources.dll" target="lib\net45" />
</files>
</package>
7 changes: 1 addition & 6 deletions src/fsharp/FSharp.Core/FSharp.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net45;netstandard1.6</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netstandard1.6</TargetFrameworks>
<NoWarn>$(NoWarn);45;55;62;75;1204</NoWarn>
<AllowCrossTargeting>true</AllowCrossTargeting>
Expand Down Expand Up @@ -223,11 +223,6 @@
<PackageReference Include="System.Threading.Tasks.Parallel" Version="$(SystemThreadingTasksParallelVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.6'">
<PackageReference Include="System.Threading.Thread" Version="$(SystemThreadingThreadVersion)" />
<PackageReference Include="System.Threading.ThreadPool" Version="$(SystemThreadingThreadPoolVersion)" />
</ItemGroup>

<!-- Hook compilation phase to do custom work -->
<!-- NOTE: The optdata and sigdata files are no longer needed by the F# compiler (the information is -->
<!-- integrated as resources into more recent FSharp.Core.dll's. However they are still produced to -->
Expand Down
30 changes: 4 additions & 26 deletions src/fsharp/FSharp.Core/Testing.FSharp.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,13 @@
<tags>$tags$</tags>
<dependencies>
<group>
<dependency id="System.Collections" version="4.0.11" />
cartermp marked this conversation as resolved.
Show resolved Hide resolved
<dependency id="System.Console" version="4.0.0" />
<dependency id="System.Diagnostics.Debug" version="4.0.11" />
<dependency id="System.Diagnostics.Tools" version="4.0.1" />
<dependency id="System.Globalization" version="4.0.11" />
<dependency id="System.IO" version="4.1.0" />
<dependency id="System.Linq" version="4.1.0" />
<dependency id="System.Linq.Expressions" version="4.1.0" />
<dependency id="System.Linq.Queryable" version="4.0.1" />
<dependency id="System.Net.Requests" version="4.0.11" />
<dependency id="System.Reflection" version="4.1.0" />
<dependency id="System.Reflection.Extensions" version="4.0.1" />
<dependency id="System.Resources.ResourceManager" version="4.0.1" />
<dependency id="System.Runtime" version="4.1.0" />
<dependency id="System.Runtime.Extensions" version="4.1.0" />
<dependency id="System.Runtime.Numerics" version="4.0.1" />
<dependency id="System.Text.RegularExpressions" version="4.1.0" />
<dependency id="System.Threading" version="4.0.11" />
<dependency id="System.Threading.Tasks" version="4.0.11" />
<dependency id="System.Threading.Tasks.Parallel" version="4.0.1" />
<dependency id="System.Threading.Thread" version="4.0.0" />
<dependency id="System.Threading.ThreadPool" version="4.0.10" />
<dependency id="System.Threading.Timer" version="4.0.1" />
<dependency id="NETStandard.Library" version="2.0.3" />
</group>
</dependencies>
</metadata>
<files>
<file src="FSharp.Core.dll" target="lib\netstandard1.6" />
<file src="FSharp.Core.xml" target="lib\netstandard1.6" />
<file src="FSharp.Core.runtimeconfig.json" target="lib\netstandard1.6" />
<file src="FSharp.Core.dll" target="lib\netstandard2.0" />
<file src="FSharp.Core.xml" target="lib\netstandard2.0" />
<file src="FSharp.Core.runtimeconfig.json" target="lib\netstandard2.0" />
</files>
</package>
4 changes: 0 additions & 4 deletions src/fsharp/FSharp.Core/prim-types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2960,7 +2960,6 @@ namespace Microsoft.FSharp.Core
[<CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates")>]
static member op_Implicit(func : ('T -> 'Res) ) = new System.Func<'T,'Res>(func)

#if !FX_NO_CONVERTER
[<CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates")>]
static member op_Implicit(f : System.Converter<_,_>) : ('T -> 'Res) = (fun t -> f.Invoke(t))

Expand All @@ -2970,7 +2969,6 @@ namespace Microsoft.FSharp.Core
static member FromConverter (converter: System.Converter<_,_>) : ('T -> 'Res) = (fun t -> converter.Invoke(t))

static member ToConverter (func: ('T -> 'Res) ) = new System.Converter<'T,'Res>(func)
#endif

static member InvokeFast (func:FSharpFunc<_,_>, arg1: 'T, arg2: 'Res) = OptimizedClosures.invokeFast2(func, arg1, arg2)

Expand All @@ -2986,9 +2984,7 @@ namespace Microsoft.FSharp.Core

static member inline ToFSharpFunc (action: Action<_>) = (fun t -> action.Invoke(t))

#if !FX_NO_CONVERTER
static member inline ToFSharpFunc (converter : Converter<_,_>) = (fun t -> converter.Invoke(t))
#endif

// Note: this is not made public in the signature, because of conflicts with the Converter overload.
// The method remains in case someone is calling it via reflection.
Expand Down
5 changes: 0 additions & 5 deletions src/fsharp/FSharp.Core/prim-types.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -1503,8 +1503,6 @@ namespace Microsoft.FSharp.Core
/// <returns>'U</returns>
abstract member Invoke : func:'T -> 'U

#if !FX_NO_CONVERTER

/// <summary>Convert an F# first class function value to a value of type <c>System.Converter</c></summary>
/// <param name="func">The input function.</param>
/// <returns>A System.Converter of the function type.</returns>
Expand All @@ -1524,7 +1522,6 @@ namespace Microsoft.FSharp.Core
/// <param name="converter">The input System.Converter.</param>
/// <returns>An F# function of the same type.</returns>
static member FromConverter : converter:System.Converter<'T,'U> -> ('T -> 'U)
#endif

/// <summary>Invoke an F# first class function value with five curried arguments. In some cases this
/// will result in a more efficient application than applying the arguments successively.</summary>
Expand Down Expand Up @@ -1575,12 +1572,10 @@ namespace Microsoft.FSharp.Core
/// <returns>The F# function.</returns>
static member inline ToFSharpFunc : action:Action<'T> -> ('T -> unit)

#if !FX_NO_CONVERTER
/// <summary>Convert the given Converter delegate object to an F# function value</summary>
/// <param name="converter">The input Converter delegate.</param>
/// <returns>The F# function.</returns>
static member inline ToFSharpFunc : converter:Converter<'T,'U> -> ('T -> 'U)
#endif

/// <summary>Convert the given Action delegate object to an F# function value</summary>
/// <param name="func">The input Action delegate.</param>
Expand Down
12 changes: 0 additions & 12 deletions src/fsharp/FSharp.Core/quotations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1686,18 +1686,6 @@ module Patterns =

let decodedTopResources = new Dictionary<Assembly * string, int>(10, HashIdentity.Structural)

#if !FX_NO_REFLECTION_METADATA_TOKENS
#if FX_NO_REFLECTION_MODULE_HANDLES // not available on Silverlight
[<StructuralEquality;StructuralComparison>]
type ModuleHandle = ModuleHandle of string * string
type System.Reflection.Module with
member x.ModuleHandle = ModuleHandle(x.Assembly.FullName, x.Name)
#else
type ModuleHandle = System.ModuleHandle
#endif
#endif


#if FX_NO_REFLECTION_METADATA_TOKENS // not available on Compact Framework
[<StructuralEquality; NoComparison>]
type ReflectedDefinitionTableKey =
Expand Down
4 changes: 2 additions & 2 deletions tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
<Compile Include="FSharp.Core\Microsoft.FSharp.Quotations\FSharpQuotations.fs" />
<Compile Include="TypeForwarding.fs" />
<Compile Include="StructTuples.fs" />
<Compile Include="SurfaceArea.coreclr.fs" Condition="$(TargetFramework.StartsWith('netcoreapp')) and '$(FX_VERIFY_SURFACEAREA)' == 'true'" />
<Compile Include="SurfaceArea.net40.fs" Condition="$(TargetFramework.StartsWith('net4')) and '$(FX_VERIFY_SURFACEAREA)' == 'true'" />
<Compile Include="SurfaceArea.coreclr.fs" Condition="$(TargetFramework.StartsWith('netcoreapp'))" />
<Compile Include="SurfaceArea.net40.fs" Condition="$(TargetFramework.StartsWith('net4'))" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions tests/FSharp.Core.UnitTests/LibraryTestFx.fs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ let sleep(n : int32) =
System.Threading.Thread.Sleep(n)
#endif

#if VERIFY_SURFACEAREA
module SurfaceArea =
open System.Reflection
open System
Expand Down Expand Up @@ -173,4 +172,4 @@ module SurfaceArea =
sb.ToString ()

Assert.Fail msg
#endif
()
Loading