Skip to content

Commit 72d93ab

Browse files
committed
Upgraded to Giraffe 2.0.0
Cleaned up proj, removed dependencies and upgraded to latest Giraffe.
1 parent a39d45b commit 72d93ab

File tree

8 files changed

+80
-74
lines changed

8 files changed

+80
-74
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
* text=auto
1+
* text=auto
2+
*.sh text eol=lf

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: csharp
22
sudo: required
33
dist: trusty
44

5-
dotnet: 2.1.4
5+
dotnet: 2.1.400
66
mono:
77
- 4.6.1
88
- 4.8.1
@@ -16,6 +16,7 @@ before_install:
1616
- curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
1717
- sudo apt-get update
1818
- sudo apt-get install -y powershell
19+
- sudo pwsh ./install-dotnet.ps1
1920

2021
script:
2122
- export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Release Notes
22
=============
33

4+
## 1.0.0
5+
6+
- Updated Giraffe to version `2.0.0`.
7+
- Removed all other (redundant) dependencies.
8+
49
## 0.1.0-beta-110
510

611
- Updated Giraffe to version `1.1.0`.

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ environment:
44
DOTNET_CLI_TELEMETRY_OPTOUT: 1
55
init:
66
- git config --global core.autocrlf true
7+
install:
8+
- ps: .\install-dotnet.ps1
79
build: off
810
build_script:
911
- ps: .\build.ps1 -Release -Pack

build.ps1

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ function Invoke-Cmd ($cmd)
2929
if ($LastExitCode -ne 0) { Write-Error "An error occured when executing '$cmd'."; return }
3030
}
3131

32-
function dotnet-info { Invoke-Cmd "dotnet --info" }
33-
function dotnet-version { Invoke-Cmd "dotnet --version" }
34-
function dotnet-build ($project, $argv) { Invoke-Cmd "dotnet build $project $argv" }
35-
function dotnet-run ($project, $argv) { Invoke-Cmd "dotnet run --project $project $argv" }
36-
function dotnet-test ($project, $argv) { Invoke-Cmd "dotnet test $project $argv" }
37-
function dotnet-pack ($project, $argv) { Invoke-Cmd "dotnet pack $project $argv" }
38-
3932
function Get-DotNetRuntimeVersion
4033
{
4134
$info = dotnet-info
@@ -44,12 +37,52 @@ function Get-DotNetRuntimeVersion
4437
$version.Split(":")[1].Trim()
4538
}
4639

47-
function dotnet-xunit ($project, $argv)
40+
function Get-TargetFrameworks ($projFile)
41+
{
42+
[xml]$proj = Get-Content $projFile
43+
44+
if ($proj.Project.PropertyGroup.TargetFrameworks -ne $null) {
45+
($proj.Project.PropertyGroup.TargetFrameworks).Split(";")
46+
}
47+
else {
48+
@($proj.Project.PropertyGroup.TargetFramework)
49+
}
50+
}
51+
52+
function Get-NetCoreTargetFramework ($projFile)
53+
{
54+
Get-TargetFrameworks $projFile | where { $_ -like "netstandard*" -or $_ -like "netcoreapp*" }
55+
}
56+
57+
function dotnet-info { Invoke-Cmd "dotnet --info" }
58+
function dotnet-version { Invoke-Cmd "dotnet --version" }
59+
function dotnet-run ($project, $argv) { Invoke-Cmd "dotnet run --project $project $argv" }
60+
function dotnet-pack ($project, $argv) { Invoke-Cmd "dotnet pack $project $argv" }
61+
62+
function dotnet-build ($project, $argv)
63+
{
64+
if ($OnlyNetStandard.IsPresent) {
65+
$fw = Get-NetCoreTargetFramework $project
66+
$argv = "-f $fw " + $argv
67+
}
68+
69+
Invoke-Cmd "dotnet build $project $argv"
70+
}
71+
72+
function dotnet-test ($project, $argv)
4873
{
49-
$fxversion = Get-DotNetRuntimeVersion
50-
Push-Location (Get-Item $project).Directory.FullName
51-
Invoke-Cmd "dotnet xunit -fxversion $fxversion $argv"
52-
Pop-Location
74+
# Currently dotnet test does not work for net461 on Linux/Mac
75+
# See: https://github.com/Microsoft/vstest/issues/1318
76+
#
77+
# Previously dotnet-xunit was a great alternative, however after
78+
# issues with the maintenance dotnet xunit has been discontinued
79+
# after xunit 2.4: https://xunit.github.io/releases/2.4
80+
if(!(Test-IsWindows) -or $OnlyNetStandard.IsPresent) {
81+
$fw = Get-NetCoreTargetFramework $project;
82+
$argv = "-f $fw " + $argv
83+
}
84+
85+
Invoke-Cmd "dotnet test $project $argv"
5386
}
5487

5588
function Write-DotnetVersion
@@ -108,26 +141,6 @@ function Remove-OldBuildArtifacts
108141
Remove-Item $_ -Recurse -Force }
109142
}
110143

111-
function Get-TargetFrameworks ($projFile)
112-
{
113-
[xml]$proj = Get-Content $projFile
114-
($proj.Project.PropertyGroup.TargetFrameworks).Split(";")
115-
}
116-
117-
function Get-NetCoreTargetFramework ($projFile)
118-
{
119-
Get-TargetFrameworks $projFile | where { $_ -like "netstandard*" -or $_ -like "netcoreapp*" }
120-
}
121-
122-
function Get-FrameworkArg ($projFile)
123-
{
124-
if ($OnlyNetStandard.IsPresent) {
125-
$fw = Get-NetCoreTargetFramework $projFile
126-
"-f $fw"
127-
}
128-
else { "" }
129-
}
130-
131144
# ----------------------------------------------
132145
# Main
133146
# ----------------------------------------------
@@ -149,19 +162,13 @@ Remove-OldBuildArtifacts
149162
$configuration = if ($Release.IsPresent) { "Release" } else { "Debug" }
150163

151164
Write-Host "Building Giraffe.TokenRouter..." -ForegroundColor Magenta
152-
$framework = Get-FrameworkArg $src
153-
dotnet-build $src "-c $configuration $framework"
165+
dotnet-build $src "-c $configuration"
154166

155167
if (!$ExcludeTests.IsPresent -and !$Run.IsPresent)
156168
{
157169
Write-Host "Building and running tests..." -ForegroundColor Magenta
158-
$framework = Get-FrameworkArg $tests
159-
160-
dotnet-build $tests $framework
161-
162-
$xunitArgs = ""
163-
if(!(Test-IsWindows)) { $tfw = Get-NetCoreTargetFramework $tests; $xunitArgs = "-framework $tfw" }
164-
dotnet-xunit $tests $xunitArgs
170+
dotnet-build $tests
171+
dotnet-test $tests
165172
}
166173

167174
if ($Pack.IsPresent)

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "tests" ],
33
"sdk": {
4-
"version": "2.1.4"
4+
"version": "2.1.400"
55
}
66
}

src/Giraffe.TokenRouter/Giraffe.TokenRouter.fsproj

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<AssemblyName>Giraffe.TokenRouter</AssemblyName>
4-
<Version>0.1.0-beta-110</Version>
4+
<Version>1.0.0</Version>
5+
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
6+
7+
<!-- General info -->
58
<Description>Alternative routing API for Giraffe web applications which is aimed at maximum performance.</Description>
69
<Copyright>Copyright 2018 Dustin Moris Gorski</Copyright>
7-
<NeutralLanguage>en-GB</NeutralLanguage>
810
<Authors>Dustin Moris Gorski and contributors</Authors>
9-
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
11+
<NeutralLanguage>en-GB</NeutralLanguage>
12+
13+
<!-- Build config -->
1014
<DebugType>portable</DebugType>
11-
<WarningsAsErrors>1</WarningsAsErrors>
1215
<Optimize>True</Optimize>
1316
<OutputType>Library</OutputType>
17+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
18+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
19+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
20+
21+
<!-- NuGet package config -->
1422
<PackageId>Giraffe.TokenRouter</PackageId>
1523
<PackageTags>Giraffe;TokenRouter;Routing;ASP.NET Core;FSharp;Functional;Http;Web;Framework;Micro;Service</PackageTags>
1624
<PackageReleaseNotes>https://raw.githubusercontent.com/giraffe-fsharp/Giraffe.TokenRouter/master/RELEASE_NOTES.md</PackageReleaseNotes>
@@ -21,17 +29,10 @@
2129
<RepositoryType>git</RepositoryType>
2230
<RepositoryUrl>https://github.com/giraffe-fsharp/Giraffe.TokenRouter</RepositoryUrl>
2331
<IncludeSymbols>true</IncludeSymbols>
24-
<NetStandardImplicitPackageVersion>2.0</NetStandardImplicitPackageVersion>
25-
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
2632
</PropertyGroup>
2733

2834
<ItemGroup>
29-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.*" />
30-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.*" />
31-
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="2.0.*" />
32-
<PackageReference Include="Microsoft.Extensions.Primitives" Version="2.0.*" />
33-
<PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="2.0.*" />
34-
<PackageReference Include="Giraffe" Version="1.1.*" />
35+
<PackageReference Include="Giraffe" Version="2.0.*" />
3536
</ItemGroup>
3637

3738
<ItemGroup>

tests/Giraffe.TokenRouter.Tests/Giraffe.TokenRouter.Tests.fsproj

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
4+
<TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
55
<AssemblyName>Giraffe.TokenRouter.Tests</AssemblyName>
66
<DebugType>portable</DebugType>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.*" />
11-
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.0.*" />
12-
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.0.*" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.*" />
11+
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.*" />
12+
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.*" />
1313
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.*" />
14-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.*" />
15-
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.*" />
16-
<PackageReference Include="System.Net.Http" Version="4.3.*" />
17-
<PackageReference Include="xunit" Version="2.3.*" />
18-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.*" />
14+
<PackageReference Include="xunit" Version="2.4.*" />
15+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.*" />
1916
<PackageReference Include="NSubstitute" Version="3.1.*" />
20-
<PackageReference Include="FsCheck" Version="3.0.0-*" />
21-
<PackageReference Include="FsCheck.Xunit" Version="3.0.0-*" />
22-
<PackageReference Include="Newtonsoft.Json" Version="10.0.*" />
23-
<PackageReference Include="Giraffe" Version="1.1.*" />
24-
</ItemGroup>
25-
26-
<ItemGroup>
27-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.*" />
28-
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.*" />
17+
<PackageReference Include="Giraffe" Version="2.0.*" />
2918
</ItemGroup>
3019

3120
<ItemGroup>

0 commit comments

Comments
 (0)