diff --git a/Octokit.Reactive/Octokit.Reactive.csproj b/Octokit.Reactive/Octokit.Reactive.csproj index 6bcbbfae72..0ba912abf4 100644 --- a/Octokit.Reactive/Octokit.Reactive.csproj +++ b/Octokit.Reactive/Octokit.Reactive.csproj @@ -6,7 +6,8 @@ GitHub 0.0.0-dev true - netstandard2.0;net46 + netstandard2.0 + true Octokit.Reactive Octokit.Reactive embedded @@ -19,10 +20,6 @@ Copyright GitHub 2017 - - 2.0.0 - - 1591;1701;1702;1705 @@ -41,14 +38,7 @@ - + - - - - - - - diff --git a/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs b/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs index c3fba05f45..0492ffa1b4 100644 --- a/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs +++ b/Octokit.Tests.Integration/Clients/RepositoriesClientTests.cs @@ -530,34 +530,6 @@ public async Task UpdatesNameWithRepositoryId() } } - [IntegrationTest] - public async Task UpdatesNameObsolete() - { - using (var repoContext = await _github.CreateUserRepositoryContext()) - { - var updatedName = Helper.MakeNameWithTimestamp("updated-repo"); - var update = new RepositoryUpdate(updatedName); - - var updatedRepository = await _github.Repository.Edit(repoContext.RepositoryOwner, repoContext.RepositoryName, update); - - Assert.Equal(update.Name, updatedRepository.Name); - } - } - - [IntegrationTest] - public async Task UpdatesNameWithRepositoryIdObsolete() - { - using (var repoContext = await _github.CreateUserRepositoryContext()) - { - var updatedName = Helper.MakeNameWithTimestamp("updated-repo"); - var update = new RepositoryUpdate(updatedName); - - var updatedRepository = await _github.Repository.Edit(repoContext.RepositoryId, update); - - Assert.Equal(update.Name, updatedRepository.Name); - } - } - [IntegrationTest] public async Task UpdatesDescription() { @@ -811,7 +783,7 @@ public async Task UpdatesMergeMethodWithRepositoryId() Assert.True(editedRepository.AllowAutoMerge); } } - + [IntegrationTest] public async Task UpdatesDeleteBranchOnMergeMethod() { @@ -826,7 +798,7 @@ public async Task UpdatesDeleteBranchOnMergeMethod() Assert.True(repository.DeleteBranchOnMerge); } } - + [IntegrationTest] public async Task UpdatesDeleteBranchOnMergeMethodWithRepositoryId() { @@ -1047,7 +1019,7 @@ public async Task ReturnsSpecifiedRepositoryWithLicenseInformation() Assert.Equal("mit", repository.License.Key); Assert.Equal("MIT License", repository.License.Name); } - + [IntegrationTest] public async Task ReturnsRepositoryDeleteBranchOnMergeOptions() { @@ -2099,10 +2071,10 @@ public async Task ReturnsCodeOwnersErrors() using (var repoContext = await _github.CreateUserRepositoryContext()) { await _github.Repository.Content.CreateFile(repoContext.RepositoryOwner, repoContext.RepositoryName, ".github/codeowners", new CreateFileRequest("Create codeowners", @"* snyrting6@hotmail.com")); - + // Sometimes it takes a second to create the file Thread.Sleep(TimeSpan.FromSeconds(2)); - + var license = await _github.Repository.GetAllCodeOwnersErrors(repoContext.RepositoryOwner, repoContext.RepositoryName); Assert.NotEmpty(license.Errors); } diff --git a/Octokit.Tests/Clients/RepositoriesClientTests.cs b/Octokit.Tests/Clients/RepositoriesClientTests.cs index 40f72252b2..c7496d35b8 100644 --- a/Octokit.Tests/Clients/RepositoriesClientTests.cs +++ b/Octokit.Tests/Clients/RepositoriesClientTests.cs @@ -1129,7 +1129,7 @@ public void PatchesCorrectUrl() { var connection = Substitute.For(); var client = new RepositoriesClient(connection); - var update = new RepositoryUpdate("repo"); + var update = new RepositoryUpdate() { Name= "repo" }; client.Edit("owner", "repo", update); @@ -1143,7 +1143,7 @@ public void PatchesCorrectUrlWithRepositoryId() { var connection = Substitute.For(); var client = new RepositoriesClient(connection); - var update = new RepositoryUpdate("repo"); + var update = new RepositoryUpdate() { Name= "repo" }; client.Edit(1, update); @@ -1155,7 +1155,7 @@ public void PatchesCorrectUrlWithRepositoryId() public async Task EnsuresNonNullArguments() { var client = new RepositoriesClient(Substitute.For()); - var update = new RepositoryUpdate("anyreponame"); + var update = new RepositoryUpdate() { Name= "anyreponame" }; await Assert.ThrowsAsync(() => client.Edit(null, "repo", update)); await Assert.ThrowsAsync(() => client.Edit("owner", null, update)); diff --git a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs index 747fd1d4fb..469d0a9c62 100644 --- a/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableRepositoriesClientTests.cs @@ -846,7 +846,7 @@ public void PatchsTheCorrectUrl() { var github = Substitute.For(); var client = new ObservableRepositoriesClient(github); - var update = new RepositoryUpdate("anyreponame"); + var update = new RepositoryUpdate(){ Name= "anyreponame" }; client.Edit("owner", "repo", update); @@ -858,7 +858,7 @@ public void PatchsTheCorrectUrlWithRepositoryId() { var github = Substitute.For(); var client = new ObservableRepositoriesClient(github); - var update = new RepositoryUpdate("anyreponame"); + var update = new RepositoryUpdate(){ Name= "anyreponame" }; client.Edit(1, update); @@ -869,7 +869,7 @@ public void PatchsTheCorrectUrlWithRepositoryId() public async Task EnsuresNonNullArguments() { var client = new ObservableRepositoriesClient(Substitute.For()); - var update = new RepositoryUpdate("anyreponame"); + var update = new RepositoryUpdate() { Name= "anyreponame" }; Assert.Throws(() => client.Edit(null, "repo", update)); Assert.Throws(() => client.Edit("owner", null, update)); diff --git a/Octokit/Models/Request/RepositoryUpdate.cs b/Octokit/Models/Request/RepositoryUpdate.cs index 7e8e3438cb..02dda177e3 100644 --- a/Octokit/Models/Request/RepositoryUpdate.cs +++ b/Octokit/Models/Request/RepositoryUpdate.cs @@ -16,17 +16,6 @@ public class RepositoryUpdate /// public RepositoryUpdate() { } - /// - /// Creates an object that describes an update to a repository on GitHub. - /// - /// The name of the repository. This is the only required parameter. - [Obsolete("Use the constructor with no parameters as name is no longer a required field")] - public RepositoryUpdate(string name) - { - Ensure.ArgumentNotNullOrEmptyString(name, nameof(name)); - Name = name; - } - /// /// Required. Gets or sets the repository name. /// diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index ace89edc6b..0148ebc3eb 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -6,7 +6,7 @@ GitHub 0.0.0-dev true - netstandard2.0;net46 + netstandard2.0 Octokit Octokit embedded @@ -19,26 +19,11 @@ Copyright GitHub 2017 - - $(DefineConstants);HAS_TYPEINFO;SIMPLE_JSON_INTERNAL;SIMPLE_JSON_OBJARRAYINTERNAL;SIMPLE_JSON_READONLY_COLLECTIONS;SIMPLE_JSON_TYPEINFO - 2.0.0 - - - - $(DefineConstants);HAS_ENVIRONMENT;HAS_REGEX_COMPILED_OPTIONS;SIMPLE_JSON_INTERNAL;SIMPLE_JSON_OBJARRAYINTERNAL;SIMPLE_JSON_READONLY_COLLECTIONS;HAS_SERVICEPOINTMANAGER - - + $(DefineConstants);HAS_TYPEINFO;SIMPLE_JSON_INTERNAL;SIMPLE_JSON_OBJARRAYINTERNAL;SIMPLE_JSON_READONLY_COLLECTIONS;SIMPLE_JSON_TYPEINFO 1591;1701;1702;1705 - - - - - - - diff --git a/build/Context.cs b/build/Context.cs index e0af2ff004..f9ede409e5 100644 --- a/build/Context.cs +++ b/build/Context.cs @@ -1,6 +1,6 @@ using Cake.Common; using Cake.Common.Diagnostics; -using Cake.Common.Tools.DotNetCore.Test; +using Cake.Common.Tools.DotNet.Test; using Cake.Core; using Cake.Core.IO; using Cake.Frosting; @@ -28,9 +28,9 @@ public class Context : FrostingContext public FilePath GitVersionToolPath { get; set; } - public DotNetCoreTestSettings GetTestSettings() + public DotNetTestSettings GetTestSettings() { - var settings = new DotNetCoreTestSettings + var settings = new DotNetTestSettings { Configuration = Configuration, NoBuild = true diff --git a/build/Lifetime.cs b/build/Lifetime.cs index a28729bb13..310841b202 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -51,8 +51,8 @@ public override void Setup(Context context) new Project { Name = "Octokit.Tests.Integration", Path = "./Octokit.Tests.Integration/Octokit.Tests.Integration.csproj", IntegrationTests = true } }; - context.GitVersionToolPath = ToolInstaller.DotNetCoreToolInstall(context, "GitVersion.Tool", "5.6.5", "dotnet-gitversion"); - ToolInstaller.DotNetCoreToolInstall(context, "coverlet.console", "1.7.2", "coverlet"); + context.GitVersionToolPath = ToolInstaller.DotNetToolInstall(context, "GitVersion.Tool", "5.6.5", "dotnet-gitversion"); + ToolInstaller.DotNetToolInstall(context, "coverlet.console", "1.7.2", "coverlet"); // Calculate semantic version. context.Version = BuildVersion.Calculate(context); diff --git a/build/Tasks/Build.cs b/build/Tasks/Build.cs index 353c9e10b1..2e1af6c0ac 100644 --- a/build/Tasks/Build.cs +++ b/build/Tasks/Build.cs @@ -1,5 +1,5 @@ -using Cake.Common.Tools.DotNetCore; -using Cake.Common.Tools.DotNetCore.Build; +using Cake.Common.Tools.DotNet; +using Cake.Common.Tools.DotNet.Build; using Cake.Core; using Cake.Frosting; @@ -9,7 +9,7 @@ public class Build : FrostingTask { public override void Run(Context context) { - context.DotNetCoreBuild("./Octokit.sln", new DotNetCoreBuildSettings + context.DotNetBuild("./Octokit.sln", new DotNetBuildSettings { Configuration = context.Configuration, ArgumentCustomization = args => args diff --git a/build/Tasks/ConventionTests.cs b/build/Tasks/ConventionTests.cs index d79c7c84e9..41018d2449 100644 --- a/build/Tasks/ConventionTests.cs +++ b/build/Tasks/ConventionTests.cs @@ -1,6 +1,6 @@ using System.Linq; using Cake.Common.Diagnostics; -using Cake.Common.Tools.DotNetCore; +using Cake.Common.Tools.DotNet; using Cake.Frosting; [IsDependentOn(typeof(Build))] @@ -11,7 +11,7 @@ public override void Run(Context context) foreach (var project in context.Projects.Where(x => x.ConventionTests)) { context.Information("Executing Convention Tests Project {0}...", project.Name); - context.DotNetCoreTest(project.Path.FullPath, context.GetTestSettings()); + context.DotNetTest(project.Path.FullPath, context.GetTestSettings()); } } } diff --git a/build/Tasks/IntegrationTests.cs b/build/Tasks/IntegrationTests.cs index 9acafeaef7..879305b9e5 100644 --- a/build/Tasks/IntegrationTests.cs +++ b/build/Tasks/IntegrationTests.cs @@ -1,7 +1,7 @@ using System.Linq; using Cake.Common.Diagnostics; -using Cake.Common.Tools.DotNetCore; -using Cake.Common.Tools.DotNetCore.Test; +using Cake.Common.Tools.DotNet; +using Cake.Common.Tools.DotNet.Test; using Cake.Frosting; [IsDependentOn(typeof(Build))] @@ -12,7 +12,7 @@ public override void Run(Context context) foreach (var project in context.Projects.Where(x => x.IntegrationTests)) { context.Information("Executing Integration Tests Project {0}...", project.Name); - context.DotNetCoreTest(project.Path.FullPath, context.GetTestSettings()); + context.DotNetTest(project.Path.FullPath, context.GetTestSettings()); } } diff --git a/build/Tasks/Package.cs b/build/Tasks/Package.cs index bbaddd9223..ed0ecadbc6 100644 --- a/build/Tasks/Package.cs +++ b/build/Tasks/Package.cs @@ -1,6 +1,6 @@ using Cake.Common.Diagnostics; -using Cake.Common.Tools.DotNetCore; -using Cake.Common.Tools.DotNetCore.Pack; +using Cake.Common.Tools.DotNet; +using Cake.Common.Tools.DotNet.Pack; using Cake.Core; using Cake.Frosting; @@ -16,7 +16,7 @@ public override void Run(Context context) if (project.Publish) { context.Information("Packing {0}...", project.Name); - context.DotNetCorePack(project.Path.FullPath, new DotNetCorePackSettings() + context.DotNetPack(project.Path.FullPath, new DotNetPackSettings() { Configuration = context.Configuration, NoBuild = true, diff --git a/build/Tasks/Restore.cs b/build/Tasks/Restore.cs index e84cf90bca..34500c3830 100644 --- a/build/Tasks/Restore.cs +++ b/build/Tasks/Restore.cs @@ -1,5 +1,5 @@ -using Cake.Common.Tools.DotNetCore; -using Cake.Common.Tools.DotNetCore.Restore; +using Cake.Common.Tools.DotNet; +using Cake.Common.Tools.DotNet.Restore; using Cake.Core; using Cake.Frosting; @@ -8,7 +8,7 @@ public sealed class Restore : FrostingTask { public override void Run(Context context) { - context.DotNetCoreRestore(".", new DotNetCoreRestoreSettings + context.DotNetRestore(".", new DotNetRestoreSettings { ArgumentCustomization = args => args .Append("/p:Version={0}", context.Version.GetSemanticVersion()) diff --git a/build/Tasks/UnitTests.cs b/build/Tasks/UnitTests.cs index 620cd3838f..e3ae4682ae 100644 --- a/build/Tasks/UnitTests.cs +++ b/build/Tasks/UnitTests.cs @@ -1,7 +1,8 @@ using System.Linq; -using Cake.Common.Diagnostics; -using Cake.Common.Tools.DotNetCore; using Cake.Frosting; +using Cake.Common.Diagnostics; +using Cake.Common.Tools; +using Cake.Common.Tools.DotNet; [IsDependentOn(typeof(Build))] public sealed class UnitTests : FrostingTask @@ -11,7 +12,7 @@ public override void Run(Context context) foreach (var project in context.Projects.Where(x => x.UnitTests)) { context.Information("Executing Unit Tests Project {0}...", project.Name); - context.DotNetCoreTest(project.Path.FullPath, context.GetTestSettings()); + context.DotNetTest(project.Path.FullPath, context.GetTestSettings()); } } } diff --git a/build/Tasks/ValidateLINQPadSamples.cs b/build/Tasks/ValidateLINQPadSamples.cs index 1bfaf1b758..77797757f5 100644 --- a/build/Tasks/ValidateLINQPadSamples.cs +++ b/build/Tasks/ValidateLINQPadSamples.cs @@ -17,7 +17,7 @@ public override void Run(Context context) .Combine("Octokit.Reactive") .Combine("bin") .Combine(context.Configuration) - .Combine("net46") + .Combine("netstandard2.0") .MakeAbsolute(context.Environment) .FullPath; diff --git a/build/Utilities/ToolInstaller.cs b/build/Utilities/ToolInstaller.cs index 1a03d21526..c2e0fcb21f 100644 --- a/build/Utilities/ToolInstaller.cs +++ b/build/Utilities/ToolInstaller.cs @@ -1,6 +1,6 @@ using Cake.Common.IO; -using Cake.Common.Tools.DotNetCore; -using Cake.Common.Tools.DotNetCore.Tool; +using Cake.Common.Tools.DotNet; +using Cake.Common.Tools.DotNet.Tool; using Cake.Common.Tools.NuGet; using Cake.Common.Tools.NuGet.Install; using Cake.Core; @@ -8,7 +8,7 @@ public static class ToolInstaller { - private static DirectoryPath ToolsPath { get; } = "./tools"; + private static DirectoryPath ToolsPath { get; } = "./tools"; public static void Install(ICakeContext context, string package, string version) { context.NuGetInstall(package, new NuGetInstallSettings @@ -19,7 +19,7 @@ public static void Install(ICakeContext context, string package, string version) }); } - public static FilePath DotNetCoreToolInstall( + public static FilePath DotNetToolInstall( this ICakeContext context, string package, string version, @@ -42,10 +42,10 @@ public static FilePath DotNetCoreToolInstall( : ".exe" ) ); - + if (!context.DirectoryExists(toolInstallPath) && context.FileExists(toolPath)) { - context.DotNetCoreTool("tool", new DotNetCoreToolSettings + context.DotNetTool("tool", new DotNetToolSettings { ArgumentCustomization = args => args .Append("uninstall") @@ -56,7 +56,7 @@ public static FilePath DotNetCoreToolInstall( if (!context.FileExists(toolPath)) { - context.DotNetCoreTool("tool", new DotNetCoreToolSettings + context.DotNetTool("tool", new DotNetToolSettings { ArgumentCustomization = args => args .Append("install") @@ -73,4 +73,4 @@ public static FilePath DotNetCoreToolInstall( return toolPath; } -} \ No newline at end of file +}