-
Notifications
You must be signed in to change notification settings - Fork 74
[dotnet-watch] Watching multiple projects #247
Comments
No plans at the moment. As a prerequisite for this, we would need support for global or solution-level CLI tools (NuGet/Home#1605 and https://github.com/dotnet/cli/issues/4427). However, the MSBuild version of dotnet-watch is much more extensible than the project.json version. You could implement yourself as an MSBuild file itself. Example: invoke <!-- watch.proj -->
<Project ToolsVersion="15.0">
<Target Name="WatchAndTest">
<ItemGroup>
<TestProjects Include="test\**\*.csproj"/>
</ItemGroup>
<MSBuild Targets="VSTest" Projects="@(TestProjects)" />
</Target>
<ItemGroup>
<Watch Include="**\*.cs" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0-msbuild2-final" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft.Common.targets"/>
</Project> For triage consideration: add the example above to documentation? |
That seems like it would work. Unfortunately, I am not quite ready to migrate these projects to using the msbuild version of tooling. That means I'm unable to test this at the moment. If you can confirm the process works I'd be happy to submit a PR adding it to the documentation. |
It works, but I think we'll hold off on adding to documentation for now. |
@bromanko You should be able to move to csproj based tooling since it RTM'd yesterday. |
That's my plan. I'll close this out. |
I finally got around to implementing this. It worked great. One improvement I added was modifying the
|
Both
dotnet build
anddotnet test
support glob patterns for multiple projects. For example, if I have atests
folder with two projects under it I am able to rundotnet test tests/**
and it will execute the tests for both projects. It appears thatwatch
only works when executing in a working directory with aproject.json
. Are there plans for glob pattern support or an ability to watch for changes across multiple projects?The text was updated successfully, but these errors were encountered: