From 63bbafdb1d79384ff3ec1c424147ff7fa2cf6401 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Tue, 24 May 2016 11:34:08 -0700 Subject: [PATCH] Simplify watcher arguments by passing everything to dotnet --- Microsoft.DotNet.Watcher.Tools.sln | 7 - README.md | 15 ++- makefile.shade | 15 +-- .../DotNetWatcher.cs | 33 +---- src/Microsoft.DotNet.Watcher.Tools/Program.cs | 121 +++--------------- .../AppWithDepsTests.cs | 2 +- .../GlobbingAppTests.cs | 2 +- ...DotNet.Watcher.Tools.FunctionalTests.xproj | 2 +- .../NoDepsAppTests.cs | 42 +----- .../ArgumentSeparatorTests.cs | 95 -------------- ...Microsoft.DotNet.Watcher.Tools.Tests.xproj | 19 --- .../project.json | 27 ---- test/TestApps/AppWithDeps/AppWithDeps.xproj | 3 +- test/TestApps/Dependency/Dependency.xproj | 3 +- test/TestApps/GlobbingApp/GlobbingApp.xproj | 3 +- test/TestApps/NoDepsApp/NoDepsApp.xproj | 3 +- 16 files changed, 49 insertions(+), 343 deletions(-) delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.Tests/ArgumentSeparatorTests.cs delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.xproj delete mode 100644 test/Microsoft.DotNet.Watcher.Tools.Tests/project.json diff --git a/Microsoft.DotNet.Watcher.Tools.sln b/Microsoft.DotNet.Watcher.Tools.sln index 08e32fa200..658ce28d54 100644 --- a/Microsoft.DotNet.Watcher.Tools.sln +++ b/Microsoft.DotNet.Watcher.Tools.sln @@ -29,8 +29,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AppWithDeps", "test\TestApp EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Dependency", "test\TestApps\Dependency\Dependency.xproj", "{2F48041A-F7D1-478F-9C38-D41F0F05E8CA}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.DotNet.Watcher.Tools.Tests", "test\Microsoft.DotNet.Watcher.Tools.Tests\Microsoft.DotNet.Watcher.Tools.Tests.xproj", "{2E2FE108-0EB7-48CE-BD52-147E90180090}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -65,10 +63,6 @@ Global {2F48041A-F7D1-478F-9C38-D41F0F05E8CA}.Debug|Any CPU.Build.0 = Debug|Any CPU {2F48041A-F7D1-478F-9C38-D41F0F05E8CA}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F48041A-F7D1-478F-9C38-D41F0F05E8CA}.Release|Any CPU.Build.0 = Release|Any CPU - {2E2FE108-0EB7-48CE-BD52-147E90180090}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E2FE108-0EB7-48CE-BD52-147E90180090}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E2FE108-0EB7-48CE-BD52-147E90180090}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E2FE108-0EB7-48CE-BD52-147E90180090}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -82,6 +76,5 @@ Global {2AB1A28B-2022-49EA-AF77-AC8A875915CC} = {2876B12E-5841-4792-85A8-2929AEE11885} {F7734E61-F510-41E0-AD15-301A64081CD1} = {2876B12E-5841-4792-85A8-2929AEE11885} {2F48041A-F7D1-478F-9C38-D41F0F05E8CA} = {2876B12E-5841-4792-85A8-2929AEE11885} - {2E2FE108-0EB7-48CE-BD52-147E90180090} = {F5B382BC-258F-46E1-AC3D-10E5CCD55134} EndGlobalSection EndGlobal diff --git a/README.md b/README.md index 41acfad989..9fe921f7aa 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,19 @@ Add `Microsoft.DotNet.Watcher.Tools` to the `tools` section of your `project.jso ### How To Use -```dotnet watch -- ``` + dotnet watch [dotnet arguments] -- `dotnet watch` (runs the application without arguments) -- `dotnet watch foo bar` (runs the application with the arguments `foo bar`) -- `dotnet watch --exit-on-change -- foo bar` (runs the application with the arguments `foo bar`. In addition, it passes `--exit-on-change` to the watcher). -- `dotnet watch --command test -- -parallel none` (runs `dotnet test` with the arguments `-parallel none`) +Add `watch` after `dotnet` in the command that you want to run: + +| What you want to run | Dotnet watch command | +| ---------------------------------------------- | -------------------------------------------------------- | +| dotnet run | dotnet **watch** run | +| dotnet run --arg1 value1 | dotnet **watch** run --arg1 value | +| dotnet run --framework net451 -- --arg1 value1 | dotnet **watch** run --framework net451 -- --arg1 value1 | +| dotnet test | dotnet **watch** test | AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/fxhto3omtehio3aj/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/dnx-watch/branch/dev) Travis: [![Travis](https://travis-ci.org/aspnet/dotnet-watch.svg?branch=dev)](https://travis-ci.org/aspnet/dotnet-watch) - This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/makefile.shade b/makefile.shade index c57a5ee034..861bab6a2e 100644 --- a/makefile.shade +++ b/makefile.shade @@ -1,8 +1,7 @@ - -var VERSION='0.1' -var FULL_VERSION='0.1' -var AUTHORS='Microsoft Open Technologies, Inc.' --BuildQuality = "preview1"; - -use-standard-lifecycle -k-standard-goals +var VERSION='0.1' +var FULL_VERSION='0.1' +var AUTHORS='Microsoft Open Technologies, Inc.' +-BuildQuality = "preview1"; + +use-standard-lifecycle +k-standard-goals \ No newline at end of file diff --git a/src/Microsoft.DotNet.Watcher.Core/DotNetWatcher.cs b/src/Microsoft.DotNet.Watcher.Core/DotNetWatcher.cs index 61b1cc586b..cdb5ba7483 100644 --- a/src/Microsoft.DotNet.Watcher.Core/DotNetWatcher.cs +++ b/src/Microsoft.DotNet.Watcher.Core/DotNetWatcher.cs @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.IO; using System.Threading; using System.Threading.Tasks; using Microsoft.DotNet.Watcher.Core.Internal; @@ -18,8 +19,6 @@ namespace Microsoft.DotNet.Watcher.Core private readonly ILogger _logger; - public bool ExitOnChange { get; set; } - public DotNetWatcher( Func fileWatcherFactory, Func processWatcherFactory, @@ -34,32 +33,23 @@ namespace Microsoft.DotNet.Watcher.Core _logger = _loggerFactory.CreateLogger(nameof(DotNetWatcher)); } - public async Task WatchAsync(string projectFile, string command, string[] dotnetArguments, string workingDir, CancellationToken cancellationToken) + public async Task WatchAsync(string projectFile, string[] dotnetArguments, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(projectFile)) { throw new ArgumentNullException(nameof(projectFile)); } - if (string.IsNullOrEmpty(command)) - { - throw new ArgumentNullException(nameof(command)); - } if (dotnetArguments == null) { throw new ArgumentNullException(nameof(dotnetArguments)); } - if (string.IsNullOrEmpty(workingDir)) - { - throw new ArgumentNullException(nameof(workingDir)); - } if (cancellationToken == null) { throw new ArgumentNullException(nameof(cancellationToken)); } - var fullDotnetArgs = new string[dotnetArguments.Length + 1]; - fullDotnetArgs[0] = command; - + // If any argument has spaces then quote it because we're going to convert everything + // to string for (var i = 0; i < dotnetArguments.Length; i++) { var arg = dotnetArguments[i]; @@ -72,12 +62,13 @@ namespace Microsoft.DotNet.Watcher.Core break; } } - fullDotnetArgs[i + 1] = arg; + dotnetArguments[i] = arg; } - dotnetArguments = fullDotnetArgs; var dotnetArgumentsAsString = string.Join(" ", dotnetArguments); + var workingDir = Path.GetDirectoryName(projectFile); + while (true) { await WaitForValidProjectJsonAsync(projectFile, cancellationToken); @@ -116,11 +107,6 @@ namespace Microsoft.DotNet.Watcher.Core _logger.LogError($"dotnet exit code: {dotnetExitCode}"); } - if (ExitOnChange) - { - break; - } - _logger.LogInformation("Waiting for a file to change before restarting dotnet..."); // Now wait for a file to change before restarting dotnet await WaitForProjectFileToChangeAsync(projectFile, cancellationToken); @@ -130,11 +116,6 @@ namespace Microsoft.DotNet.Watcher.Core // This is a file watcher task string changedFile = fileWatchingTask.Result; _logger.LogInformation($"File changed: {fileWatchingTask.Result}"); - - if (ExitOnChange) - { - break; - } } } } diff --git a/src/Microsoft.DotNet.Watcher.Tools/Program.cs b/src/Microsoft.DotNet.Watcher.Tools/Program.cs index 8ea1b8a2f0..d27c68e543 100644 --- a/src/Microsoft.DotNet.Watcher.Tools/Program.cs +++ b/src/Microsoft.DotNet.Watcher.Tools/Program.cs @@ -8,14 +8,11 @@ using System.Threading.Tasks; using Microsoft.DotNet.Watcher.Core; using Microsoft.Extensions.CommandLineUtils; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.PlatformAbstractions; namespace Microsoft.DotNet.Watcher.Tools { public class Program { - private const string AppArgumentSeparator = "--"; - private readonly ILoggerFactory _loggerFactory; public Program() @@ -35,120 +32,27 @@ namespace Microsoft.DotNet.Watcher.Tools ctrlCTokenSource.Cancel(); ev.Cancel = false; }; - - string[] watchArgs, appArgs; - SeparateWatchArguments(args, out watchArgs, out appArgs); - - return new Program().MainInternal(watchArgs, appArgs, ctrlCTokenSource.Token); + + return new Program().MainInternal(args, ctrlCTokenSource.Token); } } - // The argument separation rules are: if no "--" is encountered, all arguments are passed to the app being watched. - // Unless, the argument is "--help", in which case the help for the watcher is being invoked and everything else is discarded. - // To pass arguments to both the watcher and the app use "--" as separator. - // To pass "--help" to the app being watched, you must use "--": dotnet watch -- --help - internal static void SeparateWatchArguments(string[] args, out string[] watchArgs, out string[] appArgs) - { - if (args.Length == 0) - { - watchArgs = new string[0]; - appArgs = new string[0]; - return; - } - - // Special case "--help" - if (args[0].Equals("--help", StringComparison.OrdinalIgnoreCase) || - args[0].Equals("-h", StringComparison.OrdinalIgnoreCase) || - args[0].Equals("-?", StringComparison.OrdinalIgnoreCase)) - { - watchArgs = new string[] { args[0] }; - appArgs = new string[0]; - return; - } - - var separatorIndex = -1; - for (var i = 0; i < args.Length; i++) - { - if (string.Equals(args[i], AppArgumentSeparator, StringComparison.OrdinalIgnoreCase)) - { - separatorIndex = i; - break; - } - } - - if (separatorIndex == -1) - { - watchArgs = new string[0]; - appArgs = args; - } - else - { - watchArgs = new string[separatorIndex]; - Array.Copy(args, 0, watchArgs, 0, separatorIndex); - - var appArgsLength = args.Length - separatorIndex - 1; - appArgs = new string[appArgsLength]; - Array.Copy(args, separatorIndex + 1, appArgs, 0, appArgsLength); - } - } - - private int MainInternal(string[] watchArgs, string[] appArgs, CancellationToken cancellationToken) + private int MainInternal(string[] args, CancellationToken cancellationToken) { var app = new CommandLineApplication(); app.Name = "dotnet-watch"; app.FullName = "Microsoft dotnet File Watcher"; app.HelpOption("-?|-h|--help"); - - var commandArg = app.Option( - "--command ", - "Optional. The dotnet command to run. Default: 'run'.", - CommandOptionType.SingleValue); - - var workingDirArg = app.Option( - "--working-dir ", - "Optional. The working directory. Default: project's directory.", - CommandOptionType.SingleValue); - - var exitOnChangeArg = app.Option( - "--exit-on-change", - "Optional. The watcher will exit when a file change is detected instead of restarting the process. Default: not set.", - CommandOptionType.NoValue); - + app.OnExecute(() => { var projectToWatch = Path.Combine(Directory.GetCurrentDirectory(), ProjectModel.Project.FileName); - - var command = commandArg.Value(); - if (!commandArg.HasValue()) - { - // The default command is "run". In this case we always assume the arguments are passed to the application being run. - // If you want a different behaviour for run you need to use --command and pass the full arguments - // Run is special because it requires a "--" before the arguments being passed to the application, - // so the two command below are equivalent and resolve to "dotnet run -- --foo": - // 1. dotnet watch --foo - // 2. dotnet watch --command run -- -- --foo (yes, there are two "--") - if (appArgs.Length > 0) - { - var newAppArgs = new string[appArgs.Length + 1]; - newAppArgs[0] = AppArgumentSeparator; - appArgs.CopyTo(newAppArgs, 1); - appArgs = newAppArgs; - } - - command = "run"; - } - - var workingDir = workingDirArg.HasValue() ? - workingDirArg.Value() : - Path.GetDirectoryName(projectToWatch); - var watcher = DotNetWatcher.CreateDefault(_loggerFactory); - watcher.ExitOnChange = exitOnChangeArg.HasValue(); try { - watcher.WatchAsync(projectToWatch, command, appArgs, workingDir, cancellationToken).Wait(); + watcher.WatchAsync(projectToWatch, args, cancellationToken).Wait(); } catch (AggregateException ex) { @@ -158,11 +62,20 @@ namespace Microsoft.DotNet.Watcher.Tools } } - - return 1; + return 0; }); - return app.Execute(watchArgs); + if (args == null || + args.Length == 0 || + args[0].Equals("--help", StringComparison.OrdinalIgnoreCase) || + args[0].Equals("-h", StringComparison.OrdinalIgnoreCase) || + args[0].Equals("-?", StringComparison.OrdinalIgnoreCase)) + { + app.ShowHelp(); + return 1; + } + + return app.Execute(); } } } diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AppWithDepsTests.cs b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AppWithDepsTests.cs index 913c79abb2..da092e8463 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AppWithDepsTests.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/AppWithDepsTests.cs @@ -61,7 +61,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests // Wait for the process to start using (var wait = new WaitForFileToChange(StatusFile)) { - RunDotNetWatch(StatusFile, Path.Combine(_scenario.WorkFolder, AppWithDeps)); + RunDotNetWatch($"run {StatusFile}", Path.Combine(_scenario.WorkFolder, AppWithDeps)); wait.Wait(_defaultTimeout, expectedToChange: true, diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/GlobbingAppTests.cs b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/GlobbingAppTests.cs index 456d7a7ec0..0a8f48908d 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/GlobbingAppTests.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/GlobbingAppTests.cs @@ -185,7 +185,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests // Wait for the process to start using (var wait = new WaitForFileToChange(StartedFile)) { - RunDotNetWatch(StatusFile, Path.Combine(_scenario.WorkFolder, TestAppName)); + RunDotNetWatch($"run {StatusFile}", Path.Combine(_scenario.WorkFolder, TestAppName)); wait.Wait(_defaultTimeout, expectedToChange: true, diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj index 7fd8ef1ab9..317f69fb4a 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/Microsoft.DotNet.Watcher.Tools.FunctionalTests.xproj @@ -8,7 +8,7 @@ 16bade2f-1184-4518-8a70-b68a19d0805b ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + .\bin\ 2.0 diff --git a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/NoDepsAppTests.cs b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/NoDepsAppTests.cs index 5be7ff0b89..b87d54e6dc 100644 --- a/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/NoDepsAppTests.cs +++ b/test/Microsoft.DotNet.Watcher.Tools.FunctionalTests/NoDepsAppTests.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests // Wait for the process to start using (var wait = new WaitForFileToChange(scenario.StartedFile)) { - scenario.RunDotNetWatch($"{scenario.StatusFile} --no-exit"); + scenario.RunDotNetWatch($"run {scenario.StatusFile} --no-exit"); wait.Wait(_defaultTimeout, expectedToChange: true, @@ -59,7 +59,7 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests // Wait for the process to start using (var wait = new WaitForFileToChange(scenario.StartedFile)) { - scenario.RunDotNetWatch(scenario.StatusFile); + scenario.RunDotNetWatch($"run {scenario.StatusFile}"); wait.Wait(_defaultTimeout, expectedToChange: true, @@ -90,44 +90,6 @@ namespace Microsoft.DotNet.Watcher.Tools.FunctionalTests } } - - [Fact] - public void ExitOnChange() - { - using (var scenario = new NoDepsAppScenario()) - { - // Wait for the process to start - using (var wait = new WaitForFileToChange(scenario.StartedFile)) - { - scenario.RunDotNetWatch($"--exit-on-change -- {scenario.StatusFile} --no-exit"); - - wait.Wait(_defaultTimeout, - expectedToChange: true, - errorMessage: $"File not created: {scenario.StartedFile}"); - } - - // Change a file - var fileToChange = Path.Combine(scenario.TestAppFolder, "Program.cs"); - var programCs = File.ReadAllText(fileToChange); - File.WriteAllText(fileToChange, programCs); - - Waiters.WaitForProcessToStop( - scenario.WatcherProcess.Id, - _defaultTimeout, - expectedToStop: true, - errorMessage: "The watcher did not stop"); - - // Check that the first child process is no longer running - var ids = File.ReadAllLines(scenario.StatusFile); - var firstProcessId = int.Parse(ids[0]); - Waiters.WaitForProcessToStop( - firstProcessId, - TimeSpan.FromSeconds(1), - expectedToStop: true, - errorMessage: $"PID: {firstProcessId} is still alive"); - } - } - private class NoDepsAppScenario : DotNetWatchScenario { private const string TestAppName = "NoDepsApp"; diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/ArgumentSeparatorTests.cs b/test/Microsoft.DotNet.Watcher.Tools.Tests/ArgumentSeparatorTests.cs deleted file mode 100644 index a9178eb1ad..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/ArgumentSeparatorTests.cs +++ /dev/null @@ -1,95 +0,0 @@ -// 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 Xunit; - -namespace Microsoft.DotNet.Watcher.Tools.Tests -{ - public class ArgumentSeparatorTests - { - [Theory] - [InlineData(new string[0], - new string[0], - new string[0])] - [InlineData(new string[] { "--" }, - new string[0], - new string[0])] - [InlineData(new string[] { "--appArg1" }, - new string[0], - new string[] { "--appArg1" })] - [InlineData(new string[] { "--command", "test" }, - new string[0], - new string[] { "--command", "test" })] - [InlineData(new string[] { "--command", "test", "--" }, - new string[] { "--command", "test" }, - new string[0])] - [InlineData(new string[] { "--command", "test", "--", "--appArg1", "arg1Value" }, - new string[] { "--command", "test" }, - new string[] { "--appArg1", "arg1Value" })] - [InlineData(new string[] { "--", "--appArg1", "arg1Value" }, - new string[0], - new string[] { "--appArg1", "arg1Value" })] - [InlineData(new string[] { "--", "--" }, - new string[0], - new string[] { "--" })] - [InlineData(new string[] { "--", "--", "--" }, - new string[0], - new string[] { "--", "--" })] - [InlineData(new string[] { "--command", "run", "--", "--", "--appArg", "foo" }, - new string[] { "--command", "run" }, - new string[] { "--", "--appArg", "foo" })] - [InlineData(new string[] { "--command", "run", "--", "-f", "net451", "--", "--appArg", "foo" }, - new string[] { "--command", "run" }, - new string[] { "-f", "net451", "--", "--appArg", "foo" })] - public void SeparateWatchArguments(string[] args, string[] expectedWatchArgs, string[] expectedAppArgs) - { - SeparateWatchArgumentsTest(args, expectedWatchArgs, expectedAppArgs); - } - - [Theory] - // Help is special if it's the first argument - [InlineData(new string[] { "--help" }, - new string[] { "--help" }, - new string[0])] - [InlineData(new string[] { "-h" }, - new string[] { "-h" }, - new string[0])] - [InlineData(new string[] { "-?" }, - new string[] { "-?" }, - new string[0])] - [InlineData(new string[] { "--help", "--this-is-ignored" }, - new string[] { "--help" }, - new string[0])] - [InlineData(new string[] { "--help", "--", "--this-is-ignored" }, - new string[] { "--help" }, - new string[0])] - // But not otherwise - [InlineData(new string[] { "--", "--help" }, - new string[0], - new string[] { "--help" })] - [InlineData(new string[] { "--foo", "--help" }, - new string[0], - new string[] { "--foo", "--help" })] - [InlineData(new string[] { "--foo", "--help" }, - new string[0], - new string[] { "--foo", "--help" })] - [InlineData(new string[] { "--foo", "--", "--help" }, - new string[] { "--foo" }, - new string[] { "--help" })] - public void SeparateWatchArguments_Help(string[] args, string[] expectedWatchArgs, string[] expectedAppArgs) - { - SeparateWatchArgumentsTest(args, expectedWatchArgs, expectedAppArgs); - } - - private static void SeparateWatchArgumentsTest(string[] args, string[] expectedWatchArgs, string[] expectedAppArgs) - { - string[] actualWatchArgs; - string[] actualAppArgs; - - Program.SeparateWatchArguments(args, out actualWatchArgs, out actualAppArgs); - - Assert.Equal(expectedWatchArgs, actualWatchArgs); - Assert.Equal(expectedAppArgs, actualAppArgs); - } - } -} diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.xproj b/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.xproj deleted file mode 100644 index 2c2d6b6b34..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/Microsoft.DotNet.Watcher.Tools.Tests.xproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - 14.0.25123 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 2e2fe108-0eb7-48ce-bd52-147e90180090 - Microsoft.DotNet.Watcher.Tools.Tests - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ - - - - 2.0 - - - \ No newline at end of file diff --git a/test/Microsoft.DotNet.Watcher.Tools.Tests/project.json b/test/Microsoft.DotNet.Watcher.Tools.Tests/project.json deleted file mode 100644 index 44db712712..0000000000 --- a/test/Microsoft.DotNet.Watcher.Tools.Tests/project.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" - }, - "dependencies": { - "dotnet-test-xunit": "1.0.0-*", - "Microsoft.DotNet.Watcher.Tools": "1.0.0-*", - "NETStandard.Library": "1.5.0-*", - "xunit": "2.1.0" - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "portable-net451+win8", - "dnxcore50" - ], - "dependencies": { - "Microsoft.NETCore.App": { - "type": "platform", - "version": "1.0.0-*" - } - } - } - }, - "testRunner": "xunit" -} \ No newline at end of file diff --git a/test/TestApps/AppWithDeps/AppWithDeps.xproj b/test/TestApps/AppWithDeps/AppWithDeps.xproj index 289874a39b..42ff14fd34 100644 --- a/test/TestApps/AppWithDeps/AppWithDeps.xproj +++ b/test/TestApps/AppWithDeps/AppWithDeps.xproj @@ -9,9 +9,8 @@ f7734e61-f510-41e0-ad15-301a64081cd1 AppWithDeps ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\bin\$(MSBuildProjectName)\ + .\bin\ - 2.0 diff --git a/test/TestApps/Dependency/Dependency.xproj b/test/TestApps/Dependency/Dependency.xproj index d1edb4ad06..406bf0a295 100644 --- a/test/TestApps/Dependency/Dependency.xproj +++ b/test/TestApps/Dependency/Dependency.xproj @@ -9,9 +9,8 @@ 2f48041a-f7d1-478f-9c38-d41f0f05e8ca Dependency ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\bin\$(MSBuildProjectName)\ + .\bin\ - 2.0 diff --git a/test/TestApps/GlobbingApp/GlobbingApp.xproj b/test/TestApps/GlobbingApp/GlobbingApp.xproj index 791e441f8f..b170a846ad 100644 --- a/test/TestApps/GlobbingApp/GlobbingApp.xproj +++ b/test/TestApps/GlobbingApp/GlobbingApp.xproj @@ -9,9 +9,8 @@ 2ab1a28b-2022-49ea-af77-ac8a875915cc GlobbingApp ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\bin\$(MSBuildProjectName)\ + .\bin\ - 2.0 diff --git a/test/TestApps/NoDepsApp/NoDepsApp.xproj b/test/TestApps/NoDepsApp/NoDepsApp.xproj index 959a38dc0e..50d9989df2 100644 --- a/test/TestApps/NoDepsApp/NoDepsApp.xproj +++ b/test/TestApps/NoDepsApp/NoDepsApp.xproj @@ -9,9 +9,8 @@ 4f0d8a80-221f-4bcb-822e-44a0655f537e NoDepsApp ..\..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\..\artifacts\bin\$(MSBuildProjectName)\ + .\bin\ - 2.0