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

use .net core sdk 1.0 rtm #590

Merged
merged 17 commits into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
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: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ project.lock.json
*.project.lock.json
dotnet-dev-*
tools/coreclr/
dotnet_cli_install.ps1
tools/dotnet-install.*
.vs/
.vscode/
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ DEPENDENCIES
albacore (~> 2.3)

BUNDLED WITH
1.12.5
1.14.6
99 changes: 42 additions & 57 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ asmver_files :asmver => :versioning do |a|
a.files = FileList[
'examples/**/*.fsproj',
'src/{Suave,Suave.*,Experimental}/*proj'
]
].exclude(/.netcore.fsproj/)
a.attributes assembly_description: suave_description,
assembly_configuration: Configuration,
assembly_company: 'Suave.io',
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace :dotnetcli do
end

task :coreclr_binaries => 'tools/coreclr' do
dotnet_version = '1.0.0-preview2-003131'
dotnet_version = '1.0.1'
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 All @@ -116,82 +116,72 @@ namespace :dotnetcli do
puts "Found .NET Core SDK #{dotnet_installed_version} but require #{dotnet_version}. Downloading and installing in ./tools/coreclr"
end

coreclr_bin_dir = File.expand_path "tools/coreclr"

dotnet_exe_path = "dotnet"

case RUBY_PLATFORM
when /darwin/
filename = "dotnet-dev-osx-x64.#{dotnet_version}.tar.gz"
when /darwin/ , /linux/
system 'curl',
%W|-o tools/#{filename}
-L https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/#{dotnet_version}/#{filename}| \
unless File.exists? "tools/#{filename}"

system 'tar',
%W|xf tools/#{filename}
--directory tools/coreclr|
when /linux/
filename = "dotnet-dev-ubuntu.14.04-x64.#{dotnet_version}.tar.gz"
system 'curl',
%W|-o tools/#{filename}
-L https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/#{dotnet_version}/#{filename}| \
unless File.exists? "tools/#{filename}"
%W|-o tools/dotnet-install.sh
-L https://dot.net/v1/dotnet-install.sh| \
unless File.exists? "tools/dotnet-install.sh"

system 'tar',
%W|xf tools/#{filename}
--directory tools/coreclr|
end
if Albacore.windows?
system 'bash',
%W|--install-dir "#{coreclr_bin_dir}"
--channel "stable"
--version "#{dotnet_version}|

ENV['PATH'] = "#{coreclr_bin_dir}/dotnet:#{ENV['PATH']}"
else
system 'powershell',
%W|Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.ps1" -OutFile "dotnet_cli_install.ps1"|
%W|Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile "tools/dotnet-install.ps1"| \
unless File.exists? "tools/dotnet-install.ps1"

system 'powershell',
%W|-ExecutionPolicy Unrestricted ./dotnet_cli_install.ps1 -InstallDir "tools/coreclr" -Channel "preview" -version "#{dotnet_version}"|
%W|-ExecutionPolicy Unrestricted ./tools/dotnet-install.ps1
-InstallDir "#{coreclr_bin_dir}"
-Channel "stable"
-Version "#{dotnet_version}"|

ENV['PATH'] = "#{coreclr_bin_dir};#{ENV['PATH']}"
end

dotnet_exe_path = "#{Dir.pwd}/tools/coreclr/dotnet"
end

desc 'Restore the CoreCLR binaries'
task :restore => :coreclr_binaries do
Dir.chdir "src" do
system dotnet_exe_path, "restore"
end
system dotnet_exe_path, %W|restore src/Suave.netcore.sln -v n|
end

task :build_lib => :coreclr_binaries do
[ "src/Suave", "src/Experimental", "src/Suave.DotLiquid" ].each do |item|
Dir.chdir "#{item}" do
system dotnet_exe_path, %W|--verbose build --configuration #{Configuration} -f netstandard1.6|
Dir.chdir "../.."
end
end
system dotnet_exe_path, %W|build src/Suave.netcore.sln -c #{Configuration} -v n|
end

desc 'Build Suave and test project'
task :build => [:build_lib]

directory 'build/pkg-netcore'

desc 'Create Suave nugets packages'
task :pack => :coreclr_binaries do
[ "src/Suave", "src/Experimental", "src/Suave.DotLiquid" ].each do |item|
Dir.chdir "#{item}" do
system dotnet_exe_path, %W|--verbose pack --configuration #{Configuration} --no-build|
Dir.chdir "../.."
end
task :pack => [:versioning, 'build/pkg-netcore', :coreclr_binaries] do
out_dir = File.expand_path "build/pkg-netcore"
[ "src/Suave/Suave.netcore.fsproj", "src/Experimental/Suave.Experimental.netcore.fsproj", "src/Suave.DotLiquid/Suave.DotLiquid.netcore.fsproj" ].each do |item|
system dotnet_exe_path, %W|pack #{item} --configuration #{Configuration} --output "#{out_dir}" --no-build -v n /p:Version=#{ENV['NUGET_VERSION']}|
end
end

task :do_netcorepackage => [ :restore, :build, :pack ]

desc 'Merge standard and dotnetcli nupkgs; note the need to run :nugets before'
task :merge => :coreclr_binaries do
[ "Suave", "Experimental", "Suave.DotLiquid" ].each do |item|
Dir.chdir "src/#{item}" do
version = SemVer.find.format("%M.%m.%p%s")
if item == "Experimental" then
sourcenupkg = "../../build/pkg/Suave.Experimental.#{version}.nupkg"
clinupkg = "bin/#{Configuration}/Experimental.#{version}-dotnetcli.nupkg"
else
sourcenupkg = "../../build/pkg/#{item}.#{version}.nupkg"
clinupkg = "bin/#{Configuration}/#{item}.#{version}-dotnetcli.nupkg"
end
system dotnet_exe_path, %W|mergenupkg --source "#{sourcenupkg}" --other "#{clinupkg}" --framework netstandard1.6|
system dotnet_exe_path, %W|restore tools/tools.proj -v n|
Dir.chdir "tools" do
[ "Suave", "Suave.Experimental", "Suave.DotLiquid" ].each do |item|
version = SemVer.find.format("%M.%m.%p%s")
sourcenupkg = "../build/pkg/#{item}.#{version}.nupkg"
netcorenupkg = "../build/pkg-netcore/#{item}.#{version}.nupkg"
system dotnet_exe_path, %W|mergenupkg --source "#{sourcenupkg}" --other "#{netcorenupkg}" --framework netstandard1.6|
end
end
end
Expand Down Expand Up @@ -219,7 +209,7 @@ task :tests => [:'tests:stress', :'tests:unit']
directory 'build/pkg'

task :create_nuget_quick => [:versioning, 'build/pkg'] do
projects = FileList['src/**/*.fsproj'].exclude(/Tests/)
projects = FileList['src/**/*.fsproj'].exclude(/.netcore.fsproj/).exclude(/Tests/)
knowns = Set.new(projects.map { |f| Albacore::Project.new f }.map { |p| p.id })
authors = "Ademar Gonzalez, Henrik Feldt"
projects.each do |f|
Expand Down Expand Up @@ -275,11 +265,6 @@ task :increase_version_number do
s.save
version = s.format("%M.%m.%p%s")
ENV['NUGET_VERSION'] = version
projectjson = 'src/Suave/project.json'
contents = File.read(projectjson).gsub(/"version": ".*-dotnetcli"/, %{"version": "#{version}-dotnetcli"})
File.open(projectjson, 'w') do |out|
out << contents
end
end

namespace :docs do
Expand Down
1 change: 0 additions & 1 deletion examples/Example/Example.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="paket.references" />
<None Include="Example.project.json" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
Expand Down
22 changes: 22 additions & 0 deletions examples/Example/Example.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>Example</AssemblyName>
<DefineConstants>$(DefineConstants);DNXCORE50</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="../../paket-files/haf/YoLo/YoLo.fs" />
<Compile Include="CounterDemo.fs" />
<Compile Include="Program.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.1.*" />
<ProjectReference Include="../../src/Suave/Suave.netcore.fsproj" />
</ItemGroup>

</Project>
4 changes: 0 additions & 4 deletions examples/Example/Example.project.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/Example/NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="fsharp-daily" value="https://www.myget.org/F/fsharp-daily/api/v3/index.json" />
<!-- That's the suave nuget feed with netcore package -->
<add key="suave-builds" value="https://www.myget.org/F/suave-builds/api/v3/index.json" />
<!-- Locally built package -->
<add key="local-build" value="../../build/pkg" />
</packageSources>
Expand Down
4 changes: 2 additions & 2 deletions examples/Example/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ let testApp =
RequestErrors.NOT_FOUND "Found no handlers"
]

#if NETSTANDARD1_5
#if NETCOREAPP1_1
#else
System.Net.ServicePointManager.DefaultConnectionLimit <- Int32.MaxValue
#endif
Expand Down Expand Up @@ -228,7 +228,7 @@ let main argv =
compressedFilesFolder = None
logger = logger
tcpServerFactory = new DefaultTcpServerFactory()
#if NETSTANDARD1_5
#if NETCOREAPP1_1
cookieSerialiser = new JsonFormatterSerialiser()
#else
cookieSerialiser = new BinaryFormatterSerialiser()
Expand Down
48 changes: 0 additions & 48 deletions examples/Example/project.json

This file was deleted.

33 changes: 33 additions & 0 deletions src/Experimental/Suave.Experimental.netcore.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.6</TargetFramework>
<AssemblyName>Suave.Experimental</AssemblyName>
<PackageId>Suave.Experimental</PackageId>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DefineConstants>$(DefineConstants);DNXCORE50;NETSTANDARD1_5</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Include="Html.fs" />
<Compile Include="Xml.fs" />
<Compile Include="Template.fs" />
<Compile Include="Data.fs" />
<Compile Include="Form.fs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Suave" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FSharp.NET.Sdk" Version="1.0.*" PrivateAssets="All" />
<PackageReference Include="FSharp.Core" Version="4.1.*" />
<PackageReference Include="System.Reflection" Version="4.3.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.0" />
<PackageReference Include="System.Net.Mail" Version="1.0.0-rtm-00002" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>

</Project>
57 changes: 0 additions & 57 deletions src/Experimental/project.json

This file was deleted.

Loading