Skip to content

Commit

Permalink
Merge branch 'refs/heads/enricosada-netcore_using_netcoresdkpreview2'…
Browse files Browse the repository at this point in the history
… into fscheck3
  • Loading branch information
kurtschelfthout committed Jan 17, 2017
2 parents 9373c4c + 975e2f9 commit 2779f25
Show file tree
Hide file tree
Showing 16 changed files with 246 additions and 8 deletions.
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 @@ -226,6 +226,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 @@ -234,7 +270,10 @@ Target "CI" DoNothing
"Clean"
=?> ("BuildVersion", isAppVeyorBuild)
==> "AssemblyInfo"
==> "SetVersionInProjectJSON"
==> "Build"
=?> ("Build.NetCore", isDotnetSDKInstalled)
=?> ("RunTests.NetCore", isDotnetSDKInstalled)
==> "RunTests"

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

Expand All @@ -255,6 +295,7 @@ Target "CI" DoNothing

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

RunTargetOrDefault "RunTests"
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" ]
}
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
3 changes: 3 additions & 0 deletions src/FsCheck.NUnit/FsCheckPropertyAttribute.fs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ and FsCheckTestMethod(mi : IMethodInfo, parentSuite : Test) =

member private x.HandleException ex testResult failureSite =
match ex with
#if NETSTANDARD1_6
#else
| :? ThreadAbortException -> Thread.ResetAbort()
#endif
| _ -> ()
testResult.RecordException(x.FilterException <| ex, failureSite)

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.6.0",
"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.*"
}
}
}
15 changes: 9 additions & 6 deletions src/FsCheck/Arbitrary.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

open System

#if PCL
#if PCL || NETSTANDARD1_6
#else
open System.Net
open System.Net.Mail
Expand Down Expand Up @@ -124,7 +124,7 @@ type DoNotSize<'a when 'a : struct and 'a : comparison> =
DoNotSize of 'a with
static member Unwrap(DoNotSize a) : 'a = a

#if PCL
#if PCL || NETSTANDARD1_6
#else
type IPv4Address = IPv4Address of IPAddress
type IPv6Address = IPv6Address of IPAddress
Expand Down Expand Up @@ -643,11 +643,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 @@ -901,7 +904,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 @@ -935,7 +938,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 IPv4Address() =
let generator =
Expand Down Expand Up @@ -1017,7 +1020,7 @@ module Arb =

fromGenShrink (host, shrinkHost)

#if PCL
#if PCL || NETSTANDARD1_6
#else
static member MailAddress() =
let isValidUser (user: string) =
Expand Down
2 changes: 1 addition & 1 deletion src/FsCheck/Data.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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.*"
}
}
}
1 change: 1 addition & 0 deletions tests/FsCheck.Test/FsCheck.Test.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<TargetFSharpCoreVersion>4.4.0.0</TargetFSharpCoreVersion>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<AutoGenerateBindingRedirects>True</AutoGenerateBindingRedirects>
<ResolveNuGetPackages>false</ResolveNuGetPackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
44 changes: 44 additions & 0 deletions tests/FsCheck.Test/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"compilerName": "fsc",
"compile": {
"includeFiles": [
"Helpers.fs",
"Random.fs",
"Property.fs",
]
}
},
"dependencies": {
"Microsoft.FSharp.Core.netcore": "1.0.0-alpha-*",
"System.Runtime.Serialization.Primitives": "4.1.1",
"xunit": "2.2.0-beta2-build3300",
"dotnet-test-xunit": "2.2.0-preview2-build1029",
"FsCheck.Xunit": { "target": "project" }
},
"testRunner": "xunit",
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"imports": [
"dotnet5.4",
"portable-net451+win8"
]
}
},

"tools": {
"dotnet-compile-fsc": {
"version": "1.0.0-preview2-*",
"imports": "dnxcore50"
}
}

}

0 comments on commit 2779f25

Please sign in to comment.