Skip to content

Commit

Permalink
Retarget .Net Standard 1.4 and 2.0, export XML Doc and fix a few warn…
Browse files Browse the repository at this point in the history
…ings
  • Loading branch information
NZSmartie committed Sep 20, 2017
1 parent 10b6254 commit a2cdf94
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 11 deletions.
7 changes: 7 additions & 0 deletions appveyor.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ version: '{branch}-{build}'
skip_non_tags: true
image: Visual Studio 2017
configuration: Release

environment:
git_access_token:
secure: kFNrVQrkAApceG8qiKcsgXAFx50qkY4Lfl2OLczSxwhEYbHh78AdPqyBn3P/JEjo
git_email: nzsmartie@gmail.com
git_user: NZSmartie

before_build:
- cmd: nuget restore
build:
Expand Down
13 changes: 10 additions & 3 deletions src/CoAPNet.Server/CoAPNet.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">net46;netstandard1.4</TargetFrameworks>
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
<TargetFrameworks>netstandard1.4;netstandard2.0</TargetFrameworks>
<DebugType Condition="$(Configuration)=='AppVeyor'">full</DebugType>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>NZSmartie.CoAPNet.Server</PackageId>
Expand All @@ -22,10 +21,18 @@
<Copyright>Copyright © Roman Vaughan 2017</Copyright>
</PropertyGroup>

<ItemGroup>
<PropertyGroup>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\CoAPNet.Server.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.4'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CoAPNet\CoAPNet.csproj" />
</ItemGroup>
Expand Down
12 changes: 10 additions & 2 deletions src/CoAPNet.Udp/CoAPNet.Udp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<TargetFrameworks>netstandard1.4;netstandard2.0</TargetFrameworks>
<PackageId>NZSmartie.CoAPNet.Udp</PackageId>
<Version>0.3.6</Version>
<Authors>Roman Vaughan</Authors>
Expand All @@ -20,10 +20,18 @@
<PackageLicenseUrl>https://raw.githubusercontent.com/NZSmartie/CoAP.Net/master/LICENSE</PackageLicenseUrl>
</PropertyGroup>

<ItemGroup>
<PropertyGroup>
<DocumentationFile>bin\$(Configuration)\$TargetFramework)\CoAPNet.Udp.xml</DocumentationFile>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard1.4'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CoAPNet\CoAPNet.csproj" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/CoAPNet/CoAPNet.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net46;netstandard1.4</TargetFrameworks>
<TargetFramework>netstandard1.4</TargetFramework>
<DebugType Condition="$(Configuration)=='AppVeyor'">full</DebugType>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>NZSmartie.CoAPNet</PackageId>
Expand All @@ -20,4 +20,7 @@
<PackageLicenseUrl>https://raw.githubusercontent.com/NZSmartie/CoAP.Net/master/LICENSE</PackageLicenseUrl>
<Copyright>Copyright © Roman Vaughan 2017</Copyright>
</PropertyGroup>
<PropertyGroup>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\CoAPNet.xml</DocumentationFile>
</PropertyGroup>
</Project>
3 changes: 1 addition & 2 deletions src/CoAPNet/CoapOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum OptionType
/// </summary>
Empty,
/// <summary>
/// Defines the <see cref="CoapOption"/>'s data is an <see cref="byte[]"/>
/// Defines the <see cref="CoapOption"/>'s data is an <c><see cref="byte"/>[]</c>
/// </summary>
Opaque,
/// <summary>
Expand Down Expand Up @@ -137,7 +137,6 @@ public override string ToString()
/// Gets if this resource is unsafe to proxy through the CoAP endpoint
/// <para>See Section 5.4.2 of [RFC7252]</para>
/// </summary>
/// <se
public bool IsUnsafe
{
get
Expand Down
2 changes: 2 additions & 0 deletions src/CoAPNet/CoapResourceMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public CoapResourceMetadata(Uri uri)
UriReference = uri;
}

/// <inheritdoc />
public override bool Equals(object obj)
{
var other = obj as CoapResourceMetadata;
Expand Down Expand Up @@ -134,6 +135,7 @@ public override bool Equals(object obj)
return true;
}

/// <inheritdoc />
public override int GetHashCode()
{
return UriReference.GetHashCode();
Expand Down
1 change: 0 additions & 1 deletion src/CoAPNet/ICoapEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public interface ICoapEndpoint : IDisposable
/// Called by [Service] to send a <see cref="CoapPacket.Payload"/> to the specified <see cref="CoapPacket.Endpoint"/> using the endpoint layer provided by the Application Layer
/// </summary>
/// <param name="packet"></param>
/// <param name="token"></param>
/// <returns></returns>
Task SendAsync(CoapPacket packet);

Expand Down
2 changes: 1 addition & 1 deletion src/CoAPNet/Options/Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public ContentFormat(ContentFormatType type) : this()
/// The representation format is given as a numeric Content-Format identifier that is defined in the
/// "CoAP Content-Formats" registry (Section 12.3 of [RFC7252]).
/// <para>See section 5.10.4 of [RFC7252]</para>
/// </summary
/// </summary>
public class Accept : CoapOption
{
public ContentFormatType MediaType { get => (ContentFormatType)ValueUInt; set => ValueUInt = (uint)value; }
Expand Down
2 changes: 1 addition & 1 deletion tests/CoAPNet.Tests/CoapClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public async Task TestRetransmissionAttempts()

[Test]
[Category("[RFC7252] Section 4.2")]
public async Task TestRetransmissionMaxAttempts()
public void TestRetransmissionMaxAttempts()
{
// Arrange
var requestMessage = new CoapMessage
Expand Down

0 comments on commit a2cdf94

Please sign in to comment.