Skip to content

Commit

Permalink
Add target for .NET Standard 2.0 (#23)
Browse files Browse the repository at this point in the history
* [NoTicket] - Added support for .NET Standard 2.0, DotNet Core 2.0 and DotNet Core 2.1.

* [NoTicket] - Removing some build warnings.
* Removed explicit targetting for DotNetCore; just targetting Net Standard now.
* Upgraded test project to .NET 4.7.1
* Upgraded test project dependencies.

* [NoTicket] - Attempting to fix the build caused by poorly formatted appveyor.yml.

* [NoTicket] - Attempting to fix an issue with the appveyor.yml.

* [NoTicket] - Attempting to fix the build by adding a NuGet restore step.

* [NoTicket] - Attempting to fix the NuGet packaging phase of the build.

* [NoTicket] - Modifying the build to append a pre-release suffix for non-master builds.

* [NoTicket] - Fixing an issue with the appveyor.yml build configuration.

* [NoTicket] - Attempting to fix a broken build due to missing carriage return.

* [NoTicket] - Attempting to fix an issue with the code coverage phase of the build.
The wrong version of the NUnit Console Runner was being referenced.
  • Loading branch information
eoin55 authored Sep 2, 2018
1 parent ce9959d commit 0830caf
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 70 deletions.
25 changes: 0 additions & 25 deletions Src/HoneyBear.HalClient.Unit.Tests/App.config

This file was deleted.

4 changes: 2 additions & 2 deletions Src/HoneyBear.HalClient.Unit.Tests/HalClientTestContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using AutoFixture;
using AutoFixture.AutoRhinoMock;
using FluentAssertions;
using HoneyBear.HalClient.Http;
using HoneyBear.HalClient.Models;
using HoneyBear.HalClient.Unit.Tests.ProxyResources;
using Jmansar.SemanticComparisonExtensions;
using Newtonsoft.Json;
using NUnit.Framework;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoRhinoMock;
using Ploeh.SemanticComparison.Fluent;
using Rhino.Mocks;
using Version = HoneyBear.HalClient.Unit.Tests.ProxyResources.Version;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using FluentAssertions;
using AutoFixture;
using AutoFixture.AutoRhinoMock;
using FluentAssertions;
using HoneyBear.HalClient.Models;
using HoneyBear.HalClient.Serialization;
using Newtonsoft.Json;
using NUnit.Framework;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoRhinoMock;

namespace HoneyBear.HalClient.Unit.Tests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<TargetFramework>net471</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoFixture" Version="3.51.0" />
<PackageReference Include="AutoFixture.AutoRhinoMocks" Version="3.51.0" />
<PackageReference Include="AutoFixture" Version="4.5.0" />
<PackageReference Include="AutoFixture.AutoRhinoMocks" Version="4.5.0" />
<PackageReference Include="coveralls.io" Version="1.4.2" />
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="NMoneys" Version="5.1.4.1" />
<PackageReference Include="NUnit" Version="3.8.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
<PackageReference Include="FluentAssertions" Version="5.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="NMoneys" Version="6.1.0" />
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.8.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="OpenCover" Version="4.6.519" />
<PackageReference Include="SemanticComparison" Version="3.51.0" />
<PackageReference Include="SemanticComparisonExtensions" Version="0.2.0" />
Expand Down
26 changes: 20 additions & 6 deletions Src/HoneyBear.HalClient/HoneyBear.HalClient.csproj
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.5;netstandard1.6;netcoreapp1.0;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net45;netstandard1.1;netstandard1.2;netstandard1.3;netstandard1.5;netstandard1.6;netstandard2.0</TargetFrameworks>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<PackageVersion>1.0.0.0</PackageVersion>
<Version>1.0.0.0</Version>
<DebugType>full</DebugType>
</PropertyGroup>

<PropertyGroup>
<Authors>Eoin O'Connor</Authors>
<Copyright>Copyright Eoin O'Connor 2017</Copyright>
<Description>A lightweight fluent .NET client for navigating and consuming HAL APIs. Includes support for .NET Standard.</Description>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\HoneyBear.HalClient.xml</DocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseUrl>https://github.com/eoin55/HoneyBear.HalClient/blob/master/LICENSE</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/eoin55/HoneyBear.HalClient</PackageProjectUrl>
<PackageTags>HAL JSON Hypermedia HATEOAS REST DotNetCore NetStandard</PackageTags>
<RepositoryUrl>https://github.com/eoin55/HoneyBear.HalClient</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Tavis.UriTemplates" Version="1.1.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='net45'">
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.3" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Tavis.UriTemplates" Version="1.1.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'!='net45'">
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.1' OR '$(TargetFramework)'=='netstandard1.2' OR '$(TargetFramework)'=='netstandard1.5' OR '$(TargetFramework)'=='netstandard1.6'">
<PackageReference Include="WinInsider.System.Net.Http.Formatting" Version="1.0.5" />
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<PackageReference Include="Tavis.UriTemplates" Version="1.1.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.3' OR '$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="WinInsider.System.Net.Http.Formatting" Version="1.0.5" />
</ItemGroup>

Expand Down
37 changes: 13 additions & 24 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,33 @@
version: 2.1.{build}
version: 2.2.{build}
image: Visual Studio 2017
skip_tags: true
configuration: Release
platform: Any CPU
environment:
APPVEYOR_BLOCK_DOTNETCORE_TESTS_AUTORUN: true
before_build:
- msbuild -t:restore .\Src\HoneyBear.HalClient.sln
build:
project: .\Src\HoneyBear.HalClient.sln
after_build:
build_script:
- ps: >-
$csproj = Get-Content .\Src\HoneyBear.HalClient\HoneyBear.HalClient.csproj -raw | `
% {$_ -replace "<AssemblyVersion>1.0.0.0</AssemblyVersion>", "<AssemblyVersion>$env:APPVEYOR_BUILD_VERSION</AssemblyVersion>"} | `
% {$_ -replace "<FileVersion>1.0.0.0</FileVersion>", "<FileVersion>$env:APPVEYOR_BUILD_VERSION</FileVersion>"} | `
% {$_ -replace "<Version>1.0.0.0</Version>", "<Version>$env:APPVEYOR_BUILD_VERSION</Version>"}
$assemblyVersion = ${env:APPVEYOR_BUILD_VERSION}
$csproj | Set-Content .\Src\HoneyBear.HalClient\HoneyBear.HalClient.csproj
$packageVersion = ${env:APPVEYOR_BUILD_VERSION}
if ($env:APPVEYOR_REPO_BRANCH -ne "master") {
Update-AppveyorBuild -Version "${env:APPVEYOR_BUILD_VERSION}-alpha"
$packageVersion = "$packageVersion-alpha"
}
msbuild -t:pack .\Src\HoneyBear.HalClient\HoneyBear.HalClient.csproj `
-p:configuration=$env:CONFIGURATION `
-p:packageversion=$env:APPVEYOR_BUILD_VERSION `
-p:authors="Eoin O'Connor" `
-p:packagelicenseurl=https://github.com/eoin55/HoneyBear.HalClient/blob/master/LICENSE `
-p:packageprojecturl=https://github.com/eoin55/HoneyBear.HalClient `
-p:description="A lightweight fluent .NET client for navigating and consuming HAL APIs. Includes support for .NET Core." `
-p:copyright="Copyright � Eoin O'Connor 2017" `
-p:packagetags="HAL JSON Hypermedia HATEOAS REST DotNetCore" `
dotnet build .\Src\HoneyBear.HalClient.sln `
-c $env:CONFIGURATION `
-p:AssemblyVersion=$assemblyVersion `
-p:FileVersion=$assemblyVersion `
-p:PackageVersion=$packageVersion `
-p:Version=$packageVersion `
-p:packageoutputpath=$pwd\artifacts
after_test:
- ps: >-
. $env:USERPROFILE\.nuget\packages\OpenCover\4.6.519\tools\OpenCover.Console.exe `
-register:user `
-filter:"+[HoneyBear.HalClient]*" `
-target:"$env:USERPROFILE\.nuget\packages\NUnit.ConsoleRunner\3.7.0\tools\nunit3-console.exe" `
-targetargs:".\Src\HoneyBear.HalClient.Unit.Tests\bin\$env:CONFIGURATION\net452\HoneyBear.HalClient.Unit.Tests.dll" `
-target:"$env:USERPROFILE\.nuget\packages\NUnit.ConsoleRunner\3.8.0\tools\nunit3-console.exe" `
-targetargs:".\Src\HoneyBear.HalClient.Unit.Tests\bin\$env:CONFIGURATION\net471\HoneyBear.HalClient.Unit.Tests.dll" `
-output:coverage.xml
. $env:USERPROFILE\.nuget\packages\coveralls.io\1.4.2\tools\coveralls.net.exe `
Expand Down

0 comments on commit 0830caf

Please sign in to comment.