Skip to content

Commit

Permalink
Merge pull request SuaveIO#674 from SuaveIO/target-netstandard2.0
Browse files Browse the repository at this point in the history
Target netstandard2.0
  • Loading branch information
ademar authored Dec 27, 2017
2 parents 448bada + d329933 commit 8d7162b
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 46 deletions.
11 changes: 4 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace :dotnetcli do
end

task :coreclr_binaries => 'tools/coreclr' do
dotnet_version = '2.0.0'
dotnet_version = '2.0.3'
dotnet_installed_version = get_installed_dotnet_version
# check if required version of .net core sdk is already installed, otherwise download and install it
if dotnet_installed_version == dotnet_version then
Expand Down Expand Up @@ -189,10 +189,7 @@ namespace :dotnetcli do
version = SemVer.find.format("%M.%m.%p%s")

Dir.chdir "tools" do
[ "Suave", "Suave.Testing", "Suave.Experimental", "Suave.DotLiquid" ].each do |item|
merge_nugets(dotnet_exe_path, item, version, "netstandard1.6")
end
[ "Suave.LibUv" ].each do |item|
[ "Suave", "Suave.Testing", "Suave.Experimental", "Suave.DotLiquid", "Suave.LibUv" ].each do |item|
merge_nugets(dotnet_exe_path, item, version, "netstandard2.0")
end
end
Expand Down Expand Up @@ -261,8 +258,8 @@ task :nugets => ['build/pkg', :versioning, :compile, :nugets_quick]
desc 'create suave nuget with .NET Core'
task :nugets_with_netcore => [:nugets, 'dotnetcli:do_netcorepackage', 'dotnetcli:merge']

desc 'compile, gen versions and test'
task :ci => [:compile, :'tests:unit', :'dotnetcli:unit']
desc 'compile, gen versions, test and generate nuget'
task :ci => [:compile, :'tests:unit', :'dotnetcli:unit', :nugets_with_netcore]

desc 'compile, gen versions, test'
task :default => [:compile, :'tests:unit', :'docs:build']
Expand Down
4 changes: 2 additions & 2 deletions examples/Example/Example.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>Example</AssemblyName>
<DefineConstants>$(DefineConstants);DNXCORE50</DefineConstants>
<DefineConstants>$(DefineConstants);NETCOREAPP1_1</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\paket-files\examples\haf\YoLo\YoLo.fs">
Expand Down
2 changes: 1 addition & 1 deletion examples/Pong/Pong.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>Pong</AssemblyName>
</PropertyGroup>
Expand Down
13 changes: 6 additions & 7 deletions src/Experimental/Suave.Experimental.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\</OutputPath>
Expand All @@ -26,7 +26,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -40,25 +40,24 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Debug\Experimental.xml</DocumentationFile>
<DocumentationFile>bin\Debug\Suave.Experimental.xml</DocumentationFile>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>bin\Release\Experimental.xml</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<DocumentationFile>bin\Release\Suave.Experimental.xml</DocumentationFile>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<Choose>
Expand Down
3 changes: 2 additions & 1 deletion src/Experimental/Suave.Experimental.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Suave.Experimental</AssemblyName>
<PackageId>Suave.Experimental</PackageId>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -13,6 +13,7 @@
<Compile Include="Template.fs" />
<Compile Include="Data.fs" />
<Compile Include="Form.fs" />
<Compile Include="AssemblyVersionInfo.fs" Condition="Exists('AssemblyVersionInfo.fs')" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Suave\Suave.netcore.fsproj" PrivateAssets="All" />
Expand Down
4 changes: 2 additions & 2 deletions src/Suave.DotLiquid/Suave.DotLiquid.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<DocumentationFile>bin\Debug\Suave.DotLiquid.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -41,7 +41,7 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand Down
3 changes: 2 additions & 1 deletion src/Suave.DotLiquid/Suave.DotLiquid.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Suave.DotLiquid</AssemblyName>
<PackageId>Suave.DotLiquid</PackageId>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DefineConstants>$(DefineConstants);DNXCORE50;NETSTANDARD1_5</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="Library.fs" />
<Compile Include="AssemblyVersionInfo.fs" Condition="Exists('AssemblyVersionInfo.fs')" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Suave\Suave.netcore.fsproj" PrivateAssets="All" />
Expand Down
1 change: 1 addition & 0 deletions src/Suave.LibUv/Suave.LibUv.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants>
Expand Down
1 change: 1 addition & 0 deletions src/Suave.LibUv/Suave.LibUv.netcore.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Compile Include="Native.fs" />
<Compile Include="Tcp.fs" />
<Compile Include="LibUvServerFactory.fs" />
<Compile Include="AssemblyVersionInfo.fs" Condition="Exists('AssemblyVersionInfo.fs')" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Suave\Suave.netcore.fsproj" PrivateAssets="All" />
Expand Down
4 changes: 2 additions & 2 deletions src/Suave.OpenSSL/Suave.OpenSSL.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -51,7 +51,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand Down
4 changes: 2 additions & 2 deletions src/Suave.Razor/Suave.Razor.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<DocumentationFile>bin\Debug\Suave.Razor.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -41,7 +41,7 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand Down
4 changes: 2 additions & 2 deletions src/Suave.Testing/Suave.Testing.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<DocumentationFile>bin\Debug\Suave.Testing.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
Expand Down Expand Up @@ -51,7 +51,7 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>none</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
Expand Down
2 changes: 1 addition & 1 deletion src/Suave.Testing/Suave.Testing.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Suave.Testing</AssemblyName>
<PackageId>Suave.Testing</PackageId>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
4 changes: 2 additions & 2 deletions src/Suave.Tests/Suave.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
Expand All @@ -48,7 +48,7 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
Expand Down
4 changes: 2 additions & 2 deletions src/Suave.Xsp/Suave.Xsp.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<DocumentationFile>bin\Debug\Suave.Xsp.XML</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -41,7 +41,7 @@
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>bin\Release\</OutputPath>
Expand Down
28 changes: 21 additions & 7 deletions src/Suave.netcore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26124.0
MinimumVisualStudioVersion = 15.0.26124.0
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Suave.netcore", "Suave/Suave.netcore.fsproj", "{87A7BC50-A26D-4370-B175-BF4BB4E7416B}"
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Suave.netcore", "Suave\Suave.netcore.fsproj", "{87A7BC50-A26D-4370-B175-BF4BB4E7416B}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Suave.DotLiquid.netcore", "Suave.DotLiquid/Suave.DotLiquid.netcore.fsproj", "{FF35C4E4-9B3C-42F1-96C3-6972D9A94DAD}"
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Suave.DotLiquid.netcore", "Suave.DotLiquid\Suave.DotLiquid.netcore.fsproj", "{FF35C4E4-9B3C-42F1-96C3-6972D9A94DAD}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Suave.Experimental.netcore", "Experimental/Suave.Experimental.netcore.fsproj", "{44C7A32F-EA26-49D4-82C9-8B51E17524D0}"
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Suave.Experimental.netcore", "Experimental\Suave.Experimental.netcore.fsproj", "{44C7A32F-EA26-49D4-82C9-8B51E17524D0}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Suave.Testing.netcore", "Suave.Testing/Suave.Testing.netcore.fsproj", "{D0F5B5CB-9CF6-4E32-8F46-030279294C32}"
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Suave.Testing.netcore", "Suave.Testing\Suave.Testing.netcore.fsproj", "{D0F5B5CB-9CF6-4E32-8F46-030279294C32}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Suave.Tests.netcore", "Suave.Tests/Suave.Tests.netcore.fsproj", "{571C4BDE-692A-4AED-BE44-7F1F7A25EBED}"
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Suave.Tests.netcore", "Suave.Tests\Suave.Tests.netcore.fsproj", "{571C4BDE-692A-4AED-BE44-7F1F7A25EBED}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Example.netcore", "../examples/Example/Example.netcore.fsproj", "{22083A27-CB0B-48CA-A9E9-9DD3A4DCF841}"
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Example.netcore", "..\examples\Example\Example.netcore.fsproj", "{22083A27-CB0B-48CA-A9E9-9DD3A4DCF841}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Pong.netcore", "../examples/Pong/Pong.netcore.fsproj", "{A66900CD-B912-4C6C-B76A-008E94802380}"
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Pong.netcore", "..\examples\Pong\Pong.netcore.fsproj", "{A66900CD-B912-4C6C-B76A-008E94802380}"
EndProject
Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "Suave.LibUv.netcore", "Suave.LibUv\Suave.LibUv.netcore.fsproj", "{83A5DD6C-29E5-4516-8316-3944243D2EC0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -114,5 +116,17 @@ Global
{A66900CD-B912-4C6C-B76A-008E94802380}.Release|x64.Build.0 = Release|x64
{A66900CD-B912-4C6C-B76A-008E94802380}.Release|x86.ActiveCfg = Release|x86
{A66900CD-B912-4C6C-B76A-008E94802380}.Release|x86.Build.0 = Release|x86
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Debug|x64.ActiveCfg = Debug|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Debug|x64.Build.0 = Debug|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Debug|x86.ActiveCfg = Debug|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Debug|x86.Build.0 = Debug|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Release|Any CPU.Build.0 = Release|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Release|x64.ActiveCfg = Release|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Release|x64.Build.0 = Release|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Release|x86.ActiveCfg = Release|Any CPU
{83A5DD6C-29E5-4516-8316-3944243D2EC0}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
8 changes: 4 additions & 4 deletions src/Suave/Owin.fs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ type WebSocketSendAsync =
type WebSocketReceiveAsync =
Func<ArraySegment<byte> (* data *),
CancellationToken (* cancel *),
Task<Tuple<int (* messageType *),
bool (* endOfMessage *),
int (* count *)>>>
Task<int (* messageType *) *
bool (* endOfMessage *) *
int (* count *)>>

type WebSocketReceiveTuple =
Tuple<int (* messageType *),
Expand Down Expand Up @@ -403,7 +403,7 @@ module OwinApp =
match result with
| Choice1Of2 (a,b,c) ->
Array.ConstrainedCopy(b, 0, data.Array, data.Offset, b.Length)
return Tuple<_,_,_>(int (fromOpcode a), true, b.Length)
return (int (fromOpcode a), true, b.Length)
| Choice2Of2 err ->
return failwith (err.ToString())
}
Expand Down
4 changes: 2 additions & 2 deletions src/Suave/Suave.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<DocumentationFile>bin\Release\Suave.xml</DocumentationFile>
<DefineConstants>
</DefineConstants>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup>
<MinimumVisualStudioVersion Condition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
Expand Down Expand Up @@ -62,7 +62,7 @@
<DocumentationFile>bin\Release\Suave.XML</DocumentationFile>
<DefineConstants>
</DefineConstants>
<DebugType>pdbonly</DebugType>
<DebugType>portable</DebugType>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<Choose>
Expand Down
2 changes: 1 addition & 1 deletion src/Suave/Suave.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Suave</AssemblyName>
<PackageId>Suave</PackageId>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down

0 comments on commit 8d7162b

Please sign in to comment.