Skip to content

Commit 72243f1

Browse files
authored
Tidy up to support netstandard2.0 (#76)
1 parent a9420de commit 72243f1

File tree

13 files changed

+57
-241
lines changed

13 files changed

+57
-241
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ Backup*/
112112
UpgradeLog*.XML
113113
/src/.vs/Slack.Webhooks/v15/Server/sqlite3
114114
/.vs
115+
.idea

build.cake

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,8 @@ Task("DeployNuGet")
140140
});
141141

142142
Task("Test")
143-
.IsDependentOn("TestFramework")
144143
.IsDependentOn("TestCore");
145144

146-
Task("TestFramework")
147-
.IsDependentOn("Build")
148-
.Does(() =>
149-
{
150-
var testAssemblies = GetFiles($"./src/**/bin/{configuration}/net45/*.Tests.dll");
151-
XUnit2(testAssemblies, new XUnit2Settings {
152-
Parallelism = ParallelismOption.All,
153-
NoAppDomain = true
154-
});
155-
});
156-
157145
Task("TestCore")
158146
.IsDependentOn("Build")
159147
.Does(() =>

src/Slack.Webhooks.Tests/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<TargetFrameworks>net45;netcoreapp2</TargetFrameworks>
4-
<Deterministic>False</Deterministic>
5-
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
6-
</PropertyGroup>
7-
<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp2' ">
8-
<Reference Include="System"/>
9-
<Reference Include="System.ComponentModel.Composition"/>
10-
<Reference Include="System.Core"/>
11-
<Reference Include="System.IO.Compression"/>
12-
<Reference Include="System.Net.Http"/>
13-
<Reference Include="System.Numerics"/>
14-
<Reference Include="System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
15-
<HintPath>..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
16-
</Reference>
17-
<Reference Include="System.Xml.Linq"/>
18-
<Reference Include="System.Data.DataSetExtensions"/>
19-
<Reference Include="Microsoft.CSharp"/>
20-
<Reference Include="System.Data"/>
21-
<Reference Include="System.Xml"/>
22-
</ItemGroup>
23-
<ItemGroup>
24-
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}"/>
25-
</ItemGroup>
26-
<ItemGroup>
27-
<ProjectReference Include="..\Slack.Webhooks\Slack.Webhooks.csproj">
28-
<Project>{53751b1b-a63e-4e4f-988c-bc783e68b15f}</Project>
29-
<Name>Slack.Webhooks</Name>
30-
</ProjectReference>
31-
</ItemGroup>
32-
<ItemGroup>
33-
<None Include="packages.config"/>
34-
</ItemGroup>
35-
<ItemGroup>
36-
<PackageReference Include="coverlet.msbuild" Version="2.7.0">
37-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
38-
<PrivateAssets>all</PrivateAssets>
39-
</PackageReference>
40-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0"/>
41-
<PackageReference Include="Moq" Version="4.13.1"/>
42-
<PackageReference Include="xunit" Version="2.4.1"/>
43-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
44-
<PrivateAssets>all</PrivateAssets>
45-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
46-
</PackageReference>
47-
<PackageReference Include="FluentAssertions" Version="5.9.0"/>
48-
</ItemGroup>
2+
<PropertyGroup>
3+
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
4+
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
5+
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<ProjectReference Include="..\Slack.Webhooks\Slack.Webhooks.csproj"/>
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="coverlet.msbuild" Version="2.7.0">
14+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15+
<PrivateAssets>all</PrivateAssets>
16+
</PackageReference>
17+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0"/>
18+
<PackageReference Include="Moq" Version="4.13.1"/>
19+
<PackageReference Include="xunit" Version="2.4.1"/>
20+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
21+
<PrivateAssets>all</PrivateAssets>
22+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23+
</PackageReference>
24+
<PackageReference Include="FluentAssertions" Version="5.9.0"/>
25+
</ItemGroup>
4926
</Project>

src/Slack.Webhooks.Tests/packages.config

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Slack.Webhooks/Api/ApiBase.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Net.Http;
33
using System.Net.Http.Headers;
4+
using System.Text;
45
using System.Threading.Tasks;
56
using Newtonsoft.Json;
67
using Newtonsoft.Json.Serialization;
@@ -11,8 +12,8 @@ public class ApiBase
1112
{
1213
protected readonly SlackConfiguration configuration;
1314

14-
private readonly static DefaultContractResolver _resolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() };
15-
private readonly static JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
15+
private static readonly DefaultContractResolver _resolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() };
16+
private static readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
1617
{
1718
ContractResolver = _resolver,
1819
NullValueHandling = NullValueHandling.Ignore
@@ -31,7 +32,7 @@ protected async Task<T> PostAsync<T>(Uri uri, object payload, bool requireAuthTo
3132
request.Headers.Authorization = AuthenticationHeaderValue.Parse($"Bearer {configuration.AuthToken}");
3233

3334
var json = SerializeObject(payload);
34-
request.Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
35+
request.Content = new StringContent(json, Encoding.UTF8, "application/json");
3536
var response = await configuration.HttpClient.SendAsync(request);
3637
var content = await response.Content.ReadAsStringAsync();
3738

src/Slack.Webhooks/Emoji.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using Newtonsoft.Json;
2-
using System;
3-
4-
namespace Slack.Webhooks
1+
namespace Slack.Webhooks
52

63
{
74
public class Emoji

src/Slack.Webhooks/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks>
5-
<Deterministic>False</Deterministic>
6-
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
7-
</PropertyGroup>
8-
9-
<ItemGroup>
10-
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
11-
</ItemGroup>
12-
13-
<ItemGroup Condition=" '$(TargetFramework)' != 'netstandard1.3' ">
14-
<Reference Include="System" />
15-
<Reference Include="System.Net" />
16-
<Reference Include="System.Net.Http" />
17-
<Reference Include="System.Runtime.Serialization" />
18-
<Reference Include="System.Xml.Linq" />
19-
<Reference Include="System.Data.DataSetExtensions" />
20-
<Reference Include="Microsoft.CSharp" />
21-
<Reference Include="System.Data" />
22-
<Reference Include="System.Xml" />
23-
</ItemGroup>
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5+
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
6+
<Version>1.1.0</Version>
7+
<Authors>Benn Lazell and contributors</Authors>
8+
<Copyright>Benn Lazell and contributors</Copyright>
9+
<PackageLicenseUrl>https://github.com/nerdfury/Slack.Webhooks/blob/master/LICENSE</PackageLicenseUrl>
10+
<PackageIconUrl>http://files.fivedegrees.co.uk/Slack.Webhooks/webhook.png</PackageIconUrl>
11+
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
12+
<Description>Even simpler integration with Slack's Incoming webhook API</Description>
13+
<PackageTags>Slack Webhooks</PackageTags>
14+
<PackageReleaseNotes>
15+
<![CDATA[
16+
#### v1.1.0
17+
- Support Slack's Block Kit with SlackMessage.Blocks property
18+
- Support Thread replies with SlackMessage.ThreadId property
19+
- Changed the whole Emoji setup. SlackMessage.Emoji is now a string and Emoji.\* are constants. This shouldn't cause problems in the most part!
20+
- Allow HttpClient to be injected into SlackClient.
21+
- SlackClient implements IDisposable to match the contained HttpClient instance even though this isn't the recommended usage. SlackClient, like HttpClient, there should only be a single instance of this class within the lifecycle of your application, for more information on why see: https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/
22+
]]>
23+
</PackageReleaseNotes>
24+
</PropertyGroup>
2425

26+
<ItemGroup>
27+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
28+
</ItemGroup>
2529
</Project>

src/Slack.Webhooks/Slack.Webhooks.nuspec

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)