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

Support .NET Core using .NET Core SDK #293

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
605c8d1
ignore project.lock.json
enricosada Jul 21, 2016
3023e62
add library project.json
enricosada Jul 21, 2016
c1b955e
specify source files in project.json
enricosada Jul 21, 2016
9b8e894
like pcl, netstandard1.6 doesnt support GetCultures
enricosada Jul 21, 2016
cf0ba67
ifdef missing exception classes who doesnt exists in netstandard1.6, …
enricosada Jul 21, 2016
7e5c1fe
create xunit test project.json
enricosada Jul 21, 2016
9c17e08
fix name of library under tests
enricosada Jul 21, 2016
ccb92c2
add global.json
enricosada Jul 21, 2016
090f626
add FsCheck.Xunit project.json
enricosada Jul 21, 2016
2204053
f fix xunit version
enricosada Jul 21, 2016
446cf1d
add some tests
enricosada Jul 21, 2016
a568195
add more tests, without unquote
enricosada Jul 21, 2016
dd12d45
workaround issue with csproj/fsproj in same dir as project.json
enricosada Jul 21, 2016
8ff2cbf
fix package version
enricosada Jul 21, 2016
94b32dd
use dotnet-mergenupkg tool to merge netcore package inside normal pac…
enricosada Jul 21, 2016
a4d974f
add build/test/pack of .net core in fake script
enricosada Jul 21, 2016
9c5d371
the appveyor Visual Studio 2015 build worker image has the .net core …
enricosada Jul 21, 2016
4c8dac1
build with travis (osx/ubuntu)
enricosada Jul 21, 2016
d40589f
add FsCheck.NUnit project.json
enricosada Jul 26, 2016
ad4be1f
add fscheck.nunit to fake
enricosada Jul 26, 2016
ae3ae1e
f eof
enricosada Jul 26, 2016
2e71f48
workaround issue with csproj/fsproj in same dir as project.json
enricosada Jul 26, 2016
e08aab7
the fake target CI should package also .net core
enricosada Jul 28, 2016
77077a5
use fake helper to set version
enricosada Jul 28, 2016
15036d3
fix package version
enricosada Jul 28, 2016
afa2d89
fix missing mergenupkg, log command
enricosada Jul 28, 2016
2e890f4
use `dotnet` key in travis to install .net core sdk
enricosada Sep 7, 2016
b48e7dd
fix build
enricosada Sep 7, 2016
975e2f9
osx now fails, previously was not used
enricosada Sep 7, 2016
662c10d
add also examples
enricosada Sep 9, 2016
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,6 @@ release.cmd
.fake/
docs/tools/FSharp.Formatting.svclog
docs/tools/XmlWriter
project.lock.json
.vscode

14 changes: 13 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
language: csharp

sudo: false
matrix:
include:
- os: linux # Ubuntu 14.04
dist: trusty
sudo: required
mono: latest
dotnet: 1.0.0-preview2-003121
- os: osx # OSX 10.11
osx_image: xcode7.2
mono: latest
dotnet: 1.0.0-preview2-003121
allow_failures:
- os: osx

script:
- ./build.sh GenerateDocs
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
os: Visual Studio 2015

init:
- git config --global core.autocrlf input
build_script:
Expand Down
41 changes: 41 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,42 @@ Target "Release" (fun _ ->
Branches.pushTag "" "origin" release.NugetVersion
)

// --------------------------------------------------------------------------------------
// .NET Core SDK and .NET Core

let assertExitCodeZero x = if x = 0 then () else failwithf "Command failed with exit code %i" x
let isDotnetSDKInstalled = try Shell.Exec("dotnet", "--version") = 0 with _ -> false
let shellExec cmd args dir =
printfn "%s %s" cmd args
Shell.Exec(cmd, args, dir) |> assertExitCodeZero


Target "SetVersionInProjectJSON" (fun _ ->
!! "./src/**/project.json"
|> Seq.iter (DotNetCli.SetVersionInProjectJson buildVersion)
)

Target "Build.NetCore" (fun _ ->
shellExec "dotnet" "restore" "."
shellExec "dotnet" "--verbose pack --configuration Release" "src/FsCheck"
shellExec "dotnet" "--verbose pack --configuration Release" "src/FsCheck.Xunit"
shellExec "dotnet" "--verbose pack --configuration Release" "src/FsCheck.NUnit"
)

Target "RunTests.NetCore" (fun _ ->
shellExec "dotnet" "--verbose test --configuration Release" "tests/FsCheck.Test"
)

Target "Nuget.AddNetCore" (fun _ ->

for name in [ "FsCheck"; "FsCheck.NUnit"; "FsCheck.Xunit" ] do
let nupkg = sprintf "../../bin/%s.%s.nupkg" name buildVersion
let netcoreNupkg = sprintf "bin/Release/%s.%s.nupkg" name buildVersion

shellExec "dotnet" (sprintf """mergenupkg --source "%s" --other "%s" --framework netstandard1.6 """ nupkg netcoreNupkg) (sprintf "src/%s/" name)

)

// --------------------------------------------------------------------------------------
// Run all targets by default. Invoke 'build <Target>' to override

Expand All @@ -233,7 +269,10 @@ Target "CI" DoNothing
"Clean"
=?> ("BuildVersion", isAppVeyorBuild)
==> "AssemblyInfo"
==> "SetVersionInProjectJSON"
==> "Build"
=?> ("Build.NetCore", isDotnetSDKInstalled)
=?> ("RunTests.NetCore", isDotnetSDKInstalled)
==> "RunTests"

"RunTests"
Expand All @@ -246,6 +285,7 @@ Target "CI" DoNothing
"RunTests"
=?> ("SourceLink", isLocalBuild && not isLinux)
==> "PaketPack"
=?> ("Nuget.AddNetCore", isDotnetSDKInstalled)
==> "PaketPush"
==> "Release"

Expand All @@ -254,6 +294,7 @@ Target "CI" DoNothing

"RunTests"
==> "PaketPack"
=?> ("Nuget.AddNetCore", isDotnetSDKInstalled)
==> "CI"

RunTargetOrDefault "RunTests"
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
<ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
21 changes: 21 additions & 0 deletions examples/FsCheck.CSharpExamples/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"FsCheck": { "target": "project" }
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"imports": "dnxcore50"
}
}
}
1 change: 1 addition & 0 deletions examples/FsCheck.Examples/FsCheck.Examples.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</TargetFrameworkProfile>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
<ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
34 changes: 34 additions & 0 deletions examples/FsCheck.Examples/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"compilerName": "fsc",
"compile": {
"includeFiles": [
"Examples.fs"
]
}
},
"dependencies": {
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*",
"FsCheck": { "target": "project" }
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"imports": "dnxcore50"
}
},
"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": "dnxcore50"
}
}
}
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"projects":[ "src", "tests", "examples" ]
}
2 changes: 1 addition & 1 deletion paket.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NUGET
remote: https://www.nuget.org/api/v2
specs:
FAKE (4.24.3)
FAKE (4.35.1)
FSharp.Compiler.Service (2.0.0.6)
FSharp.Formatting (2.14.2)
FSharp.Compiler.Service (2.0.0.6)
Expand Down
1 change: 1 addition & 0 deletions src/FsCheck.NUnit/FsCheck.NUnit.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</TargetFrameworkProfile>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
38 changes: 38 additions & 0 deletions src/FsCheck.NUnit/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": "3.0.0-alpha",
"buildOptions": {
"debugType": "portable",
"compilerName": "fsc",
"compile": {
"includeFiles": [
"AssemblyInfo.fs",
"FsCheckPropertyAttribute.fs"
]
}
},
"dependencies": {
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*",
"NUnit": "3.4.1",
"FsCheck": {
"target": "project"
}
},
"frameworks": {
"netstandard1.6": {
"imports": "portable-net45+win8",
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
},
"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": "dnxcore50"
},
"dotnet-mergenupkg": {
"target": "package",
"version": "1.0.*"
}
}
}
1 change: 1 addition & 0 deletions src/FsCheck.Xunit/FsCheck.Xunit.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
</TargetFrameworkProfile>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
37 changes: 37 additions & 0 deletions src/FsCheck.Xunit/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "3.0.0-alpha",
"buildOptions": {
"debugType": "portable",
"compilerName": "fsc",
"compile": {
"includeFiles": [
"AssemblyInfo.fs",
"PropertyAttribute.fs"
]
}
},
"dependencies": {
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*",
"FsCheck": {
"target": "project"
},
"xunit.extensibility.execution": "2.2.0-beta2-build3300"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
},
"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": "dnxcore50"
},
"dotnet-mergenupkg": {
"target": "package",
"version": "1.0.*"
}
}
}
11 changes: 7 additions & 4 deletions src/FsCheck/Arbitrary.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace FsCheck

open System

#if PCL
#if PCL || NETSTANDARD1_6
#else
open System.Net
open System.Net.Mail
Expand Down Expand Up @@ -644,11 +644,14 @@ module Arb =
NullReferenceException()
OutOfMemoryException()
#if PCL
#else
#if NETSTANDARD1_6
#else
NotFiniteNumberException()
StackOverflowException()
#endif
IO.DirectoryNotFoundException()
IO.FileLoadException()
StackOverflowException()
KeyNotFoundException()
IO.PathTooLongException()
#endif
Expand Down Expand Up @@ -902,7 +905,7 @@ module Arb =
|> convert (fun x -> x :> IDictionary<_,_>) (fun x -> x :?> Dictionary<_,_>)

static member Culture() =
#if PCL
#if PCL || NETSTANDARD1_6
let cultures =
cultureNames |> Seq.choose (fun name -> try Some (CultureInfo name) with _ -> None)
|> Seq.append [ CultureInfo.InvariantCulture;
Expand Down Expand Up @@ -936,7 +939,7 @@ module Arb =
return Guid((a: int),b,c,d,e,f,g,h,i,j,k)
} |> fromGen

#if PCL
#if PCL || NETSTANDARD1_6
#else
static member IPAddress() =
let generator = generate |> Gen.arrayOfLength 4 |> Gen.map IPAddress
Expand Down
2 changes: 1 addition & 1 deletion src/FsCheck/Data.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace FsCheck

module internal Data =

#if PCL
#if PCL || NETSTANDARD1_6

let cultureNames = [
"af"; "af-ZA";
Expand Down
1 change: 1 addition & 0 deletions src/FsCheck/FsCheck.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
49 changes: 49 additions & 0 deletions src/FsCheck/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"version": "3.0.0-alpha",
"buildOptions": {
"debugType": "portable",
"compilerName": "fsc",
"compile": {
"includeFiles": [
"AssemblyInfo.fs",
"Common.fs",
"Data.fs",
"Random.fs",
"Reflect.fs",
"TypeClass.fs",
"Gen.fs",
"ReflectArbitrary.fs",
"Arbitrary.fs",
"ArbitraryExtensions.fs",
"GenExtensions.fs",
"Testable.fs",
"Prop.fs",
"PropExtensions.fs",
"Commands.fs",
"StateMachine.fs",
"Runner.fs",
"RunnerExtensions.fs"
]
}
},
"dependencies": {
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
},
"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": "dnxcore50"
},
"dotnet-mergenupkg": {
"target": "package",
"version": "1.0.*"
}
}
}
Loading