Skip to content

Commit

Permalink
vs2017
Browse files Browse the repository at this point in the history
  • Loading branch information
StefH committed Apr 12, 2017
1 parent 9ac2290 commit 61059fa
Show file tree
Hide file tree
Showing 16 changed files with 421 additions and 27 deletions.
15 changes: 15 additions & 0 deletions .axoCover/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"TestRunner": "",
"TestPlatform": "x86",
"TestApartmentState": "STA",
"TestSettings": "",
"ExcludeAttributes": "System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute",
"ExcludeFiles": "",
"ExcludeDirectories": "",
"Filters": "+[*]*",
"IsIncludingSolutionAssemblies": true,
"IsExcludingTestAssemblies": false,
"IsCoveringByTest": true,
"IsMergingByHash": true,
"IsSkippingAutoProps": true
}
15 changes: 7 additions & 8 deletions NETStandard.HttpListener Solution.sln
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.26403.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NETStandard.HttpListener", "src\NETStandard.HttpListener\NETStandard.HttpListener.xproj", "{0ECA641F-BD50-413A-876C-A7D4810EB906}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "NETStandard.HttpListener.Tests", "test\NETStandard.HttpListener.Tests\NETStandard.HttpListener.Tests.xproj", "{C6FFB78D-EFBB-46C3-A0D1-68BF3436735E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{DF1E746A-72B0-4E19-93B3-5AB10C1FC11C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CD898B0D-BE14-44D6-9B9A-8BA97E74CEB6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E8754D0E-970B-45A6-8B1B-0D5ED15099DE}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
global.json = global.json
LICENSE.md = LICENSE.md
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NETStandard.HttpListener", "src\NETStandard.HttpListener\NETStandard.HttpListener.csproj", "{0ECA641F-BD50-413A-876C-A7D4810EB906}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NETStandard.HttpListener.Tests", "test\NETStandard.HttpListener.Tests\NETStandard.HttpListener.Tests.csproj", "{C6FFB78D-EFBB-46C3-A0D1-68BF3436735E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "src\TestApp\TestApp.csproj", "{CD908D7A-DEE6-48D3-8E5C-2EBC3851EF4B}"
ProjectSection(ProjectDependencies) = postProject
{0ECA641F-BD50-413A-876C-A7D4810EB906} = {0ECA641F-BD50-413A-876C-A7D4810EB906}
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestConsoleApp", "src\TestConsoleApp\TestConsoleApp.xproj", "{28923ACA-8AA7-489F-BC38-A6CB5C469108}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestConsoleApp", "src\TestConsoleApp\TestConsoleApp.csproj", "{28923ACA-8AA7-489F-BC38-A6CB5C469108}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
A simple library based on (https://github.com/robertsundstrom/HttpListener) that essentially allows for building your own HTTP server on .NET Core and the Universal Windows Platform (UWP).

[![Build status](https://ci.appveyor.com/api/projects/status/192if73p5og2o2yq?svg=true)](https://ci.appveyor.com/project/StefH/netstandard-httplistener)

[![Coverage Status](https://coveralls.io/repos/github/StefH/NETStandard.HttpListener/badge.svg?branch=master)](https://coveralls.io/github/StefH/NETStandard.HttpListener?branch=master)
[![NuGet Badge](https://buildstats.info/nuget/NETStandard.HttpListener)](https://www.nuget.org/packages/NETStandard.HttpListener)

## Overview

This library fills the void left by the missing System.Net.Http.HttpListener in .NET Core and Universal Windows Platform (UWP).

By targetting .NET Core (NETStandard 1.3) and UWP, this API enables HTTP server scenarios on Windows 10 for IoT on Raspberry Pi (2 & 3).
By targetting .NET Core (NETStandard 1.3) and UWP (TODO), this API enables HTTP server scenarios on Windows 10 for IoT on Raspberry Pi (2 & 3).

Taking a modern approach, this API is not meant to be entirely compatible with the HttpListener found in the full .NET Framework on Windows desktop.

Expand All @@ -22,7 +22,7 @@ Contributions are most welcome.
The solution consists of two projects with a common core targetting:

1. .NET Core project - Windows, Linux and Mac OS X.
2. Universal Windows Platform (UWP) - Windows 10 and up.
2. Universal Windows Platform (UWP) - Windows 10 and up. (TODO)

The API:s are generally similar, but may differ slightly on each platform due to their respective API constraints. However, the core concepts remain the same.

Expand Down Expand Up @@ -82,4 +82,3 @@ Also consider having a look at the unit tests.
Here are some things to consider doing in the future:

* Rewrite the HttpRequest parser and implement missing features, like authentication and the handling of content types.
* Consolidate the two libraries (.NET Core and UWP) into one single .NET Standard-compliant library when possible to do so.
38 changes: 26 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
os: Visual Studio 2015
os: Visual Studio 2017

version: 1.0.0.{build}
version: 1.0.2.{build}

configuration:
- Release
Expand All @@ -10,27 +10,41 @@ platform: Any CPU
init:
- ps: $Env:LABEL = "CI" + $Env:APPVEYOR_BUILD_NUMBER.PadLeft(5, "0")

environment:
COVERALLS_REPO_TOKEN:
secure: pXizcjLI1WirF6HJk1v46ImkEerH5y1EfXB/rpDzojJjMVIxuyLJcgisUeIXH256

install:
- ps: Start-FileDownload 'https://download.microsoft.com/download/0/A/3/0A372822-205D-4A86-BFA7-084D2CBE9EDF/DotNetCore.1.0.1-SDK.1.0.0.Preview2-003133-x64.exe'
- cmd: DotNetCore.1.0.1-SDK.1.0.0.Preview2-003133-x64 /quiet
- ps: Start-FileDownload 'https://download.microsoft.com/download/8/F/9/8F9659B9-E628-4D1A-B6BF-C3004C8C954B/dotnet-1.1.1-sdk-win-x64.exe'
- cmd: dotnet-1.1.1-sdk-win-x64.exe /quiet
- ps: $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = "true"

environment:
PATH: $(PATH);$(PROGRAMFILES)\dotnet\

build_script:
- appveyor-retry dotnet restore .\src\NETStandard.HttpListener -v Minimal
- appveyor-retry dotnet restore .\src\TestConsoleApp -v Minimal
# - appveyor-retry nuget restore .\src\TestApp\TestApp.csproj -PackagesDirectory packages
- appveyor-retry dotnet restore .\test\NETStandard.HttpListener.Tests -v Minimal

- dotnet build .\src\NETStandard.HttpListener\project.json -c %CONFIGURATION%
- dotnet build .\src\TestConsoleApp\project.json -c %CONFIGURATION%
- dotnet build .\test\NETStandard.HttpListener.Tests\project.json -c %CONFIGURATION%
- dotnet restore .\src\NETStandard.HttpListener -v Minimal
- dotnet restore .\src\TestConsoleApp -v Minimal
# - nuget restore .\src\TestApp\TestApp.csproj -PackagesDirectory packages
- dotnet restore .\test\NETStandard.HttpListener.Tests -v Minimal

- dotnet build .\src\NETStandard.HttpListener\NETStandard.HttpListener.csproj -c %CONFIGURATION%
- dotnet build .\src\TestConsoleApp\TestConsoleApp.csproj -c %CONFIGURATION%
- dotnet build .\test\NETStandard.HttpListener.Tests\NETStandard.HttpListener.Tests.csproj -c %CONFIGURATION%
#- cmd: msbuild .\src\TestApp\TestApp.csproj /p:Configuration=%CONFIGURATION% /p:Platform=x86

test_script:
- dotnet test -c %CONFIGURATION% --no-build .\test\NETStandard.HttpListener.Tests

after_test:
- nuget.exe install OpenCover -ExcludeVersion
- nuget.exe install coveralls.net -ExcludeVersion
- pip install codecov

- cmd: '"OpenCover\tools\OpenCover.Console.exe" -target:dotnet.exe -targetargs:"test test\NETStandard.HttpListener.Tests\NETStandard.HttpListener.Tests.csproj --configuration %CONFIGURATION% --no-build" -output:coverage.xml -register:user -filter:"+[NETStandard.HttpListener]* -[NETStandard.HttpListener.Tests]*" -returntargetcode -register:user -oldstyle'
- codecov -f "coverage.xml"
- coveralls.net\tools\csmacnz.Coveralls.exe --opencover -i .\coverage.xml

artifacts:
- path: artifacts\**\*.*

Expand Down
51 changes: 51 additions & 0 deletions src/NETStandard.HttpListener/NETStandard.HttpListener.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>HttpListener for .NET Core (NETStandard) and Universal Windows Platform (UWP)</Description>
<Copyright>Copyright © Robert Sundström 2016, Stef Heyenrath 2017</Copyright>
<AssemblyTitle>NETStandard.HttpListener</AssemblyTitle>
<VersionPrefix>1.0.2.0</VersionPrefix>
<Authors>Robert Sundström;Stef Heyenrath</Authors>
<TargetFrameworks>netstandard1.3</TargetFrameworks>
<AssemblyName>NETStandard.HttpListener</AssemblyName>
<PackageId>NETStandard.HttpListener</PackageId>
<PackageTags>Http;Web Server;HttpListener;NetStandard;.NET Core</PackageTags>
<PackageReleaseNotes>Fixed a bug in HttpListenerRequest</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/StefH/NETStandard.HttpListener</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/StefH/NETStandard.HttpListener/master/LICENSE</PackageLicenseUrl>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.3' ">$(PackageTargetFallback);dotnet5.4</PackageTargetFallback>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="10.2.1">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' ">
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.IO" Version="4.3.0" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<PackageReference Include="System.Net.Http" Version="4.3.0" />
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.2.2" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.IO" Version="4.3.0" />
<PackageReference Include="System.Linq" Version="4.3.0" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks" Version="4.3.0" />
</ItemGroup>

</Project>
7 changes: 4 additions & 3 deletions src/TestApp/TestApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@
</Page>
</ItemGroup>
<ItemGroup>
<Reference Include="NETStandard.HttpListener">
<HintPath>..\NETStandard.HttpListener\bin\$(Configuration)\uap10.0\NETStandard.HttpListener.dll</HintPath>
</Reference>
<ProjectReference Include="..\NETStandard.HttpListener\NETStandard.HttpListener.csproj">
<Project>{0eca641f-bd50-413a-876c-a7d4810eb906}</Project>
<Name>NETStandard.HttpListener</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
Expand Down
19 changes: 19 additions & 0 deletions src/TestConsoleApp/TestConsoleApp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<AssemblyName>TestConsoleApp</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>TestConsoleApp</PackageId>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NETStandard.HttpListener\NETStandard.HttpListener.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<AssemblyName>NETStandard.HttpListener.Tests</AssemblyName>
<PackageId>NETStandard.HttpListener.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\NETStandard.HttpListener\NETStandard.HttpListener.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta1-build1309" />
<PackageReference Include="xunit" Version="2.3.0-beta1-build3642" />
</ItemGroup>

</Project>
Loading

0 comments on commit 61059fa

Please sign in to comment.