From 1f3f010f873f22bfdaa23d6855ad3750a4058dfc Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 12 Dec 2017 14:37:42 -0800 Subject: [PATCH] Upgrade CLI tools to .NET Core 2.1 --- Directory.Build.props | 4 ++++ Directory.Build.targets | 1 - NuGetPackageVerifier.json | 2 +- .../LaunchAnyCommand/LaunchAnyCommand.csproj | 2 +- .../WatchJavascriptFiles.csproj | 2 +- .../WatchMultipleProjects/Test/Test.csproj | 2 +- .../WatchMultipleProjects/Web/Web.csproj | 2 +- .../WatchMultipleProjects/watch.csproj | 2 +- ...pNetCore.DeveloperCertificates.Tools.csproj | 2 +- ...pNetCore.DeveloperCertificates.XPlat.csproj | 3 +-- .../Microsoft.DotNet.Watcher.Tools.csproj | 2 +- ...t.Extensions.Caching.SqlConfig.Tools.csproj | 2 +- ...osoft.Extensions.SecretManager.Tools.csproj | 2 +- .../FileWatcherTests.cs | 18 ++++++++++++------ ...DotNet.Watcher.Tools.FunctionalTests.csproj | 2 +- .../AppWithDeps/AppWithDeps.csproj | 2 +- .../GlobbingApp/GlobbingApp.csproj | 2 +- .../KitchenSink/KitchenSink.csproj | 2 +- .../TestProjects/NoDepsApp/NoDepsApp.csproj | 2 +- ...Microsoft.DotNet.Watcher.Tools.Tests.csproj | 2 +- .../MsBuildFileSetFactoryTest.cs | 10 ++++------ ...Extensions.SecretManager.Tools.Tests.csproj | 2 +- .../UserSecretsTestFixture.cs | 2 +- 23 files changed, 39 insertions(+), 33 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 29ae42a346..1afa691c5f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,4 +1,8 @@  + + diff --git a/Directory.Build.targets b/Directory.Build.targets index 894b1d0cf8..c3d61be3b4 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,6 +1,5 @@  - $(MicrosoftNETCoreApp20PackageVersion) $(MicrosoftNETCoreApp21PackageVersion) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index c279df4745..6979dfba80 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -27,7 +27,7 @@ "Microsoft.AspNetCore.DeveloperCertificates.XPlat": { "Exclusions": { "DOC_MISSING": { - "lib/netcoreapp2.0/Microsoft.AspNetCore.DeveloperCertificates.XPlat.dll": "Enter justification" + "lib/netcoreapp2.1/Microsoft.AspNetCore.DeveloperCertificates.XPlat.dll": "Docs not required to shipoob package" } } } diff --git a/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj b/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj index 39dea69c5f..96438bfa81 100644 --- a/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj +++ b/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj @@ -1,6 +1,6 @@ - netcoreapp2.0 + netcoreapp2.1 diff --git a/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj b/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj index f45eb26ccf..65fd51d8d7 100755 --- a/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj +++ b/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + netcoreapp2.1 diff --git a/samples/dotnet-watch/WatchMultipleProjects/Test/Test.csproj b/samples/dotnet-watch/WatchMultipleProjects/Test/Test.csproj index 694a96f3f9..0ffd10766a 100755 --- a/samples/dotnet-watch/WatchMultipleProjects/Test/Test.csproj +++ b/samples/dotnet-watch/WatchMultipleProjects/Test/Test.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + netcoreapp2.1 diff --git a/samples/dotnet-watch/WatchMultipleProjects/Web/Web.csproj b/samples/dotnet-watch/WatchMultipleProjects/Web/Web.csproj index 0bc2f3e71b..ec2a93ed3a 100755 --- a/samples/dotnet-watch/WatchMultipleProjects/Web/Web.csproj +++ b/samples/dotnet-watch/WatchMultipleProjects/Web/Web.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + netcoreapp2.1 diff --git a/samples/dotnet-watch/WatchMultipleProjects/watch.csproj b/samples/dotnet-watch/WatchMultipleProjects/watch.csproj index d34686cbbc..b0ab41a539 100644 --- a/samples/dotnet-watch/WatchMultipleProjects/watch.csproj +++ b/samples/dotnet-watch/WatchMultipleProjects/watch.csproj @@ -1,6 +1,6 @@ - netcoreapp2.0 + netcoreapp2.1 false diff --git a/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj b/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj index 36ba69485e..c2fd9283f1 100644 --- a/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj +++ b/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + netcoreapp2.1 dotnet-developercertificates exe Command line tool to generate certificates used in ASP.NET Core during development. diff --git a/src/Microsoft.AspNetCore.DeveloperCertificates.XPlat/Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj b/src/Microsoft.AspNetCore.DeveloperCertificates.XPlat/Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj index 04bf6946c9..81c90a297c 100644 --- a/src/Microsoft.AspNetCore.DeveloperCertificates.XPlat/Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj +++ b/src/Microsoft.AspNetCore.DeveloperCertificates.XPlat/Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj @@ -1,11 +1,10 @@ - netcoreapp2.0 + netcoreapp2.1 Package for the CLI first run experience. $(DefineConstants);XPLAT aspnet;cli - false diff --git a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj b/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj index 294943581a..5c79f6f652 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj +++ b/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 dotnet-watch exe Command line tool to watch for source file changes during development and restart the dotnet command. diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj index f8ea155986..d3ce82febe 100644 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj +++ b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 dotnet-sql-cache exe Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching. diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj index 3dc0507021..ef8adb296f 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj +++ b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 dotnet-user-secrets exe Command line tool to manage user secrets for Microsoft.Extensions.Configuration. diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/FileWatcherTests.cs b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/FileWatcherTests.cs index 4df16166a0..9f1cc132bc 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/FileWatcherTests.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/FileWatcherTests.cs @@ -292,16 +292,16 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests { changedEv.Set(); } - catch(ObjectDisposedException) + catch (ObjectDisposedException) { // There's a known race condition here: // even though we tell the watcher to stop raising events and we unsubscribe the handler - // there might be in-flight events that will still process. Since we dispose the reset + // there might be in-flight events that will still process. Since we dispose the reset // event, this code will fail if the handler executes after Dispose happens. There's no // better way to guard against it than catch because we cannot check if the object is // disposed nor can we check if there are any in-flight events. // This is actually a known issue in the corefx file watcher. It can trigger multiple - // times for the same item. + // times for the same item. } }; @@ -316,8 +316,10 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests var testFileFullPath = Path.Combine(dir, "foo1"); File.WriteAllText(testFileFullPath, string.Empty); Assert.True(changedEv.WaitOne(DefaultTimeout)); - Assert.Equal(testFileFullPath, filesChanged.Single()); + var fileChanged = Assert.Single(filesChanged); + Assert.Equal(testFileFullPath, fileChanged); filesChanged.Clear(); + changedEv.Reset(); // On Unix the file write time is in 1s increments; // if we don't wait, there's a chance that the polling @@ -327,8 +329,10 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests testFileFullPath = Path.Combine(dir, "foo2"); File.WriteAllText(testFileFullPath, string.Empty); Assert.True(changedEv.WaitOne(DefaultTimeout)); - Assert.Equal(testFileFullPath, filesChanged.Single()); + fileChanged = Assert.Single(filesChanged); + Assert.Equal(testFileFullPath, fileChanged); filesChanged.Clear(); + changedEv.Reset(); // On Unix the file write time is in 1s increments; // if we don't wait, there's a chance that the polling @@ -340,6 +344,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests Assert.True(changedEv.WaitOne(DefaultTimeout)); Assert.Equal(testFileFullPath, filesChanged.Single()); filesChanged.Clear(); + changedEv.Reset(); // On Unix the file write time is in 1s increments; // if we don't wait, there's a chance that the polling @@ -348,7 +353,8 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests File.WriteAllText(testFileFullPath, string.Empty); Assert.True(changedEv.WaitOne(DefaultTimeout)); - Assert.Equal(testFileFullPath, filesChanged.Single()); + fileChanged = Assert.Single(filesChanged); + Assert.Equal(testFileFullPath, fileChanged); watcher.EnableRaisingEvents = false; watcher.OnFileChange -= handler; diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj index 8d2c4713c8..06434ae064 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 $(DefaultItemExcludes);TestProjects\**\* diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj index 3a4f75ddc6..76d7446452 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + netcoreapp2.1 exe diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj index d18211405e..60645a49da 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 exe false diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj index aeb186ac39..699071e138 100755 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj @@ -9,7 +9,7 @@ Exe - netcoreapp2.0 + netcoreapp2.1 diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj index 161a1c9290..86e88b8b95 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 exe diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj index c005f40d88..0ace1e9148 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs b/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs index dde03d31ab..572b021f80 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; +using Microsoft.AspNetCore.Testing; using Microsoft.DotNet.Watcher.Internal; using Microsoft.Extensions.Tools.Internal; using Xunit; @@ -274,12 +275,9 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests private async Task GetFileSet(MsBuildFileSetFactory filesetFactory) { _tempDir.Create(); - var createTask = filesetFactory.CreateAsync(CancellationToken.None); - var finished = await Task.WhenAny(createTask, Task.Delay(TimeSpan.FromSeconds(10))); - - Assert.Same(createTask, finished); - Assert.NotNull(createTask.Result); - return createTask.Result; + return await filesetFactory + .CreateAsync(CancellationToken.None) + .TimeoutAfter(TimeSpan.FromSeconds(30)); } public void Dispose() diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj b/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj index 67ace090c0..cd5d68d140 100644 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj +++ b/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.0 + netcoreapp2.1 diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/UserSecretsTestFixture.cs b/test/Microsoft.Extensions.SecretManager.Tools.Tests/UserSecretsTestFixture.cs index 36a9e524ae..14e62805bc 100644 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/UserSecretsTestFixture.cs +++ b/test/Microsoft.Extensions.SecretManager.Tools.Tests/UserSecretsTestFixture.cs @@ -35,7 +35,7 @@ namespace Microsoft.Extensions.Configuration.UserSecrets.Tests private const string ProjectTemplate = @" Exe - netcoreapp2.0 + netcoreapp2.1 {0} false