diff --git a/.gitignore b/.gitignore index 44a79db..77294e2 100755 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ paket-files *.suo *.user *.sln.docstates +.vs/ # Build results .fake/ diff --git a/.travis.yml b/.travis.yml index a7b8dec..290472d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,24 @@ language: csharp -mono: 5.2.0 -dotnet: 2.0.0 +dotnet: 2.1.402 + +mono: +- 5.2.0 install: - - mozroots --import --sync - # workaround for missing .net 4.5 targing pack - - export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ +- mozroots --import --sync +# workaround for missing .net 4.5 targing pack +- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ matrix: - include: + include: - os: linux # Ubuntu 14.04 dist: trusty sudo: required - dotnet: 2.0.0 + dotnet: 2.1.402 - os: osx # OSX 10.12 osx_image: xcode9.1 - dotnet: 2.0.0 + dotnet: 2.1.402 dist: trusty sudo: required @@ -24,10 +26,11 @@ script: - dotnet --info - dotnet restore - dotnet build -c Release - - dotnet test -c Release tests\Chiron.Tests\Chiron.Tests.fsproj - - dotnet pack -c Release - - dotnet benchmarks\Chiron.Benchmarks\bin\Release\netcoreapp2.0\Chiron.Benchmarks.dll --class SwaggerSchema + - dotnet test --no-build -c Release tests/Chiron.Tests/Chiron.Tests.fsproj + - dotnet pack --no-build -c Release src/Chiron + #- dotnet benchmarks\Chiron.Benchmarks\bin\Release\netcoreapp2.0\Chiron.Benchmarks.dll --class SwaggerSchema branches: except: - - gh-pages \ No newline at end of file + - gh-pages + diff --git a/Chiron.sln b/Chiron.sln index c28c0e9..de92f0c 100644 --- a/Chiron.sln +++ b/Chiron.sln @@ -1,4 +1,3 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26124.0 diff --git a/appveyor.yml b/appveyor.yml index f71efcf..d9d9436 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,17 +1,9 @@ -version: 7.0.0-aci-{build} - image: Visual Studio 2017 - build_script: - - ps: dotnet --info - - ps: dotnet restore - - ps: dotnet build -c Release --version-suffix "aci-${env:APPVEYOR_BUILD_NUMBER}" - - ps: dotnet test -c Release tests\Chiron.Tests\Chiron.Tests.fsproj - - ps: dotnet pack -c Release --version-suffix "aci-${env:APPVEYOR_BUILD_NUMBER}" - - ps: dotnet benchmarks\Chiron.Benchmarks\bin\Release\netcoreapp2.0\Chiron.Benchmarks.dll --class SwaggerSchema - + - ps: | + .\build.ps1 + if ($lastexitcode -ne 0){ exit $lastexitcode } test: off - artifacts: - - path: '**\*.nupkg' + - path: bin\*.nupkg - path: '**\BenchmarkDotNet.Artifacts\**\*.*' diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..43ddd85 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,22 @@ +[xml]$doc = Get-Content .\src\Directory.Build.props +$version = $doc.Project.PropertyGroup.VersionPrefix # the version under development, update after a release +$versionSuffix = '-build.0' # manually incremented for local builds + +function isVersionTag($tag){ + $v = New-Object Version + [Version]::TryParse($tag, [ref]$v) +} + +if ($env:appveyor){ + $versionSuffix = '-build.' + $env:appveyor_build_number + if ($env:appveyor_repo_tag -eq 'true' -and (isVersionTag($env:appveyor_repo_tag_name))){ + $version = $env:appveyor_repo_tag_name + $versionSuffix = '' + } + Update-AppveyorBuild -Version "$version$versionSuffix" +} + +dotnet build -c Release Chiron.sln /p:Version=$version$versionSuffix +dotnet test --no-build -c Release tests/Chiron.Tests/Chiron.Tests.fsproj +dotnet pack --no-build -c Release src/Chiron /p:Version=$version$versionSuffix -o $psscriptroot/bin +# dotnet benchmarks\Chiron.Benchmarks\bin\Release\netcoreapp2.0\Chiron.Benchmarks.dll --class SwaggerSchema diff --git a/src/Chiron/Chiron.fs b/src/Chiron/Chiron.fs index e9d64d1..311e723 100644 --- a/src/Chiron/Chiron.fs +++ b/src/Chiron/Chiron.fs @@ -879,7 +879,7 @@ module Serialization = | Some a -> buildWith a jObj | None -> jObj - let ref (): JsonEncoder<'a> ref * JsonEncoder<'a> = + let ref<'a> (): JsonEncoder<'a> ref * JsonEncoder<'a> = let innerRef = ref (Unchecked.defaultof>) innerRef, (fun a -> (!innerRef) a) @@ -1152,7 +1152,7 @@ module Serialization = Encode.jsonObject jObj |> decode - let ref (): Decoder<'s,'a> ref * Decoder<'s,'a> = + let ref<'s, 'a> (): Decoder<'s,'a> ref * Decoder<'s,'a> = let innerRef = ref (Unchecked.defaultof>) innerRef, (fun s -> (!innerRef) s) diff --git a/src/Chiron/Chiron.fsproj b/src/Chiron/Chiron.fsproj index 36c3dcb..9ee54ec 100644 --- a/src/Chiron/Chiron.fsproj +++ b/src/Chiron/Chiron.fsproj @@ -1,17 +1,14 @@ - netstandard2.0;net45 - 7.0.0 + netstandard2.0;net452 true - - - - + + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index c212352..16d78a1 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -15,6 +15,6 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb - + - \ No newline at end of file + diff --git a/tests/Chiron.Tests/Chiron.Tests.fsproj b/tests/Chiron.Tests/Chiron.Tests.fsproj index 267f84c..00be1c9 100644 --- a/tests/Chiron.Tests/Chiron.Tests.fsproj +++ b/tests/Chiron.Tests/Chiron.Tests.fsproj @@ -8,15 +8,17 @@ - - - - - + + + + all + runtime; build; native; contentfiles; analyzers + + diff --git a/tests/Chiron.Tests/Program.fs b/tests/Chiron.Tests/Program.fs deleted file mode 100644 index d82765b..0000000 --- a/tests/Chiron.Tests/Program.fs +++ /dev/null @@ -1,2 +0,0 @@ -module DummyMain = let main _ = 0 -#nowarn "988"