From 5a444fa75ccbd3eba1df2df50362bf048d761e64 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 10 Feb 2017 08:26:17 -0800 Subject: [PATCH] Cleanup project files and workaround, run tests on .NET Core 1.1 --- NuGetPackageVerifier.json | 61 ++++++++----------- .../Microsoft.DotNet.Watcher.Tools.csproj | 6 +- .../Properties/AssemblyInfo.cs | 2 - ....Extensions.Caching.SqlConfig.Tools.csproj | 7 ++- ...soft.Extensions.SecretManager.Tools.csproj | 7 ++- ...otNet.Watcher.Tools.FunctionalTests.csproj | 10 ++- .../AppWithDeps/AppWithDeps.csproj | 2 +- .../TestProjects/Dependency/Dependency.csproj | 2 +- .../GlobbingApp/GlobbingApp.csproj | 2 +- .../TestProjects/NoDepsApp/NoDepsApp.csproj | 2 +- ...icrosoft.DotNet.Watcher.Tools.Tests.csproj | 4 +- .../MsBuildFileSetFactoryTest.cs | 45 +++++--------- .../Utilities/TemporaryCSharpProject.cs | 23 ++----- ...xtensions.SecretManager.Tools.Tests.csproj | 6 +- .../Microsoft.Extensions.Tools.Tests.csproj | 6 +- version.props | 2 +- 16 files changed, 76 insertions(+), 111 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index aa4710b372..92dad6ebe4 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -1,38 +1,29 @@ { - "adx": { - "rules": [ - "AdxVerificationCompositeRule" - ], - "packages": { - "Microsoft.DotNet.Watcher.Tools": { - "exclusions": { - "DOC_MISSING": { - "lib/netcoreapp1.0/dotnet-watch.dll": "xmldocs not required for DotnetCliTool packages" - } - }, - "packageTypes": ["DotnetCliTool"] - }, - "Microsoft.Extensions.Caching.SqlConfig.Tools": { - "exclusions": { - "DOC_MISSING": { - "lib/netcoreapp1.0/dotnet-sql-cache.dll": "xmldocs not required for DotnetCliTool packages" - } - }, - "packageTypes": ["DotnetCliTool"] - }, - "Microsoft.Extensions.SecretManager.Tools": { - "exclusions": { - "DOC_MISSING": { - "lib/netcoreapp1.0/dotnet-user-secrets.dll": "xmldocs not required for DotnetCliTool packages" - } - }, - "packageTypes": ["DotnetCliTool"] - } - } - }, - "Default": { - "rules": [ - "DefaultCompositeRule" + "adx": { + "rules": [ + "AdxVerificationCompositeRule" + ], + "packages": { + "Microsoft.DotNet.Watcher.Tools": { + "packageTypes": [ + "DotnetCliTool" ] + }, + "Microsoft.Extensions.Caching.SqlConfig.Tools": { + "packageTypes": [ + "DotnetCliTool" + ] + }, + "Microsoft.Extensions.SecretManager.Tools": { + "packageTypes": [ + "DotnetCliTool" + ] + } } -} \ No newline at end of file + }, + "Default": { + "rules": [ + "DefaultCompositeRule" + ] + } +} 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 193cfa8ac3..547e8fcf6d 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj +++ b/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj @@ -1,4 +1,5 @@ - + + @@ -9,7 +10,6 @@ Microsoft.DotNet.Watcher.Tools dotnet;watch DotnetCliTool - 1.0.0 @@ -23,4 +23,4 @@ - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs b/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs index e6d00aa36d..70797aee7c 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs +++ b/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs @@ -4,5 +4,3 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.DotNet.Watcher.Tools.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -// TODO remove when .Source packages work -[assembly: InternalsVisibleTo("Microsoft.DotNet.Watcher.Tools.FunctionalTests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 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 19f3aa9175..d3a16d3946 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,5 +1,7 @@ - + + + netcoreapp1.0 dotnet-sql-cache @@ -8,7 +10,6 @@ Microsoft.Extensions.Caching.SqlConfig.Tools cache;distributedcache;sqlserver DotnetCliTool - 1.0.0 @@ -20,4 +21,4 @@ - \ No newline at end of file + 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 dc050cfa32..3683e22c37 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj +++ b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj @@ -1,5 +1,7 @@ - + + + netcoreapp1.0 dotnet-user-secrets @@ -9,7 +11,6 @@ configuration;secrets;usersecrets DotnetCliTool false - 1.0.0 @@ -22,4 +23,4 @@ - \ No newline at end of file + 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 1ef391c545..19088145f1 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,9 +1,9 @@ - + - netcoreapp1.0;netcoreapp1.1 + netcoreapp1.1 $(DefaultItemExcludes);TestProjects\**\* @@ -18,6 +18,10 @@ + + + + @@ -27,4 +31,4 @@ - \ No newline at end of file + 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 93142c90b5..8afd97e37b 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj @@ -1,4 +1,4 @@ - + netcoreapp1.0 diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj index cbdcf50173..22361d48cb 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj @@ -1,4 +1,4 @@ - + netstandard1.5 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 e714c10c3b..fa5c47e125 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj @@ -1,4 +1,4 @@ - + netcoreapp1.0 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 b10a1c94fc..80621241e8 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj @@ -1,4 +1,4 @@ - + netcoreapp1.0 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 424f9ab2cd..285d18f0cf 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,9 +1,9 @@ - + - netcoreapp1.0 + netcoreapp1.1 diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs b/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs index 9b46f04c1d..41602fc0d8 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -28,11 +28,9 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests [Fact] public async Task FindsCustomWatchItems() { - TemporaryCSharpProject target; _tempDir - .WithCSharpProject("Project1", out target) + .WithCSharpProject("Project1", out var target) .WithTargetFrameworks("netcoreapp1.0") - .WithDefaultGlobs() .WithItem(new ItemSpec { Name = "Watch", Include = "*.js", Exclude = "gulpfile.js" }) .Dir() .WithFile("Program.cs") @@ -56,12 +54,10 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests [Fact] public async Task ExcludesDefaultItemsWithWatchFalseMetadata() { - TemporaryCSharpProject target; _tempDir - .WithCSharpProject("Project1", out target) + .WithCSharpProject("Project1", out var target) .WithTargetFrameworks("net40") - .WithItem(new ItemSpec { Name = "Compile", Include = "*.cs" }) - .WithItem(new ItemSpec { Name = "EmbeddedResource", Include = "*.resx", Watch = false }) + .WithItem(new ItemSpec { Name = "EmbeddedResource", Update = "*.resx", Watch = false }) .Dir() .WithFile("Program.cs") .WithFile("Strings.resx"); @@ -82,14 +78,11 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests [Fact] public async Task SingleTfm() { - TemporaryCSharpProject target; - _tempDir .SubDir("src") .SubDir("Project1") - .WithCSharpProject("Project1", out target) + .WithCSharpProject("Project1", out var target) .WithTargetFrameworks("netcoreapp1.0") - .WithDefaultGlobs() .Dir() .WithFile("Program.cs") .WithFile("Class1.cs") @@ -117,12 +110,12 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests [Fact] public async Task MultiTfm() { - TemporaryCSharpProject target; - _tempDir + _tempDir .SubDir("src") .SubDir("Project1") - .WithCSharpProject("Project1", out target) + .WithCSharpProject("Project1", out var target) .WithTargetFrameworks("netcoreapp1.0", "net451") + .WithProperty("EnableDefaultCompileItems", "false") .WithItem("Compile", "Class1.netcore.cs", "'$(TargetFramework)'=='netcoreapp1.0'") .WithItem("Compile", "Class1.desktop.cs", "'$(TargetFramework)'=='net451'") .Dir() @@ -147,22 +140,18 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests [Fact] public async Task ProjectReferences_OneLevel() { - TemporaryCSharpProject target; - TemporaryCSharpProject proj2; _tempDir .SubDir("src") .SubDir("Project2") - .WithCSharpProject("Project2", out proj2) + .WithCSharpProject("Project2", out var proj2) .WithTargetFrameworks("netstandard1.1") - .WithDefaultGlobs() .Dir() .WithFile("Class2.cs") .Up() .SubDir("Project1") - .WithCSharpProject("Project1", out target) + .WithCSharpProject("Project1", out var target) .WithTargetFrameworks("netcoreapp1.0", "net451") .WithProjectReference(proj2) - .WithDefaultGlobs() .Dir() .WithFile("Class1.cs"); @@ -184,31 +173,25 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests [Fact] public async Task TransitiveProjectReferences_TwoLevels() { - TemporaryCSharpProject target; - TemporaryCSharpProject proj2; - TemporaryCSharpProject proj3; _tempDir .SubDir("src") .SubDir("Project3") - .WithCSharpProject("Project3", out proj3) + .WithCSharpProject("Project3", out var proj3) .WithTargetFrameworks("netstandard1.0") - .WithDefaultGlobs() .Dir() .WithFile("Class3.cs") .Up() .SubDir("Project2") - .WithCSharpProject("Project2", out proj2) + .WithCSharpProject("Project2", out TemporaryCSharpProject proj2) .WithTargetFrameworks("netstandard1.1") .WithProjectReference(proj3) - .WithDefaultGlobs() .Dir() .WithFile("Class2.cs") .Up() .SubDir("Project1") - .WithCSharpProject("Project1", out target) + .WithCSharpProject("Project1", out TemporaryCSharpProject target) .WithTargetFrameworks("netcoreapp1.0", "net451") .WithProjectReference(proj2) - .WithDefaultGlobs() .Dir() .WithFile("Class1.cs"); @@ -233,7 +216,7 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests public async Task ProjectReferences_Graph() { var graph = new TestProjectGraph(_tempDir); - graph.OnCreate(p => p.WithTargetFrameworks("net45").WithDefaultGlobs()); + graph.OnCreate(p => p.WithTargetFrameworks("net45")); var matches = Regex.Matches(@" A->B B->C C->D D->E B->E diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryCSharpProject.cs b/test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryCSharpProject.cs index 53ee3d38e4..7156cf85cf 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryCSharpProject.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryCSharpProject.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -11,8 +11,7 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests public class TemporaryCSharpProject { private const string Template = - @" - + @" {0} Exe @@ -20,13 +19,8 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests {1} - "; - private const string DefaultGlobs = -@" -"; - private readonly string _filename; private readonly TemporaryDirectory _directory; private List _items = new List(); @@ -37,9 +31,6 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests Name = name; _filename = name + ".csproj"; _directory = directory; - - // workaround CLI issue - WithProperty("SkipInvalidConfigurations", "true"); } public string Name { get; } @@ -81,6 +72,7 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests sb.Append(item.Name).Append(" "); if (item.Include != null) sb.Append(" Include=\"").Append(item.Include).Append('"'); if (item.Remove != null) sb.Append(" Remove=\"").Append(item.Remove).Append('"'); + if (item.Update != null) sb.Append(" Update=\"").Append(item.Update).Append('"'); if (item.Exclude != null) sb.Append(" Exclude=\"").Append(item.Exclude).Append('"'); if (item.Condition != null) sb.Append(" Exclude=\"").Append(item.Condition).Append('"'); if (!item.Watch) sb.Append(" Watch=\"false\" "); @@ -99,12 +91,6 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests return WithItem(new ItemSpec { Name = "ProjectReference", Include = reference.Path, Watch = watch }); } - public TemporaryCSharpProject WithDefaultGlobs() - { - _items.Add(DefaultGlobs); - return this; - } - public TemporaryDirectory Dir() => _directory; public void Create() @@ -117,6 +103,7 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests public string Name { get; set; } public string Include { get; set; } public string Exclude { get; set; } + public string Update { get; set; } public string Remove { get; set; } public bool Watch { get; set; } = true; public string Condition { get; set; } @@ -128,4 +115,4 @@ namespace Microsoft.DotNet.Watcher.Tools.Tests public string Value { get; set; } } } -} \ No newline at end of file +} 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 59300c6a2f..9a9dc14b24 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,9 +1,9 @@ - + - netcoreapp1.0 + netcoreapp1.1 @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj b/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj index 0e2d61d78e..0c151d0a68 100644 --- a/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj +++ b/test/Microsoft.Extensions.Tools.Tests/Microsoft.Extensions.Tools.Tests.csproj @@ -1,9 +1,9 @@ - + - netcoreapp1.0 + netcoreapp1.1 @@ -16,4 +16,4 @@ - \ No newline at end of file + diff --git a/version.props b/version.props index bd4d4dc76f..e143c25f8e 100644 --- a/version.props +++ b/version.props @@ -4,4 +4,4 @@ 1.0.1 alpha - \ No newline at end of file +