public LaunchBrowserFilter(DotNetWatchOptions dotNetWatchOptions)
        {
            _suppressLaunchBrowser  = dotNetWatchOptions.SuppressLaunchBrowser;
            _suppressBrowserRefresh = dotNetWatchOptions.SuppressBrowserRefresh;
            _runningInTest          = dotNetWatchOptions.RunningAsTest;

            _browserPath = Environment.GetEnvironmentVariable("DOTNET_WATCH_BROWSER_PATH");
        }
Пример #2
0
 public MsBuildFileSetFactory(
     IReporter reporter,
     DotNetWatchOptions dotNetWatchOptions,
     string projectFile,
     bool waitOnError,
     bool trace)
     : this(dotNetWatchOptions, new Muxer().MuxerPath, reporter, projectFile, new OutputSink(), waitOnError, trace)
 {
 }
Пример #3
0
 public MsBuildFileSetFactory(
     IReporter reporter,
     DotNetWatchOptions dotNetWatchOptions,
     string projectFile,
     bool waitOnError,
     bool trace)
     : this(reporter, dotNetWatchOptions, projectFile, new OutputSink(), trace)
 {
     _waitOnError = waitOnError;
 }
        public HotReloadDotNetWatcher(IReporter reporter, IFileSetFactory fileSetFactory, DotNetWatchOptions dotNetWatchOptions)
        {
            Ensure.NotNull(reporter, nameof(reporter));

            _reporter           = reporter;
            _processRunner      = new ProcessRunner(reporter);
            _dotNetWatchOptions = dotNetWatchOptions;

            _filters = new IWatchFilter[]
            {
                new MSBuildEvaluationFilter(fileSetFactory),
                new DotNetBuildFilter(_processRunner, _reporter),
                new LaunchBrowserFilter(_dotNetWatchOptions),
            };
        }
Пример #5
0
        public DotNetWatcher(IReporter reporter, IFileSetFactory fileSetFactory, DotNetWatchOptions dotNetWatchOptions)
        {
            Ensure.NotNull(reporter, nameof(reporter));

            _reporter           = reporter;
            _processRunner      = new ProcessRunner(reporter);
            _dotnetWatchOptions = dotNetWatchOptions;
            _staticFileHandler  = new StaticFileHandler(reporter);

            _filters = new IWatchFilter[]
            {
                new MSBuildEvaluationFilter(fileSetFactory),
                new NoRestoreFilter(),
                new LaunchBrowserFilter(dotNetWatchOptions),
            };
        }
Пример #6
0
        public HotReloadDotNetWatcher(IReporter reporter, IFileSetFactory fileSetFactory, DotNetWatchOptions dotNetWatchOptions, IConsole console)
        {
            Ensure.NotNull(reporter, nameof(reporter));

            _reporter           = reporter;
            _processRunner      = new ProcessRunner(reporter);
            _dotNetWatchOptions = dotNetWatchOptions;
            _console            = console;

            _filters = new IWatchFilter[]
            {
                new DotNetBuildFilter(fileSetFactory, _processRunner, _reporter),
                new LaunchBrowserFilter(dotNetWatchOptions),
                new BrowserRefreshFilter(dotNetWatchOptions, _reporter),
            };
            _rudeEditDialog = new(reporter, _console);
        }
Пример #7
0
        // output sink is for testing
        internal MsBuildFileSetFactory(IReporter reporter,
                                       DotNetWatchOptions dotNetWatchOptions,
                                       string projectFile,
                                       OutputSink outputSink,
                                       bool trace)
        {
            Ensure.NotNull(reporter, nameof(reporter));
            Ensure.NotNullOrEmpty(projectFile, nameof(projectFile));
            Ensure.NotNull(outputSink, nameof(outputSink));

            _reporter           = reporter;
            _dotNetWatchOptions = dotNetWatchOptions;
            _projectFile        = projectFile;
            _outputSink         = outputSink;
            _processRunner      = new ProcessRunner(reporter);
            _buildFlags         = InitializeArgs(FindTargetsFile(), trace);
        }
Пример #8
0
        public HotReloadDotNetWatcher(IReporter reporter, IRequester requester, IFileSetFactory fileSetFactory, DotNetWatchOptions dotNetWatchOptions, IConsole console, string workingDirectory)
        {
            Ensure.NotNull(reporter, nameof(reporter));
            Ensure.NotNull(requester, nameof(requester));
            Ensure.NotNullOrEmpty(workingDirectory, nameof(workingDirectory));

            _reporter           = reporter;
            _processRunner      = new ProcessRunner(reporter);
            _dotNetWatchOptions = dotNetWatchOptions;
            _console            = console;
            _workingDirectory   = workingDirectory;

            _filters = new IWatchFilter[]
            {
                new DotNetBuildFilter(fileSetFactory, _processRunner, _reporter),
                new LaunchBrowserFilter(dotNetWatchOptions),
                new BrowserRefreshFilter(dotNetWatchOptions, _reporter),
            };

            if (!dotNetWatchOptions.NonInteractive)
            {
                _rudeEditDialog = new(reporter, requester, _console);
            }
        }
Пример #9
0
 public BrowserRefreshFilter(DotNetWatchOptions dotNetWatchOptions, IReporter reporter)
 {
     _suppressBrowserRefresh = dotNetWatchOptions.SuppressBrowserRefresh;
     _reporter = reporter;
 }
Пример #10
0
        private Task <FileSet> GetFileSet(string projectPath)
        {
            DotNetWatchOptions options = GetWatchOptions();

            return(GetFileSet(new MsBuildFileSetFactory(options, _reporter, projectPath, new OutputSink(), waitOnError: false, trace: false)));
        }