Skip to content

Commit

Permalink
Merge pull request #956 from octokit/vs2015-support
Browse files Browse the repository at this point in the history
VS2015 migration
  • Loading branch information
shiftkey committed Nov 4, 2015
2 parents 302245b + ef906a8 commit 7ec44d1
Show file tree
Hide file tree
Showing 18 changed files with 88 additions and 19 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ tools/xunit.runner.console

# New VS Test Runner creates arbitrary folders with PDBs
*.pdb
pingme.txt
pingme.txt

# it's 2015, no need to keep this around when migrating projects
Backup/
1 change: 1 addition & 0 deletions Octokit.Reactive/Octokit.Reactive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\Octokit.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\Net45\Octokit.Reactive.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
10 changes: 10 additions & 0 deletions Octokit/Clients/IRepositoryContentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,21 @@ public interface IRepositoryContentsClient
Task DeleteFile(string owner, string name, string path, DeleteFileRequest request);
}

/// <summary>
/// The archive format to return from the server
/// </summary>
public enum ArchiveFormat
{
/// <summary>
/// The TAR archive format
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Tarball")]
[Parameter(Value = "tarball")]
Tarball,

/// <summary>
/// The ZIP archive format
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Zipball")]
[Parameter(Value = "zipball")]
Zipball
Expand Down
4 changes: 4 additions & 0 deletions Octokit/Clients/OAuthClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public class OauthClient : IOauthClient
readonly IConnection connection;
readonly Uri hostAddress;

/// <summary>
/// Create an instance of the OauthClient
/// </summary>
/// <param name="connection">The underlying connection to use</param>
public OauthClient(IConnection connection)
{
Ensure.ArgumentNotNull(connection, "connection");
Expand Down
4 changes: 4 additions & 0 deletions Octokit/Clients/RepositoryContentsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ namespace Octokit
/// </summary>
public class RepositoryContentsClient : ApiClient, IRepositoryContentsClient
{
/// <summary>
/// Create an instance of the RepositoryContentsClient
/// </summary>
/// <param name="apiConnection">The underlying connection to use</param>
public RepositoryContentsClient(IApiConnection apiConnection) : base(apiConnection)
{
}
Expand Down
19 changes: 19 additions & 0 deletions Octokit/Http/ApiResponse.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
namespace Octokit.Internal
{
/// <summary>
/// Wrapper for a response from the API
/// </summary>
/// <typeparam name="T">Payload contained in the response</typeparam>
public class ApiResponse<T> : IApiResponse<T>
{
/// <summary>
/// Create a ApiResponse from an existing request
/// </summary>
/// <param name="response">An existing request to wrap</param>
public ApiResponse(IResponse response) : this(response, GetBodyAsObject(response))
{
}

/// <summary>
/// Create a ApiResponse from an existing request and object
/// </summary>
/// <param name="response">An existing request to wrap</param>
/// <param name="bodyAsObject">The payload from an existing request</param>
public ApiResponse(IResponse response, T bodyAsObject)
{
Ensure.ArgumentNotNull(response, "response");
Expand All @@ -14,8 +27,14 @@ public ApiResponse(IResponse response, T bodyAsObject)
Body = bodyAsObject;
}

/// <summary>
/// The payload of the response
/// </summary>
public T Body { get; private set; }

/// <summary>
/// The context of the response
/// </summary>
public IResponse HttpResponse { get; private set; }

static T GetBodyAsObject(IResponse response)
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Http/HttpVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Octokit.Internal
{
public static class HttpVerb
internal static class HttpVerb
{
static readonly HttpMethod patch = new HttpMethod("PATCH");

public static HttpMethod Patch
internal static HttpMethod Patch
{
get { return patch; }
}
Expand Down
7 changes: 7 additions & 0 deletions Octokit/Http/ICredentialStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@

namespace Octokit
{
/// <summary>
/// Abstraction for interacting with credentials
/// </summary>
public interface ICredentialStore
{
/// <summary>
/// Retrieve the credentials from the underlying store
/// </summary>
/// <returns>A continuation containing credentials</returns>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification="Nope")]
Task<Credentials> GetCredentials();
}
Expand Down
11 changes: 11 additions & 0 deletions Octokit/Http/InMemoryCredentialStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,28 @@

namespace Octokit.Internal
{
/// <summary>
/// Abstraction for interacting with credentials
/// </summary>
public class InMemoryCredentialStore : ICredentialStore
{
readonly Credentials _credentials;

/// <summary>
/// Create an instance of the InMemoryCredentialStore
/// </summary>
/// <param name="credentials"></param>
public InMemoryCredentialStore(Credentials credentials)
{
Ensure.ArgumentNotNull(credentials, "credentials");

_credentials = credentials;
}

/// <summary>
/// Retrieve the credentials from the underlying store
/// </summary>
/// <returns>A continuation containing credentials</returns>
public Task<Credentials> GetCredentials()
{
return Task.FromResult(_credentials);
Expand Down
1 change: 0 additions & 1 deletion Octokit/Models/Request/NewArbitraryMarkDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public NewArbitraryMarkdown(string text)
/// </summary>
/// <param name="text">The Markdown text to render</param>
/// <param name="mode">The rendering mode. Can be either markdown by default or gfm</param>
/// </param>
public NewArbitraryMarkdown(string text, string mode)
: this(text, mode, null)
{
Expand Down
2 changes: 0 additions & 2 deletions Octokit/Models/Request/SearchRepositoriesRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ public DateRange(DateTime date, SearchQualifierOperator op)
/// <summary>
/// Matches repositories with regards to both the <param name="from"/> and <param name="to"/> dates.
/// </summary>
/// <param name="from">earlier date of the two</param>
/// <param name="to">latter date of the two</param>
public DateRange(DateTime from, DateTime to)
{
query = string.Format(CultureInfo.InvariantCulture, "{0:yyyy-MM-dd}..{1:yyyy-MM-dd}", from, to);
Expand Down
11 changes: 11 additions & 0 deletions Octokit/Models/Response/Meta.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@ namespace Octokit
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Meta
{
/// <summary>
/// Create an instance of the Meta
/// </summary>
public Meta()
{
}

/// <summary>
/// Create an instance of the Meta
/// </summary>
/// <param name="verifiablePasswordAuthentication">Whether authentication with username and password is supported.</param>
/// <param name="gitHubServicesSha">The currently-deployed SHA of github-services.</param>
/// <param name="hooks">An array of IP addresses in CIDR format specifying the addresses that incoming service hooks will originate from on GitHub.com.</param>
/// <param name="git">An array of IP addresses in CIDR format specifying the Git servers for the GitHub server</param>
/// <param name="pages">An array of IP addresses in CIDR format specifying the A records for GitHub Pages.</param>
public Meta(
bool verifiablePasswordAuthentication,
string gitHubServicesSha,
Expand Down
1 change: 1 addition & 0 deletions Octokit/Octokit-Mono.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<DocumentationFile>bin\Release\Mono\Octokit.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
1 change: 1 addition & 0 deletions Octokit/Octokit-Portable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\Octokit.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\Portable\Octokit.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
Expand Down
8 changes: 6 additions & 2 deletions Octokit/Octokit-netcore45.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Octokit</RootNamespace>
<AssemblyName>Octokit</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>
</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<CodeAnalysisCulture>en-US</CodeAnalysisCulture>
<ProjectTypeGuids>{BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<DefaultLanguage>en-US</DefaultLanguage>
<LangVersion>5</LangVersion>
<TargetPlatformVersion>8.1</TargetPlatformVersion>
<MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -42,6 +45,7 @@
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\Octokit.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\NetCore45\Octokit.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\SolutionInfo.cs">
Expand Down Expand Up @@ -412,7 +416,7 @@
<Link>CustomDictionary.xml</Link>
</CodeAnalysisDictionary>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v12.0\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
1 change: 1 addition & 0 deletions Octokit/Octokit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<RunCodeAnalysis>true</RunCodeAnalysis>
<CodeAnalysisRuleSet>..\Octokit.ruleset</CodeAnalysisRuleSet>
<DocumentationFile>bin\Release\Net45\Octokit.XML</DocumentationFile>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

![logo](octokit-dotnet_2.png)


Octokit is a client library targeting .NET 4.5 and above that provides an easy
way to interact with the [GitHub API](http://developer.github.com/v3/).

Expand Down Expand Up @@ -47,10 +46,10 @@ Please see https://github.com/octokit/octokit.net/blob/master/docs/index.md for
Octokit is a single assembly designed to be easy to deploy anywhere. If you
prefer to compile it yourself, you’ll need:

* Visual Studio 2013, or Xamarin Studio
* Windows 8 or higher to build and test the WinRT projects
* Visual Studio 2015 or Xamarin Studio
* Windows 8.1 or higher to build and test the WinRT projects

To clone it locally click the "Clone in Windows" button above or run the
To clone it locally click the "Clone in Desktop" button above or run the
following git commands.

```
Expand All @@ -64,10 +63,6 @@ cd Octokit
Visit the [Contributor Guidelines](https://github.com/octokit/octokit.net/blob/master/CONTRIBUTING.md)
for more details.

## Build Server

The builds and tests for Octokit.net are run on [AppVeyor](http://www.appveyor.com). This enables us to build and test incoming pull requests: https://ci.appveyor.com/project/Haacked15676/octokit-net

## Problems?

Octokit is 100% certified to be bug free. If you find an issue with our
Expand Down
6 changes: 3 additions & 3 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let buildMode = getBuildParamOrDefault "buildMode" "Release"

MSBuildDefaults <- {
MSBuildDefaults with
ToolsVersion = Some "12.0"
ToolsVersion = Some "14.0"
Verbosity = Some MSBuildVerbosity.Minimal }

Target "Clean" (fun _ ->
Expand Down Expand Up @@ -69,7 +69,7 @@ Target "FixProjects" (fun _ ->

let setParams defaults = {
defaults with
ToolsVersion = Some("12.0")
ToolsVersion = Some("14.0")
Targets = ["Build"]
Properties =
[
Expand Down Expand Up @@ -139,7 +139,7 @@ Target "ValidateLINQPadSamples"(fun _ ->

Target "CreateOctokitPackage" (fun _ ->
let net45Dir = packagingDir @@ "lib/net45/"
let netcore45Dir = packagingDir @@ "lib/netcore45/"
let netcore45Dir = packagingDir @@ "lib/netcore451/"
let portableDir = packagingDir @@ "lib/portable-net45+wp80+win+wpa81/"
let linqpadSamplesDir = packagingDir @@ "linqpad-samples"
CleanDirs [net45Dir; netcore45Dir; portableDir;linqpadSamplesDir]
Expand Down

0 comments on commit 7ec44d1

Please sign in to comment.