33 lines
910 B
C#
33 lines
910 B
C#
using MsbuildAnalyzer.Models;
|
|
|
|
namespace MsbuildAnalyzer.Utilities;
|
|
|
|
/// <summary>
|
|
/// Watch target creation methods for TargetBuilder.
|
|
/// </summary>
|
|
public static partial class TargetBuilder
|
|
{
|
|
private static void AddWatchTarget(
|
|
Dictionary<string, Target> targets,
|
|
string fileName,
|
|
PluginOptions options)
|
|
{
|
|
targets[options.WatchTargetName] = new Target
|
|
{
|
|
Command = "dotnet watch",
|
|
Options = new TargetOptions
|
|
{
|
|
Cwd = "{projectRoot}"
|
|
},
|
|
DependsOn = [options.RestoreTargetName],
|
|
Cache = false,
|
|
Continuous = true,
|
|
Metadata = new TargetMetadata
|
|
{
|
|
Description = "Watch for changes and rebuild/rerun the .NET project",
|
|
Technologies = ProjectUtilities.GetTechnologies(fileName)
|
|
}
|
|
};
|
|
}
|
|
}
|