From 261b27b70027871143540af10a5cba57ce07ff97 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 29 Dec 2017 08:41:21 -0800 Subject: [PATCH] Port CLI tools to be dotnet global tools - Rename package IDs to dotnet-watch, dotnet-user-secrets, and dotnet-sql-cache - Change packaging layout to support dotnet-install-tool - Change package metadata to DotnetTool - Drop support for DotNetCliToolReference (those will continue to be available under previous package ID's) - Rename project files and folders --- .gitignore | 1 + DotNetTools.sln | 14 ++--- NuGetPackageVerifier.json | 51 +++++++++++++++---- README.md | 39 +++++++------- build/VSIX.targets | 4 +- .../LaunchAnyCommand/LaunchAnyCommand.csproj | 2 - .../dotnet-watch/LaunchAnyCommand/README.md | 1 - samples/dotnet-watch/README.md | 2 +- .../WatchJavascriptFiles/README.md | 1 - .../WatchJavascriptFiles.csproj | 1 - .../WatchMultipleProjects/README.md | 3 +- .../WatchMultipleProjects/watch.csproj | 2 - src/Directory.Build.props | 9 ++++ src/Directory.Build.targets | 6 +++ src/DotnetTool.props | 16 ++++++ .../prefercliruntime | 0 ...NetCore.DeveloperCertificates.XPlat.csproj | 3 ++ .../prefercliruntime | 0 ....Extensions.Caching.SqlConfig.Tools.csproj | 23 --------- .../prefercliruntime | 0 ...soft.Extensions.SecretManager.Tools.csproj | 25 --------- .../prefercliruntime | 0 src/PackGlobalTool.targets | 18 +++++++ src/dotnet-dev-certs/DotnetToolSettings.xml | 6 +++ .../Program.cs | 4 +- .../dotnet-dev-certs.csproj} | 10 +--- src/dotnet-dev-certs/dotnet-dev-certs.nuspec | 26 ++++++++++ src/dotnet-sql-cache/DotnetToolSettings.xml | 6 +++ .../Program.cs | 0 .../README.md | 8 ++- .../SqlQueries.cs | 2 +- src/dotnet-sql-cache/dotnet-sql-cache.csproj | 30 +++++++++++ src/dotnet-sql-cache/dotnet-sql-cache.nuspec | 26 ++++++++++ .../CommandLineOptions.cs | 8 +-- .../DotnetToolSettings.xml | 6 +++ .../Internal/ClearCommand.cs | 0 .../Internal/CommandContext.cs | 0 .../Internal/ICommand.cs | 0 .../Internal/ListCommand.cs | 0 .../Internal/MsBuildProjectFinder.cs | 0 .../Internal/ProjectIdResolver.cs | 5 +- .../ReadableJsonConfigurationSource.cs | 0 .../Internal/RemoveCommand.cs | 0 .../Internal/SecretsStore.cs | 0 .../Internal/SetCommand.cs | 0 .../Program.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../Properties/Resources.Designer.cs | 0 .../README.md | 8 ++- .../Resources.resx | 0 .../assets}/SecretManager.targets | 0 .../dotnet-user-secrets.csproj | 40 +++++++++++++++ .../dotnet-user-secrets.nuspec | 26 ++++++++++ .../CommandLineOptions.cs | 0 .../DotNetWatcher.cs | 0 src/dotnet-watch/DotnetToolSettings.xml | 6 +++ .../IFileSet.cs | 0 .../IFileSetFactory.cs | 0 .../Internal/FileSet.cs | 0 .../Internal/FileSetWatcher.cs | 0 .../Internal/FileWatcher.cs | 0 .../Internal/FileWatcher/DotnetFileWatcher.cs | 0 .../FileWatcher/FileWatcherFactory.cs | 4 +- .../FileWatcher/IFileSystemWatcher.cs | 0 .../FileWatcher/PollingFileWatcher.cs | 0 .../Internal/MsBuildFileSetFactory.cs | 5 +- .../Internal/MsBuildProjectFinder.cs | 0 .../Internal/OutputCapture.cs | 0 .../Internal/OutputSink.cs | 0 .../Internal/ProcessRunner.cs | 0 .../PrefixConsoleReporter.cs | 0 .../ProcessSpec.cs | 0 .../Program.cs | 0 .../Properties/AssemblyInfo.cs | 0 .../Properties/Resources.Designer.cs | 0 .../README.md | 8 ++- .../Resources.resx | 0 .../assets}/DotNetWatch.targets | 0 .../dotnet-watch.csproj} | 9 ++-- src/dotnet-watch/dotnet-watch.nuspec | 26 ++++++++++ ...icrosoft.DotNet.Watcher.Tools.Tests.csproj | 16 ------ ...xtensions.SecretManager.Tools.Tests.csproj | 16 ------ .../MsBuildProjectFinderTest.cs | 0 .../SecretManagerTests.cs | 0 .../SetCommandTest.cs | 0 .../TemporaryFileProvider.cs | 0 .../UserSecretsTestFixture.cs | 0 .../dotnet-user-secrets.Tests.csproj | 17 +++++++ .../AppWithDepsTests.cs | 0 .../AwaitableProcess.cs | 0 .../DotNetWatcherTests.cs | 0 .../FileWatcherTests.cs | 0 .../GlobbingAppTests.cs | 0 .../NoDepsAppTests.cs | 0 .../Scenario/ProjectToolScenario.cs | 37 ++------------ .../Scenario/WatchableApp.cs | 8 +-- .../AppWithDeps/AppWithDeps.csproj | 0 .../TestProjects/AppWithDeps/Program.cs | 0 .../TestProjects/Dependency/Dependency.csproj | 0 .../TestProjects/Dependency/Foo.cs | 0 .../GlobbingApp/GlobbingApp.csproj | 0 .../TestProjects/GlobbingApp/Program.cs | 0 .../TestProjects/GlobbingApp/exclude/Baz.cs | 0 .../TestProjects/GlobbingApp/include/Foo.cs | 0 .../KitchenSink/KitchenSink.csproj | 0 .../TestProjects/KitchenSink/Program.cs | 0 .../TestProjects/NoDepsApp/NoDepsApp.csproj | 0 .../TestProjects/NoDepsApp/Program.cs | 0 .../dotnet-watch.FunctionalTests.csproj} | 12 +++-- .../AssertEx.cs | 0 .../CommandLineOptionsTests.cs | 0 .../ConsoleReporterTests.cs | 0 .../MsBuildFileSetFactoryTest.cs | 0 .../ProgramTests.cs | 0 .../Utilities/TemporaryCSharpProject.cs | 0 .../Utilities/TemporaryDirectory.cs | 0 .../Utilities/TestProjectGraph.cs | 0 .../dotnet-watch.Tests.csproj | 16 ++++++ 118 files changed, 401 insertions(+), 211 deletions(-) create mode 100644 src/Directory.Build.targets create mode 100644 src/DotnetTool.props delete mode 100644 src/Microsoft.AspNetCore.DeveloperCertificates.Tools/prefercliruntime delete mode 100644 src/Microsoft.DotNet.Watcher.Tools/prefercliruntime delete mode 100644 src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj delete mode 100644 src/Microsoft.Extensions.Caching.SqlConfig.Tools/prefercliruntime delete mode 100644 src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj delete mode 100644 src/Microsoft.Extensions.SecretManager.Tools/prefercliruntime create mode 100644 src/PackGlobalTool.targets create mode 100644 src/dotnet-dev-certs/DotnetToolSettings.xml rename src/{Microsoft.AspNetCore.DeveloperCertificates.Tools => dotnet-dev-certs}/Program.cs (99%) rename src/{Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj => dotnet-dev-certs/dotnet-dev-certs.csproj} (82%) create mode 100644 src/dotnet-dev-certs/dotnet-dev-certs.nuspec create mode 100644 src/dotnet-sql-cache/DotnetToolSettings.xml rename src/{Microsoft.Extensions.Caching.SqlConfig.Tools => dotnet-sql-cache}/Program.cs (100%) rename src/{Microsoft.Extensions.Caching.SqlConfig.Tools => dotnet-sql-cache}/README.md (54%) rename src/{Microsoft.Extensions.Caching.SqlConfig.Tools => dotnet-sql-cache}/SqlQueries.cs (98%) create mode 100644 src/dotnet-sql-cache/dotnet-sql-cache.csproj create mode 100644 src/dotnet-sql-cache/dotnet-sql-cache.nuspec rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/CommandLineOptions.cs (94%) create mode 100644 src/dotnet-user-secrets/DotnetToolSettings.xml rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/ClearCommand.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/CommandContext.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/ICommand.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/ListCommand.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/MsBuildProjectFinder.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/ProjectIdResolver.cs (93%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/ReadableJsonConfigurationSource.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/RemoveCommand.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/SecretsStore.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Internal/SetCommand.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Program.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Properties/AssemblyInfo.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Properties/Resources.Designer.cs (100%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/README.md (51%) rename src/{Microsoft.Extensions.SecretManager.Tools => dotnet-user-secrets}/Resources.resx (100%) rename src/{Microsoft.Extensions.SecretManager.Tools/toolassets => dotnet-user-secrets/assets}/SecretManager.targets (100%) create mode 100644 src/dotnet-user-secrets/dotnet-user-secrets.csproj create mode 100644 src/dotnet-user-secrets/dotnet-user-secrets.nuspec rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/CommandLineOptions.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/DotNetWatcher.cs (100%) create mode 100644 src/dotnet-watch/DotnetToolSettings.xml rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/IFileSet.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/IFileSetFactory.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/FileSet.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/FileSetWatcher.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/FileWatcher.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/FileWatcher/DotnetFileWatcher.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/FileWatcher/FileWatcherFactory.cs (86%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/FileWatcher/IFileSystemWatcher.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/FileWatcher/PollingFileWatcher.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/MsBuildFileSetFactory.cs (96%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/MsBuildProjectFinder.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/OutputCapture.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/OutputSink.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Internal/ProcessRunner.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/PrefixConsoleReporter.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/ProcessSpec.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Program.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Properties/AssemblyInfo.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Properties/Resources.Designer.cs (100%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/README.md (94%) rename src/{Microsoft.DotNet.Watcher.Tools => dotnet-watch}/Resources.resx (100%) rename src/{Microsoft.DotNet.Watcher.Tools/toolassets => dotnet-watch/assets}/DotNetWatch.targets (100%) rename src/{Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj => dotnet-watch/dotnet-watch.csproj} (65%) create mode 100644 src/dotnet-watch/dotnet-watch.nuspec delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj delete mode 100644 test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj rename test/{Microsoft.Extensions.SecretManager.Tools.Tests => dotnet-user-secrets.Tests}/MsBuildProjectFinderTest.cs (100%) rename test/{Microsoft.Extensions.SecretManager.Tools.Tests => dotnet-user-secrets.Tests}/SecretManagerTests.cs (100%) rename test/{Microsoft.Extensions.SecretManager.Tools.Tests => dotnet-user-secrets.Tests}/SetCommandTest.cs (100%) rename test/{Microsoft.Extensions.SecretManager.Tools.Tests => dotnet-user-secrets.Tests}/TemporaryFileProvider.cs (100%) rename test/{Microsoft.Extensions.SecretManager.Tools.Tests => dotnet-user-secrets.Tests}/UserSecretsTestFixture.cs (100%) create mode 100644 test/dotnet-user-secrets.Tests/dotnet-user-secrets.Tests.csproj rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/AppWithDepsTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/AwaitableProcess.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/DotNetWatcherTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/FileWatcherTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/GlobbingAppTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/NoDepsAppTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/Scenario/ProjectToolScenario.cs (80%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/Scenario/WatchableApp.cs (96%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/AppWithDeps/AppWithDeps.csproj (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/AppWithDeps/Program.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/Dependency/Dependency.csproj (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/Dependency/Foo.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/GlobbingApp/GlobbingApp.csproj (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/GlobbingApp/Program.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/GlobbingApp/exclude/Baz.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/GlobbingApp/include/Foo.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/KitchenSink/KitchenSink.csproj (100%) mode change 100755 => 100644 rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/KitchenSink/Program.cs (100%) mode change 100755 => 100644 rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/NoDepsApp/NoDepsApp.csproj (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests => dotnet-watch.FunctionalTests}/TestProjects/NoDepsApp/Program.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj => dotnet-watch.FunctionalTests/dotnet-watch.FunctionalTests.csproj} (66%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/AssertEx.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/CommandLineOptionsTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/ConsoleReporterTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/MsBuildFileSetFactoryTest.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/ProgramTests.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/Utilities/TemporaryCSharpProject.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/Utilities/TemporaryDirectory.cs (100%) rename test/{Microsoft.DotNet.Watcher.Tools.Tests => dotnet-watch.Tests}/Utilities/TestProjectGraph.cs (100%) create mode 100644 test/dotnet-watch.Tests/dotnet-watch.Tests.csproj diff --git a/.gitignore b/.gitignore index 591bacd6e1..ddc5e01720 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ testWorkDir/ .idea/ .dotnet/ global.json +*.binlog diff --git a/DotNetTools.sln b/DotNetTools.sln index 302f0e2f5d..82fefe40d0 100644 --- a/DotNetTools.sln +++ b/DotNetTools.sln @@ -7,7 +7,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{66517987-2A5 src\Directory.Build.props = src\Directory.Build.props EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Watcher.Tools", "src\Microsoft.DotNet.Watcher.Tools\Microsoft.DotNet.Watcher.Tools.csproj", "{8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch", "src\dotnet-watch\dotnet-watch.csproj", "{8A8CEABC-AC47-43FF-A5DF-69224F7E1F46}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8321E0D1-9A47-4D2F-AED8-3AE636D44E35}" ProjectSection(SolutionItems) = preProject @@ -36,17 +36,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F5B382BC-2 test\Directory.Build.props = test\Directory.Build.props EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Watcher.Tools.FunctionalTests", "test\Microsoft.DotNet.Watcher.Tools.FunctionalTests\Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj", "{16BADE2F-1184-4518-8A70-B68A19D0805B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch.FunctionalTests", "test\dotnet-watch.FunctionalTests\dotnet-watch.FunctionalTests.csproj", "{16BADE2F-1184-4518-8A70-B68A19D0805B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.SecretManager.Tools", "src\Microsoft.Extensions.SecretManager.Tools\Microsoft.Extensions.SecretManager.Tools.csproj", "{8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-secrets", "src\dotnet-user-secrets\dotnet-user-secrets.csproj", "{8730E848-CA0F-4E0A-9A2F-BC22AD0B2C4E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.SecretManager.Tools.Tests", "test\Microsoft.Extensions.SecretManager.Tools.Tests\Microsoft.Extensions.SecretManager.Tools.Tests.csproj", "{7B331122-83B1-4F08-A119-DC846959844C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-user-secrets.Tests", "test\dotnet-user-secrets.Tests\dotnet-user-secrets.Tests.csproj", "{7B331122-83B1-4F08-A119-DC846959844C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.Watcher.Tools.Tests", "test\Microsoft.DotNet.Watcher.Tools.Tests\Microsoft.DotNet.Watcher.Tools.Tests.csproj", "{8A2E6961-6B12-4A8E-8215-3E7301D52EAC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-watch.Tests", "test\dotnet-watch.Tests\dotnet-watch.Tests.csproj", "{8A2E6961-6B12-4A8E-8215-3E7301D52EAC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Caching.SqlConfig.Tools", "src\Microsoft.Extensions.Caching.SqlConfig.Tools\Microsoft.Extensions.Caching.SqlConfig.Tools.csproj", "{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-sql-cache", "src\dotnet-sql-cache\dotnet-sql-cache.csproj", "{53F3B53D-303A-4DAA-9C38-4F55195FA5B9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.DeveloperCertificates.Tools", "src\Microsoft.AspNetCore.DeveloperCertificates.Tools\Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj", "{4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-dev-certs", "src\dotnet-dev-certs\dotnet-dev-certs.csproj", "{4FED5119-EE5C-4753-88A4-D61BDEB4D6C8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.SecretManager", "tooling\Microsoft.VisualStudio.SecretManager\Microsoft.VisualStudio.SecretManager.csproj", "{5E117F2E-7152-447F-BF47-59F759EEF3A7}" EndProject diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index 6979dfba80..171ae87771 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -4,24 +4,55 @@ "AdxVerificationCompositeRule" ], "packages": { - "Microsoft.DotNet.Watcher.Tools": { + "dotnet-watch": { "packageTypes": [ - "DotnetCliTool" + "DotnetTool" ] }, - "Microsoft.Extensions.Caching.SqlConfig.Tools": { + "dotnet-sql-cache": { "packageTypes": [ - "DotnetCliTool" - ] + "DotnetTool" + ], + "Exclusions": { + "WRONG_PUBLICKEYTOKEN": { + "tools/netcoreapp2.1/any/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg.", + "tools/netcoreapp2.1/any/System.Text.Encoding.CodePages.dll": "Assembly is built by another project but bundled in our nupkg.", + "tools/netcoreapp2.1/any/runtimes/unix/lib/netstandard2.0/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg.", + "tools/netcoreapp2.1/any/runtimes/win/lib/netcoreapp2.0/System.Text.Encoding.CodePages.dll": "Assembly is built by another project but bundled in our nupkg.", + "tools/netcoreapp2.1/any/runtimes/win/lib/netstandard2.0/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg." + }, + "ASSEMBLY_INFORMATIONAL_VERSION_MISMATCH": { + "tools/netcoreapp2.1/any/System.Data.SqlClient.dll": "Assembly is built by another project but bundled in our nupkg." + } + } }, - "Microsoft.Extensions.SecretManager.Tools": { + "dotnet-user-secrets": { "packageTypes": [ - "DotnetCliTool" - ] + "DotnetTool" + ], + "Exclusions": { + "NEUTRAL_RESOURCES_LANGUAGE": { + "tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg.", + "tools/netcoreapp2.1/any/System.Runtime.CompilerServices.Unsafe.dll": "Assembly is built by another project but bundled in our nupkg." + }, + "SERVICING_ATTRIBUTE": { + "tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg." + }, + "VERSION_INFORMATIONALVERSION": { + "tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg." + }, + "WRONG_PUBLICKEYTOKEN": { + "tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg.", + "tools/netcoreapp2.1/any/System.Runtime.CompilerServices.Unsafe.dll": "Assembly is built by another project but bundled in our nupkg." + }, + "ASSEMBLY_INFORMATIONAL_VERSION_MISMATCH": { + "tools/netcoreapp2.1/any/Newtonsoft.Json.dll": "Assembly is built by another project but bundled in our nupkg." + } + } }, - "Microsoft.AspNetCore.DeveloperCertificates.Tools": { + "dotnet-dev-certs": { "packageTypes": [ - "DotnetCliTool" + "DotnetTool" ] }, "Microsoft.AspNetCore.DeveloperCertificates.XPlat": { diff --git a/README.md b/README.md index c007157a78..111174914c 100644 --- a/README.md +++ b/README.md @@ -10,33 +10,36 @@ This project is part of ASP.NET Core. You can find samples, documentation and ge The repository contains command-line tools for the .NET Core CLI. Follow the links below for more details on each tool. - - [dotnet-watch](src/Microsoft.DotNet.Watcher.Tools/) (Microsoft.DotNet.Watcher.Tools) - - [dotnet-user-secrets](src/Microsoft.Extensions.SecretManager.Tools/) (Microsoft.Extensions.SecretManager.Tools) - - [dotnet-sql-cache](src/Microsoft.Extensions.Caching.SqlConfig.Tools/) (Microsoft.Extensions.Caching.SqlConfig.Tools) + - [dotnet-watch](src/dotnet-watch/) + - [dotnet-user-secrets](src/dotnet-user-secrets/) + - [dotnet-sql-cache](src/dotnet-sql-cache/) (dotnet-sql-cache) + - [dotnet-dev-certs](src/dotnet-dev-certs/) (dotnet-dev-certs) ## How to Install -Install tools by editing your \*.csproj file and adding a `DotNetCliToolReference` with the package name and version. +Install tools using the .NET Core command-line. + +``` +dotnet install tool dotnet-watch +dotnet install tool dotnet-user-secrets +dotnet install tool dotnet-dev-certs +dotnet install tool dotnet-sql-cache -```xml - - - - - ``` -Then, from command line, change directories to your project and run the following commands: +## Usage + +The command line tools can be invoked as a new verb hanging off `dotnet`. ```sh -# Location of MyProject.csproj which includes DotNetCliToolReference's -cd C:\Source\MyProject\ - -# Download tools into the project -dotnet restore - -# Execute tools dotnet watch dotnet user-secrets dotnet sql-cache +dotnet dev-certs +``` + +Add `--help` to see more details. For example, + +``` +dotnet watch --help ``` diff --git a/build/VSIX.targets b/build/VSIX.targets index eade7e4414..83ab88c4f6 100644 --- a/build/VSIX.targets +++ b/build/VSIX.targets @@ -1,4 +1,4 @@ - + true $(RestoreDependsOn);RestoreVSIX @@ -32,7 +32,7 @@ $(VSIXName) - + diff --git a/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj b/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj index 96438bfa81..1dc6efedd6 100644 --- a/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj +++ b/samples/dotnet-watch/LaunchAnyCommand/LaunchAnyCommand.csproj @@ -4,8 +4,6 @@ - - diff --git a/samples/dotnet-watch/LaunchAnyCommand/README.md b/samples/dotnet-watch/LaunchAnyCommand/README.md index 698d69225d..fa52f4073e 100644 --- a/samples/dotnet-watch/LaunchAnyCommand/README.md +++ b/samples/dotnet-watch/LaunchAnyCommand/README.md @@ -11,7 +11,6 @@ Launch any command with dotnet-watch Open a terminal to the directory containing this project. ``` -dotnet restore dotnet watch msbuild /t:RunMyNpmCommand ``` diff --git a/samples/dotnet-watch/README.md b/samples/dotnet-watch/README.md index 467a552f7e..5988ab77ba 100644 --- a/samples/dotnet-watch/README.md +++ b/samples/dotnet-watch/README.md @@ -2,4 +2,4 @@ dotnet-watch samples ==================== The samples in this folder show some ways to customize dotnet-watch. For full details on -available settings and configuration, see the [README for the Microsoft.DotNet.Watcher.Tools](../../src/Microsoft.DotNet.Watcher.Tools/README.md) project. +available settings and configuration, see the [README for the dotnet-watch](../../src/dotnet-watch/README.md) project. diff --git a/samples/dotnet-watch/WatchJavascriptFiles/README.md b/samples/dotnet-watch/WatchJavascriptFiles/README.md index dc98940cd7..3b0a148cd0 100644 --- a/samples/dotnet-watch/WatchJavascriptFiles/README.md +++ b/samples/dotnet-watch/WatchJavascriptFiles/README.md @@ -10,7 +10,6 @@ Install .NET Core command line. Open a terminal to the directory containing this project. ``` -dotnet restore dotnet watch run ``` diff --git a/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj b/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj index 65fd51d8d7..008b0322e6 100755 --- a/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj +++ b/samples/dotnet-watch/WatchJavascriptFiles/WatchJavascriptFiles.csproj @@ -11,7 +11,6 @@ - diff --git a/samples/dotnet-watch/WatchMultipleProjects/README.md b/samples/dotnet-watch/WatchMultipleProjects/README.md index 2c01233d36..46d7a7904c 100644 --- a/samples/dotnet-watch/WatchMultipleProjects/README.md +++ b/samples/dotnet-watch/WatchMultipleProjects/README.md @@ -10,8 +10,7 @@ Install .NET Core command line. Open a terminal to the directory containing this project. ``` -dotnet restore watch.proj -dotnet watch msbuild watch.proj /t:TestAndRun +dotnet watch msbuild /t:TestAndRun ``` The "TestAndRun" target in watch.proj will execute "dotnet test" on Test.csproj and then launch the website by calling "dotnet run" on Web.csproj. diff --git a/samples/dotnet-watch/WatchMultipleProjects/watch.csproj b/samples/dotnet-watch/WatchMultipleProjects/watch.csproj index b0ab41a539..d890295d39 100644 --- a/samples/dotnet-watch/WatchMultipleProjects/watch.csproj +++ b/samples/dotnet-watch/WatchMultipleProjects/watch.csproj @@ -5,8 +5,6 @@ - - diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 4b89a431e7..7129734857 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,6 +1,15 @@ + + + false + + + false + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 0000000000..6d04f45f89 --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/DotnetTool.props b/src/DotnetTool.props new file mode 100644 index 0000000000..04fc17a28b --- /dev/null +++ b/src/DotnetTool.props @@ -0,0 +1,16 @@ + + + $(MSBuildProjectDirectory)\$(MSBuildProjectName).nuspec + + true + + ship + Microsoft + false + false + + + + + + diff --git a/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/prefercliruntime b/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/prefercliruntime deleted file mode 100644 index e69de29bb2..0000000000 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 81c90a297c..a8e6fe928a 100644 --- a/src/Microsoft.AspNetCore.DeveloperCertificates.XPlat/Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj +++ b/src/Microsoft.AspNetCore.DeveloperCertificates.XPlat/Microsoft.AspNetCore.DeveloperCertificates.XPlat.csproj @@ -5,6 +5,9 @@ Package for the CLI first run experience. $(DefineConstants);XPLAT aspnet;cli + + shipoob + Microsoft diff --git a/src/Microsoft.DotNet.Watcher.Tools/prefercliruntime b/src/Microsoft.DotNet.Watcher.Tools/prefercliruntime deleted file mode 100644 index e69de29bb2..0000000000 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 deleted file mode 100644 index d3ce82febe..0000000000 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Microsoft.Extensions.Caching.SqlConfig.Tools.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - netcoreapp2.1 - dotnet-sql-cache - exe - Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching. - Microsoft.Extensions.Caching.SqlConfig.Tools - cache;distributedcache;sqlserver - DotnetCliTool - - - - - - - - - - - - - diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/prefercliruntime b/src/Microsoft.Extensions.Caching.SqlConfig.Tools/prefercliruntime deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj b/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj deleted file mode 100644 index ef8adb296f..0000000000 --- a/src/Microsoft.Extensions.SecretManager.Tools/Microsoft.Extensions.SecretManager.Tools.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - netcoreapp2.1 - dotnet-user-secrets - exe - Command line tool to manage user secrets for Microsoft.Extensions.Configuration. - Microsoft.Extensions.SecretManager.Tools - configuration;secrets;usersecrets - DotnetCliTool - false - - - - - - - - - - - - - - diff --git a/src/Microsoft.Extensions.SecretManager.Tools/prefercliruntime b/src/Microsoft.Extensions.SecretManager.Tools/prefercliruntime deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/PackGlobalTool.targets b/src/PackGlobalTool.targets new file mode 100644 index 0000000000..5f498664c8 --- /dev/null +++ b/src/PackGlobalTool.targets @@ -0,0 +1,18 @@ + + + + + publishDir=$(PublishDir); + version=$(PackageVersion); + licenseUrl=$(PackageLicenseUrl); + projectUrl=$(PackageProjectUrl); + iconUrl=$(PackageIconUrl); + serviceable=$(Serviceable); + copyright=$(Copyright); + description=$(Description); + repositoryUrl=$(RepositoryUrl); + targetframework=$(TargetFramework); + + + + diff --git a/src/dotnet-dev-certs/DotnetToolSettings.xml b/src/dotnet-dev-certs/DotnetToolSettings.xml new file mode 100644 index 0000000000..dbc7a5b6d9 --- /dev/null +++ b/src/dotnet-dev-certs/DotnetToolSettings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Program.cs b/src/dotnet-dev-certs/Program.cs similarity index 99% rename from src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Program.cs rename to src/dotnet-dev-certs/Program.cs index 7fbd5993cf..d1d5cfabaf 100644 --- a/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Program.cs +++ b/src/dotnet-dev-certs/Program.cs @@ -12,7 +12,7 @@ using Microsoft.Extensions.Tools.Internal; namespace Microsoft.AspNetCore.DeveloperCertificates.Tools { - class Program + internal class Program { private const int CriticalError = -1; private const int Success = 0; @@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.DeveloperCertificates.Tools { var app = new CommandLineApplication { - Name = "dotnet-developercertificates" + Name = "dotnet-dev-certs" }; app.Command("https", c => diff --git a/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj b/src/dotnet-dev-certs/dotnet-dev-certs.csproj similarity index 82% rename from src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj rename to src/dotnet-dev-certs/dotnet-dev-certs.csproj index 53cc86f701..8c4d039c02 100644 --- a/src/Microsoft.AspNetCore.DeveloperCertificates.Tools/Microsoft.AspNetCore.DeveloperCertificates.Tools.csproj +++ b/src/dotnet-dev-certs/dotnet-dev-certs.csproj @@ -2,12 +2,10 @@ netcoreapp2.1 - dotnet-dev-certs exe Command line tool to generate certificates used in ASP.NET Core during development. - Microsoft.AspNetCore.DeveloperCertificates.Tools - dotnet;developercertificates - DotnetCliTool + DotnetTool + Microsoft.AspNetCore.DeveloperCertificates.Tools @@ -22,10 +20,6 @@ - - - - diff --git a/src/dotnet-dev-certs/dotnet-dev-certs.nuspec b/src/dotnet-dev-certs/dotnet-dev-certs.nuspec new file mode 100644 index 0000000000..7c063e6e29 --- /dev/null +++ b/src/dotnet-dev-certs/dotnet-dev-certs.nuspec @@ -0,0 +1,26 @@ + + + + dotnet-dev-certs + dotnet developercertificates + $version$ + Microsoft + Microsoft + $licenseUrl$ + $projectUrl$ + $iconUrl$ + $description$ + $copyright$ + true + $serviceable$ + + + + + + + + + + + diff --git a/src/dotnet-sql-cache/DotnetToolSettings.xml b/src/dotnet-sql-cache/DotnetToolSettings.xml new file mode 100644 index 0000000000..2619964f0e --- /dev/null +++ b/src/dotnet-sql-cache/DotnetToolSettings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/Program.cs b/src/dotnet-sql-cache/Program.cs similarity index 100% rename from src/Microsoft.Extensions.Caching.SqlConfig.Tools/Program.cs rename to src/dotnet-sql-cache/Program.cs diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/README.md b/src/dotnet-sql-cache/README.md similarity index 54% rename from src/Microsoft.Extensions.Caching.SqlConfig.Tools/README.md rename to src/dotnet-sql-cache/README.md index dae4ad333e..05f7153882 100644 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/README.md +++ b/src/dotnet-sql-cache/README.md @@ -5,12 +5,10 @@ dotnet-sql-cache ### How To Install -Install `Microsoft.Extensions.Caching.SqlConfig.Tools` as a `DotNetCliToolReference` to your project. +From the command-line, execute: -```xml - - - +``` +dotnet install tool dotnet-sql-cache ``` ### How To Use diff --git a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/SqlQueries.cs b/src/dotnet-sql-cache/SqlQueries.cs similarity index 98% rename from src/Microsoft.Extensions.Caching.SqlConfig.Tools/SqlQueries.cs rename to src/dotnet-sql-cache/SqlQueries.cs index c8ae6f8284..7b9c73a990 100644 --- a/src/Microsoft.Extensions.Caching.SqlConfig.Tools/SqlQueries.cs +++ b/src/dotnet-sql-cache/SqlQueries.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.Caching.SqlConfig.Tools internal class SqlQueries { private const string CreateTableFormat = "CREATE TABLE {0}(" + - // Maximum size of primary key column is 900 bytes (898 bytes from key + 2 additional bytes used by the + // Maximum size of primary key column is 900 bytes (898 bytes from key + 2 additional bytes used by the // Sql Server). In the case where the key is greater than 898 bytes, then it gets truncated. // - Add collation to the key column to make it case-sensitive "Id nvarchar(449) COLLATE SQL_Latin1_General_CP1_CS_AS NOT NULL, " + diff --git a/src/dotnet-sql-cache/dotnet-sql-cache.csproj b/src/dotnet-sql-cache/dotnet-sql-cache.csproj new file mode 100644 index 0000000000..1bd0904ab5 --- /dev/null +++ b/src/dotnet-sql-cache/dotnet-sql-cache.csproj @@ -0,0 +1,30 @@ + + + + netcoreapp2.1 + exe + Command line tool to create tables and indexes in a Microsoft SQL Server database for distributed caching. + DotnetTool + tools/$(TargetFramework)/any/ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/dotnet-sql-cache/dotnet-sql-cache.nuspec b/src/dotnet-sql-cache/dotnet-sql-cache.nuspec new file mode 100644 index 0000000000..3c198fc163 --- /dev/null +++ b/src/dotnet-sql-cache/dotnet-sql-cache.nuspec @@ -0,0 +1,26 @@ + + + + dotnet-sql-cache + cache distributedcache sqlserver + $version$ + Microsoft + Microsoft + $licenseUrl$ + $projectUrl$ + $iconUrl$ + $description$ + $copyright$ + true + $serviceable$ + + + + + + + + + + + diff --git a/src/Microsoft.Extensions.SecretManager.Tools/CommandLineOptions.cs b/src/dotnet-user-secrets/CommandLineOptions.cs similarity index 94% rename from src/Microsoft.Extensions.SecretManager.Tools/CommandLineOptions.cs rename to src/dotnet-user-secrets/CommandLineOptions.cs index ff888f9e8b..6ce543cc00 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/CommandLineOptions.cs +++ b/src/dotnet-user-secrets/CommandLineOptions.cs @@ -33,15 +33,15 @@ namespace Microsoft.Extensions.SecretManager.Tools var optionVerbose = app.VerboseOption(); - var optionProject = app.Option("-p|--project ", "Path to project, default is current directory", + var optionProject = app.Option("-p|--project ", "Path to project. Defaults to searching the current directory.", CommandOptionType.SingleValue, inherited: true); - var optionConfig = app.Option("-c|--configuration ", $"The project configuration to use. Defaults to 'Debug'", + var optionConfig = app.Option("-c|--configuration ", $"The project configuration to use. Defaults to 'Debug'.", CommandOptionType.SingleValue, inherited: true); // the escape hatch if project evaluation fails, or if users want to alter a secret store other than the one // in the current project - var optionId = app.Option("--id", "The user secret id to use.", + var optionId = app.Option("--id", "The user secret ID to use.", CommandOptionType.SingleValue, inherited: true); var options = new CommandLineOptions(); @@ -69,4 +69,4 @@ namespace Microsoft.Extensions.SecretManager.Tools return options; } } -} \ No newline at end of file +} diff --git a/src/dotnet-user-secrets/DotnetToolSettings.xml b/src/dotnet-user-secrets/DotnetToolSettings.xml new file mode 100644 index 0000000000..0de9f13c31 --- /dev/null +++ b/src/dotnet-user-secrets/DotnetToolSettings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/ClearCommand.cs b/src/dotnet-user-secrets/Internal/ClearCommand.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/ClearCommand.cs rename to src/dotnet-user-secrets/Internal/ClearCommand.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/CommandContext.cs b/src/dotnet-user-secrets/Internal/CommandContext.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/CommandContext.cs rename to src/dotnet-user-secrets/Internal/CommandContext.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/ICommand.cs b/src/dotnet-user-secrets/Internal/ICommand.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/ICommand.cs rename to src/dotnet-user-secrets/Internal/ICommand.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/ListCommand.cs b/src/dotnet-user-secrets/Internal/ListCommand.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/ListCommand.cs rename to src/dotnet-user-secrets/Internal/ListCommand.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/MsBuildProjectFinder.cs b/src/dotnet-user-secrets/Internal/MsBuildProjectFinder.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/MsBuildProjectFinder.cs rename to src/dotnet-user-secrets/Internal/MsBuildProjectFinder.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/ProjectIdResolver.cs b/src/dotnet-user-secrets/Internal/ProjectIdResolver.cs similarity index 93% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/ProjectIdResolver.cs rename to src/dotnet-user-secrets/Internal/ProjectIdResolver.cs index 66d08b008b..da5111ca51 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/Internal/ProjectIdResolver.cs +++ b/src/dotnet-user-secrets/Internal/ProjectIdResolver.cs @@ -91,11 +91,10 @@ namespace Microsoft.Extensions.SecretManager.Tools.Internal var assemblyDir = Path.GetDirectoryName(typeof(ProjectIdResolver).Assembly.Location); var searchPaths = new[] { + Path.Combine(AppContext.BaseDirectory, "assets"), + Path.Combine(assemblyDir, "assets"), AppContext.BaseDirectory, assemblyDir, - Path.Combine(assemblyDir, "../../toolassets"), // from nuget cache - Path.Combine(assemblyDir, "toolassets"), // from local build - Path.Combine(AppContext.BaseDirectory, "../../toolassets"), // relative to packaged deps.json }; var targetPath = searchPaths.Select(p => Path.Combine(p, "SecretManager.targets")).FirstOrDefault(File.Exists); diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/ReadableJsonConfigurationSource.cs b/src/dotnet-user-secrets/Internal/ReadableJsonConfigurationSource.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/ReadableJsonConfigurationSource.cs rename to src/dotnet-user-secrets/Internal/ReadableJsonConfigurationSource.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/RemoveCommand.cs b/src/dotnet-user-secrets/Internal/RemoveCommand.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/RemoveCommand.cs rename to src/dotnet-user-secrets/Internal/RemoveCommand.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/SecretsStore.cs b/src/dotnet-user-secrets/Internal/SecretsStore.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/SecretsStore.cs rename to src/dotnet-user-secrets/Internal/SecretsStore.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Internal/SetCommand.cs b/src/dotnet-user-secrets/Internal/SetCommand.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Internal/SetCommand.cs rename to src/dotnet-user-secrets/Internal/SetCommand.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Program.cs b/src/dotnet-user-secrets/Program.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Program.cs rename to src/dotnet-user-secrets/Program.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Properties/AssemblyInfo.cs b/src/dotnet-user-secrets/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Properties/AssemblyInfo.cs rename to src/dotnet-user-secrets/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Properties/Resources.Designer.cs b/src/dotnet-user-secrets/Properties/Resources.Designer.cs similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Properties/Resources.Designer.cs rename to src/dotnet-user-secrets/Properties/Resources.Designer.cs diff --git a/src/Microsoft.Extensions.SecretManager.Tools/README.md b/src/dotnet-user-secrets/README.md similarity index 51% rename from src/Microsoft.Extensions.SecretManager.Tools/README.md rename to src/dotnet-user-secrets/README.md index f23371dc30..33d9e0cae0 100644 --- a/src/Microsoft.Extensions.SecretManager.Tools/README.md +++ b/src/dotnet-user-secrets/README.md @@ -5,12 +5,10 @@ dotnet-user-secrets ### How To Install -Install `Microsoft.Extensions.SecretManager.Tools` as a `DotNetCliToolReference` to your project. +From the command-line, execute: -```xml - - - +``` +dotnet install tool dotnet-user-secrets ``` ### How To Use diff --git a/src/Microsoft.Extensions.SecretManager.Tools/Resources.resx b/src/dotnet-user-secrets/Resources.resx similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/Resources.resx rename to src/dotnet-user-secrets/Resources.resx diff --git a/src/Microsoft.Extensions.SecretManager.Tools/toolassets/SecretManager.targets b/src/dotnet-user-secrets/assets/SecretManager.targets similarity index 100% rename from src/Microsoft.Extensions.SecretManager.Tools/toolassets/SecretManager.targets rename to src/dotnet-user-secrets/assets/SecretManager.targets diff --git a/src/dotnet-user-secrets/dotnet-user-secrets.csproj b/src/dotnet-user-secrets/dotnet-user-secrets.csproj new file mode 100644 index 0000000000..d979f1a355 --- /dev/null +++ b/src/dotnet-user-secrets/dotnet-user-secrets.csproj @@ -0,0 +1,40 @@ + + + + netcoreapp2.1 + exe + Command line tool to manage user secrets for Microsoft.Extensions.Configuration. + DotnetTool + false + Microsoft.Extensions.SecretManager.Tools + tools/$(TargetFramework)/any/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/dotnet-user-secrets/dotnet-user-secrets.nuspec b/src/dotnet-user-secrets/dotnet-user-secrets.nuspec new file mode 100644 index 0000000000..145ec4233b --- /dev/null +++ b/src/dotnet-user-secrets/dotnet-user-secrets.nuspec @@ -0,0 +1,26 @@ + + + + dotnet-user-secrets + configuration secrets usersecrets + $version$ + Microsoft + Microsoft + $licenseUrl$ + $projectUrl$ + $iconUrl$ + $description$ + $copyright$ + true + $serviceable$ + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Watcher.Tools/CommandLineOptions.cs b/src/dotnet-watch/CommandLineOptions.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/CommandLineOptions.cs rename to src/dotnet-watch/CommandLineOptions.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/DotNetWatcher.cs b/src/dotnet-watch/DotNetWatcher.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/DotNetWatcher.cs rename to src/dotnet-watch/DotNetWatcher.cs diff --git a/src/dotnet-watch/DotnetToolSettings.xml b/src/dotnet-watch/DotnetToolSettings.xml new file mode 100644 index 0000000000..7e9a7f40d4 --- /dev/null +++ b/src/dotnet-watch/DotnetToolSettings.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Microsoft.DotNet.Watcher.Tools/IFileSet.cs b/src/dotnet-watch/IFileSet.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/IFileSet.cs rename to src/dotnet-watch/IFileSet.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/IFileSetFactory.cs b/src/dotnet-watch/IFileSetFactory.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/IFileSetFactory.cs rename to src/dotnet-watch/IFileSetFactory.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileSet.cs b/src/dotnet-watch/Internal/FileSet.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/FileSet.cs rename to src/dotnet-watch/Internal/FileSet.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileSetWatcher.cs b/src/dotnet-watch/Internal/FileSetWatcher.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/FileSetWatcher.cs rename to src/dotnet-watch/Internal/FileSetWatcher.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher.cs b/src/dotnet-watch/Internal/FileWatcher.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher.cs rename to src/dotnet-watch/Internal/FileWatcher.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/DotnetFileWatcher.cs b/src/dotnet-watch/Internal/FileWatcher/DotnetFileWatcher.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/DotnetFileWatcher.cs rename to src/dotnet-watch/Internal/FileWatcher/DotnetFileWatcher.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/FileWatcherFactory.cs b/src/dotnet-watch/Internal/FileWatcher/FileWatcherFactory.cs similarity index 86% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/FileWatcherFactory.cs rename to src/dotnet-watch/Internal/FileWatcher/FileWatcherFactory.cs index cbb1c12a74..9c91176ec1 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/FileWatcherFactory.cs +++ b/src/dotnet-watch/Internal/FileWatcher/FileWatcherFactory.cs @@ -12,8 +12,8 @@ namespace Microsoft.DotNet.Watcher.Internal public static IFileSystemWatcher CreateWatcher(string watchedDirectory, bool usePollingWatcher) { - return usePollingWatcher ? - new PollingFileWatcher(watchedDirectory) : + return usePollingWatcher ? + new PollingFileWatcher(watchedDirectory) : new DotnetFileWatcher(watchedDirectory) as IFileSystemWatcher; } } diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/IFileSystemWatcher.cs b/src/dotnet-watch/Internal/FileWatcher/IFileSystemWatcher.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/IFileSystemWatcher.cs rename to src/dotnet-watch/Internal/FileWatcher/IFileSystemWatcher.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/PollingFileWatcher.cs b/src/dotnet-watch/Internal/FileWatcher/PollingFileWatcher.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/FileWatcher/PollingFileWatcher.cs rename to src/dotnet-watch/Internal/FileWatcher/PollingFileWatcher.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/MsBuildFileSetFactory.cs b/src/dotnet-watch/Internal/MsBuildFileSetFactory.cs similarity index 96% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/MsBuildFileSetFactory.cs rename to src/dotnet-watch/Internal/MsBuildFileSetFactory.cs index 837881c907..3cdf453067 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Internal/MsBuildFileSetFactory.cs +++ b/src/dotnet-watch/Internal/MsBuildFileSetFactory.cs @@ -170,11 +170,10 @@ namespace Microsoft.DotNet.Watcher.Internal var assemblyDir = Path.GetDirectoryName(typeof(MsBuildFileSetFactory).Assembly.Location); var searchPaths = new[] { + Path.Combine(AppContext.BaseDirectory, "assets"), + Path.Combine(assemblyDir, "assets"), AppContext.BaseDirectory, assemblyDir, - Path.Combine(assemblyDir, "../../toolassets"), // from nuget cache - Path.Combine(assemblyDir, "toolassets"), // from local build - Path.Combine(AppContext.BaseDirectory, "../../toolassets"), // relative to packaged deps.json }; var targetPath = searchPaths.Select(p => Path.Combine(p, WatchTargetsFileName)).FirstOrDefault(File.Exists); diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/MsBuildProjectFinder.cs b/src/dotnet-watch/Internal/MsBuildProjectFinder.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/MsBuildProjectFinder.cs rename to src/dotnet-watch/Internal/MsBuildProjectFinder.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/OutputCapture.cs b/src/dotnet-watch/Internal/OutputCapture.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/OutputCapture.cs rename to src/dotnet-watch/Internal/OutputCapture.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/OutputSink.cs b/src/dotnet-watch/Internal/OutputSink.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/OutputSink.cs rename to src/dotnet-watch/Internal/OutputSink.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Internal/ProcessRunner.cs b/src/dotnet-watch/Internal/ProcessRunner.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Internal/ProcessRunner.cs rename to src/dotnet-watch/Internal/ProcessRunner.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/PrefixConsoleReporter.cs b/src/dotnet-watch/PrefixConsoleReporter.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/PrefixConsoleReporter.cs rename to src/dotnet-watch/PrefixConsoleReporter.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/ProcessSpec.cs b/src/dotnet-watch/ProcessSpec.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/ProcessSpec.cs rename to src/dotnet-watch/ProcessSpec.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Program.cs b/src/dotnet-watch/Program.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Program.cs rename to src/dotnet-watch/Program.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs b/src/dotnet-watch/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Properties/AssemblyInfo.cs rename to src/dotnet-watch/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/Properties/Resources.Designer.cs b/src/dotnet-watch/Properties/Resources.Designer.cs similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Properties/Resources.Designer.cs rename to src/dotnet-watch/Properties/Resources.Designer.cs diff --git a/src/Microsoft.DotNet.Watcher.Tools/README.md b/src/dotnet-watch/README.md similarity index 94% rename from src/Microsoft.DotNet.Watcher.Tools/README.md rename to src/dotnet-watch/README.md index dafbcde2e3..8fb0db78db 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/README.md +++ b/src/dotnet-watch/README.md @@ -4,12 +4,10 @@ dotnet-watch ### How To Install -Install `Microsoft.DotNet.Watcher.Tools` as a `DotNetCliToolReference` to your project. +From the command-line, execute: -```xml - - - +``` +dotnet install tool dotnet-watch ``` ### How To Use diff --git a/src/Microsoft.DotNet.Watcher.Tools/Resources.resx b/src/dotnet-watch/Resources.resx similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/Resources.resx rename to src/dotnet-watch/Resources.resx diff --git a/src/Microsoft.DotNet.Watcher.Tools/toolassets/DotNetWatch.targets b/src/dotnet-watch/assets/DotNetWatch.targets similarity index 100% rename from src/Microsoft.DotNet.Watcher.Tools/toolassets/DotNetWatch.targets rename to src/dotnet-watch/assets/DotNetWatch.targets diff --git a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj b/src/dotnet-watch/dotnet-watch.csproj similarity index 65% rename from src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj rename to src/dotnet-watch/dotnet-watch.csproj index 5c79f6f652..19db471fe7 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Microsoft.DotNet.Watcher.Tools.csproj +++ b/src/dotnet-watch/dotnet-watch.csproj @@ -2,18 +2,15 @@ netcoreapp2.1 - dotnet-watch exe Command line tool to watch for source file changes during development and restart the dotnet command. - Microsoft.DotNet.Watcher.Tools - dotnet;watch - DotnetCliTool + DotnetTool + Microsoft.DotNet.Watcher.Tools - - + diff --git a/src/dotnet-watch/dotnet-watch.nuspec b/src/dotnet-watch/dotnet-watch.nuspec new file mode 100644 index 0000000000..53c4447f94 --- /dev/null +++ b/src/dotnet-watch/dotnet-watch.nuspec @@ -0,0 +1,26 @@ + + + + dotnet-watch + dotnet watch + $version$ + Microsoft + Microsoft + $licenseUrl$ + $projectUrl$ + $iconUrl$ + $description$ + $copyright$ + true + $serviceable$ + + + + + + + + + + + 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 deleted file mode 100644 index 0ace1e9148..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netcoreapp2.1 - - - - - - - - - - - - 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 deleted file mode 100644 index cd5d68d140..0000000000 --- a/test/Microsoft.Extensions.SecretManager.Tools.Tests/Microsoft.Extensions.SecretManager.Tools.Tests.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netcoreapp2.1 - - - - - - - - - - - - diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/MsBuildProjectFinderTest.cs b/test/dotnet-user-secrets.Tests/MsBuildProjectFinderTest.cs similarity index 100% rename from test/Microsoft.Extensions.SecretManager.Tools.Tests/MsBuildProjectFinderTest.cs rename to test/dotnet-user-secrets.Tests/MsBuildProjectFinderTest.cs diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/SecretManagerTests.cs b/test/dotnet-user-secrets.Tests/SecretManagerTests.cs similarity index 100% rename from test/Microsoft.Extensions.SecretManager.Tools.Tests/SecretManagerTests.cs rename to test/dotnet-user-secrets.Tests/SecretManagerTests.cs diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/SetCommandTest.cs b/test/dotnet-user-secrets.Tests/SetCommandTest.cs similarity index 100% rename from test/Microsoft.Extensions.SecretManager.Tools.Tests/SetCommandTest.cs rename to test/dotnet-user-secrets.Tests/SetCommandTest.cs diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/TemporaryFileProvider.cs b/test/dotnet-user-secrets.Tests/TemporaryFileProvider.cs similarity index 100% rename from test/Microsoft.Extensions.SecretManager.Tools.Tests/TemporaryFileProvider.cs rename to test/dotnet-user-secrets.Tests/TemporaryFileProvider.cs diff --git a/test/Microsoft.Extensions.SecretManager.Tools.Tests/UserSecretsTestFixture.cs b/test/dotnet-user-secrets.Tests/UserSecretsTestFixture.cs similarity index 100% rename from test/Microsoft.Extensions.SecretManager.Tools.Tests/UserSecretsTestFixture.cs rename to test/dotnet-user-secrets.Tests/UserSecretsTestFixture.cs diff --git a/test/dotnet-user-secrets.Tests/dotnet-user-secrets.Tests.csproj b/test/dotnet-user-secrets.Tests/dotnet-user-secrets.Tests.csproj new file mode 100644 index 0000000000..360e9301cf --- /dev/null +++ b/test/dotnet-user-secrets.Tests/dotnet-user-secrets.Tests.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp2.1 + Microsoft.Extensions.SecretManager.Tools.Tests + + + + + + + + + + + + diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AppWithDepsTests.cs b/test/dotnet-watch.FunctionalTests/AppWithDepsTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AppWithDepsTests.cs rename to test/dotnet-watch.FunctionalTests/AppWithDepsTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AwaitableProcess.cs b/test/dotnet-watch.FunctionalTests/AwaitableProcess.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AwaitableProcess.cs rename to test/dotnet-watch.FunctionalTests/AwaitableProcess.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/DotNetWatcherTests.cs b/test/dotnet-watch.FunctionalTests/DotNetWatcherTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/DotNetWatcherTests.cs rename to test/dotnet-watch.FunctionalTests/DotNetWatcherTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/FileWatcherTests.cs b/test/dotnet-watch.FunctionalTests/FileWatcherTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/FileWatcherTests.cs rename to test/dotnet-watch.FunctionalTests/FileWatcherTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/GlobbingAppTests.cs b/test/dotnet-watch.FunctionalTests/GlobbingAppTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/GlobbingAppTests.cs rename to test/dotnet-watch.FunctionalTests/GlobbingAppTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/NoDepsAppTests.cs b/test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/NoDepsAppTests.cs rename to test/dotnet-watch.FunctionalTests/NoDepsAppTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs b/test/dotnet-watch.FunctionalTests/Scenario/ProjectToolScenario.cs similarity index 80% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs rename to test/dotnet-watch.FunctionalTests/Scenario/ProjectToolScenario.cs index e212b51086..dc90313fab 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/ProjectToolScenario.cs +++ b/test/dotnet-watch.FunctionalTests/Scenario/ProjectToolScenario.cs @@ -39,6 +39,8 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests public string WorkFolder { get; } + public string DotNetWatchPath { get; } = Path.Combine(AppContext.BaseDirectory, "tool", "dotnet-watch.dll"); + public void AddTestProjectFolder(string projectName) { var srcFolder = Path.Combine(TestProjectSourceRoot, projectName); @@ -150,39 +152,6 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests File.Copy(nugetConfigFilePath, tempNugetConfigFile); } - public IEnumerable GetDotnetWatchArguments() - { - // this launches a new .NET Core process using the runtime of the current test app - // and the version of dotnet-watch that this test app is compiled against - var thisAssembly = Path.GetFileNameWithoutExtension(GetType().GetTypeInfo().Assembly.Location); - - var args = new List - { - "exec", - "--depsfile", - Path.Combine(AppContext.BaseDirectory, thisAssembly + ".deps.json"), - "--runtimeconfig", - Path.Combine(AppContext.BaseDirectory, thisAssembly + ".runtimeconfig.json") - }; - - if (AppContext.GetData("FX_DEPS_FILE") is string currentFxVersion) - { - // This overrides the version of shared fx in the runtimeconfig.json file. - // Tests do this to ensure dotnet-watch is executing on the version of Microsoft.NETCore.App - // used by the current test project. The test project can target multiple version of - // netcoreapp1.x in order to ensure the tool runs when it is lifted to higher netcore versions - // due to inclusion of the 'prefercliruntime' file in our nupkg. - - var version = new FileInfo(currentFxVersion).Directory.Name; - args.Add("--fx-version"); - args.Add(version); - } - - args.Add(Path.Combine(AppContext.BaseDirectory, "dotnet-watch.dll")); - - return args; - } - private static string FindNugetConfig() { var currentDirPath = AppContext.BaseDirectory; @@ -216,4 +185,4 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } } } -} \ No newline at end of file +} diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/WatchableApp.cs b/test/dotnet-watch.FunctionalTests/Scenario/WatchableApp.cs similarity index 96% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/WatchableApp.cs rename to test/dotnet-watch.FunctionalTests/Scenario/WatchableApp.cs index d204d5159a..88c322b382 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Scenario/WatchableApp.cs +++ b/test/dotnet-watch.FunctionalTests/Scenario/WatchableApp.cs @@ -69,9 +69,11 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests throw new InvalidOperationException($"Call {nameof(PrepareAsync)} first"); } - var args = Scenario - .GetDotnetWatchArguments() - .Concat(arguments); + var args = new List + { + Scenario.DotNetWatchPath, + }; + args.AddRange(arguments); var spec = new ProcessSpec { diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj b/test/dotnet-watch.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj rename to test/dotnet-watch.FunctionalTests/TestProjects/AppWithDeps/AppWithDeps.csproj diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/Program.cs b/test/dotnet-watch.FunctionalTests/TestProjects/AppWithDeps/Program.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/AppWithDeps/Program.cs rename to test/dotnet-watch.FunctionalTests/TestProjects/AppWithDeps/Program.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj b/test/dotnet-watch.FunctionalTests/TestProjects/Dependency/Dependency.csproj similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Dependency.csproj rename to test/dotnet-watch.FunctionalTests/TestProjects/Dependency/Dependency.csproj diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Foo.cs b/test/dotnet-watch.FunctionalTests/TestProjects/Dependency/Foo.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/Dependency/Foo.cs rename to test/dotnet-watch.FunctionalTests/TestProjects/Dependency/Foo.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj b/test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj rename to test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/GlobbingApp.csproj diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/Program.cs b/test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/Program.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/Program.cs rename to test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/Program.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/exclude/Baz.cs b/test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/exclude/Baz.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/exclude/Baz.cs rename to test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/exclude/Baz.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/include/Foo.cs b/test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/include/Foo.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/GlobbingApp/include/Foo.cs rename to test/dotnet-watch.FunctionalTests/TestProjects/GlobbingApp/include/Foo.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj b/test/dotnet-watch.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj old mode 100755 new mode 100644 similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj rename to test/dotnet-watch.FunctionalTests/TestProjects/KitchenSink/KitchenSink.csproj diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/Program.cs b/test/dotnet-watch.FunctionalTests/TestProjects/KitchenSink/Program.cs old mode 100755 new mode 100644 similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/KitchenSink/Program.cs rename to test/dotnet-watch.FunctionalTests/TestProjects/KitchenSink/Program.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj b/test/dotnet-watch.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj rename to test/dotnet-watch.FunctionalTests/TestProjects/NoDepsApp/NoDepsApp.csproj diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/Program.cs b/test/dotnet-watch.FunctionalTests/TestProjects/NoDepsApp/Program.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/TestProjects/NoDepsApp/Program.cs rename to test/dotnet-watch.FunctionalTests/TestProjects/NoDepsApp/Program.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj b/test/dotnet-watch.FunctionalTests/dotnet-watch.FunctionalTests.csproj similarity index 66% rename from test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj rename to test/dotnet-watch.FunctionalTests/dotnet-watch.FunctionalTests.csproj index 06434ae064..04d8118bc1 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.csproj +++ b/test/dotnet-watch.FunctionalTests/dotnet-watch.FunctionalTests.csproj @@ -3,17 +3,17 @@ netcoreapp2.1 $(DefaultItemExcludes);TestProjects\**\* + Microsoft.DotNet.Watcher.Tools.FunctionalTests - - - + + @@ -25,4 +25,10 @@ + + + + diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/AssertEx.cs b/test/dotnet-watch.Tests/AssertEx.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/AssertEx.cs rename to test/dotnet-watch.Tests/AssertEx.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/CommandLineOptionsTests.cs b/test/dotnet-watch.Tests/CommandLineOptionsTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/CommandLineOptionsTests.cs rename to test/dotnet-watch.Tests/CommandLineOptionsTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/ConsoleReporterTests.cs b/test/dotnet-watch.Tests/ConsoleReporterTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/ConsoleReporterTests.cs rename to test/dotnet-watch.Tests/ConsoleReporterTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs b/test/dotnet-watch.Tests/MsBuildFileSetFactoryTest.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/MsBuildFileSetFactoryTest.cs rename to test/dotnet-watch.Tests/MsBuildFileSetFactoryTest.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/ProgramTests.cs b/test/dotnet-watch.Tests/ProgramTests.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/ProgramTests.cs rename to test/dotnet-watch.Tests/ProgramTests.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryCSharpProject.cs b/test/dotnet-watch.Tests/Utilities/TemporaryCSharpProject.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryCSharpProject.cs rename to test/dotnet-watch.Tests/Utilities/TemporaryCSharpProject.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryDirectory.cs b/test/dotnet-watch.Tests/Utilities/TemporaryDirectory.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TemporaryDirectory.cs rename to test/dotnet-watch.Tests/Utilities/TemporaryDirectory.cs diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TestProjectGraph.cs b/test/dotnet-watch.Tests/Utilities/TestProjectGraph.cs similarity index 100% rename from test/Microsoft.DotNet.Watcher.Tools.Tests/Utilities/TestProjectGraph.cs rename to test/dotnet-watch.Tests/Utilities/TestProjectGraph.cs diff --git a/test/dotnet-watch.Tests/dotnet-watch.Tests.csproj b/test/dotnet-watch.Tests/dotnet-watch.Tests.csproj new file mode 100644 index 0000000000..ce5349ad3e --- /dev/null +++ b/test/dotnet-watch.Tests/dotnet-watch.Tests.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp2.1 + Microsoft.DotNet.Watcher.Tools.Tests + + + + + + + + + + +