Skip to content

Commit b10b799

Browse files
committed
Convert to CPS
* Retarget to .NET Standard 2.0 * Fix compile issues * Fix warnings
1 parent d94fdfb commit b10b799

File tree

7 files changed

+21
-114
lines changed

7 files changed

+21
-114
lines changed

Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
3+
4+
<PropertyGroup>
5+
<Copyright>Copyright &#xA9; 2012 Marcus Bauer &lt;[email protected]&gt; // Copyright &#xA9; 2019 Git Extensions</Copyright>
6+
<Description>This is a Git Extensions fork of GitHub API for C#</Description>
7+
<Product>Git Extensions</Product>
8+
<Company>Git Extensions</Company>
9+
<Authors>Git.hub // Git Extensions</Authors>
10+
</PropertyGroup>
11+
12+
313
</Project>

Git.hub/Git.hub.csproj

Lines changed: 6 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,12 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
33
<PropertyGroup>
4-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6-
<ProductVersion>8.0.30703</ProductVersion>
7-
<SchemaVersion>2.0</SchemaVersion>
8-
<ProjectGuid>{F50B1DBF-1C9F-4437-87EC-7ABA805CC446}</ProjectGuid>
94
<OutputType>Library</OutputType>
10-
<AppDesignerFolder>Properties</AppDesignerFolder>
11-
<RootNamespace>Git.hub</RootNamespace>
12-
<AssemblyName>Git.hub</AssemblyName>
13-
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
14-
<RuntimeIdentifier>win</RuntimeIdentifier>
15-
<FileAlignment>512</FileAlignment>
16-
<TargetFrameworkProfile>
17-
</TargetFrameworkProfile>
18-
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
5+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
196
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21-
<DebugSymbols>true</DebugSymbols>
22-
<DebugType>full</DebugType>
23-
<Optimize>false</Optimize>
24-
<OutputPath>bin\Debug\</OutputPath>
25-
<DefineConstants>DEBUG;TRACE</DefineConstants>
26-
<ErrorReport>prompt</ErrorReport>
27-
<WarningLevel>4</WarningLevel>
28-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
29-
<Prefer32Bit>false</Prefer32Bit>
30-
</PropertyGroup>
31-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32-
<DebugType>pdbonly</DebugType>
33-
<Optimize>true</Optimize>
34-
<OutputPath>bin\Release\</OutputPath>
35-
<DefineConstants>TRACE</DefineConstants>
36-
<ErrorReport>prompt</ErrorReport>
37-
<WarningLevel>4</WarningLevel>
38-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
39-
<Prefer32Bit>false</Prefer32Bit>
40-
</PropertyGroup>
41-
<ItemGroup>
42-
<Reference Include="System" />
43-
<Reference Include="System.Web" />
44-
</ItemGroup>
45-
<ItemGroup>
46-
<PackageReference Include="RestSharp" Version="106.2.1" />
47-
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="15.8.132" />
48-
</ItemGroup>
7+
498
<ItemGroup>
50-
<Compile Include="APIv2\RepositoryV2.cs" />
51-
<Compile Include="Branch.cs" />
52-
<Compile Include="Client.cs" />
53-
<Compile Include="Commit.cs" />
54-
<Compile Include="GitHubTree.cs" />
55-
<Compile Include="Issue.cs" />
56-
<Compile Include="OAuth2Helper.cs" />
57-
<Compile Include="Organization.cs" />
58-
<Compile Include="Properties\AssemblyInfo.cs" />
59-
<Compile Include="PullRequest.cs" />
60-
<Compile Include="RestClientExtensions.cs" />
61-
<Compile Include="util\ReplacingJsonSerializer.cs" />
62-
<Compile Include="Repository.cs" />
63-
<Compile Include="User.cs" />
9+
<PackageReference Include="RestSharp" Version="106.6.10" />
6410
</ItemGroup>
65-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
11+
6612
</Project>

Git.hub/Issue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public IssueComment CreateComment(string body)
3535
request.AddUrlSegment("issue", Number.ToString());
3636

3737
request.RequestFormat = DataFormat.Json;
38-
request.AddBody(new {
38+
request.AddJsonBody(new {
3939
body = body
4040
});
4141
return _client.Post<IssueComment>(request).Data;

Git.hub/Properties/AssemblyInfo.cs

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

Git.hub/PullRequest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ private bool UpdateState(string state)
117117
request.AddUrlSegment("pull", Number.ToString());
118118

119119
request.RequestFormat = DataFormat.Json;
120-
request.AddBody(new
120+
request.AddJsonBody(new
121121
{
122122
state = state
123123
});

Git.hub/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public PullRequest CreatePullRequest(string headBranch, string baseBranch, strin
160160

161161
request.RequestFormat = DataFormat.Json;
162162
request.JsonSerializer = new ReplacingJsonSerializer("\"x__custom__base\":\"", "\"base\":\"");
163-
request.AddBody(new
163+
request.AddJsonBody(new
164164
{
165165
title = title,
166166
body = body,
@@ -206,7 +206,7 @@ public Issue CreateIssue(string title, string body)
206206
request.AddUrlSegment("repo", Name);
207207

208208
request.RequestFormat = DataFormat.Json;
209-
request.AddBody(new
209+
request.AddJsonBody(new
210210
{
211211
title = title,
212212
body = body

Git.hub/util/ReplacingJsonSerializer.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Text;
5+
using RestSharp.Serialization.Json;
56
using RestSharp.Serializers;
67

78
namespace Git.hub.util
@@ -47,18 +48,6 @@ public string DateFormat
4748
}
4849
}
4950

50-
public string Namespace
51-
{
52-
get
53-
{
54-
return serializer.Namespace;
55-
}
56-
set
57-
{
58-
serializer.Namespace = value;
59-
}
60-
}
61-
6251
public string RootElement
6352
{
6453
get

0 commit comments

Comments
 (0)