Exemplo n.º 1
0
        public PowerShellTestContainerDiscoverer(
            ISolutionProvider solutionProvider,
            ILogger logger,
            ISolutionEventsListener solutionListener,
            ITestFilesUpdateWatcher testFilesUpdateWatcher,
            ITestFileAddRemoveListener testFilesAddRemoveListener)
        {
            _initialContainerSearch = true;
            _cachedContainers       = new List <ITestContainer>();
            _solutionProvider       = solutionProvider;
            _logger                     = logger;
            _solutionListener           = solutionListener;
            _testFilesUpdateWatcher     = testFilesUpdateWatcher;
            _testFilesAddRemoveListener = testFilesAddRemoveListener;

            logger.Log(MessageLevel.Diagnostic, "PowerShellTestContainerDiscoverer Constructor Entering");

            _testFilesAddRemoveListener.TestFileChanged += OnProjectItemChanged;
            _testFilesAddRemoveListener.StartListeningForTestFileChanges();

            _solutionListener.SolutionUnloaded       += SolutionListenerOnSolutionUnloaded;
            _solutionListener.SolutionProjectChanged += OnSolutionProjectChanged;
            _solutionListener.StartListeningForChanges();

            _testFilesUpdateWatcher.FileChangedEvent += OnProjectItemChanged;
        }
Exemplo n.º 2
0
 public SolutionBuildEvents(
     ISolutionProvider solutionProvider,
     IBuildInformationProvider buildInformationProvider,
     IServiceProvider serviceProvider,
     ILogger logger)
 {
     _solutionProvider         = solutionProvider;
     _buildInformationProvider = buildInformationProvider;
     _logger      = logger;
     _buildEvents = (serviceProvider.GetService(typeof(DTE)) as DTE).Events.BuildEvents;
     _buildEvents.OnBuildBegin += BuildEvents_OnBuildBegin;
 }
Exemplo n.º 3
0
 public BuildInformationProvider(
     [Import(typeof(IBuildOutputLogger))] IBuildOutputLogger buildOutputLogger,
     [Import(typeof(IStatusBarNotificationService))] IStatusBarNotificationService statusBarNotificationService,
     [Import(typeof(IBuildMessagesFactory))] IBuildMessagesFactory buildMessagesFactory,
     [Import(typeof(IWindowStateService))] IWindowStateService windowStateService,
     [Import(typeof(IPackageSettingsProvider))] IPackageSettingsProvider packageSettingsProvider,
     [Import(typeof(IErrorNavigationService))] IErrorNavigationService errorNavigationService,
     [Import(typeof(ISolutionProvider))] ISolutionProvider solutionProvider,
     [Import(typeof(IBuildService))] IBuildService buildService,
     [Import(typeof(ITaskBarInfoService))] ITaskBarInfoService taskBarInfoService)
 {
     _packageSettingsProvider      = packageSettingsProvider;
     _errorNavigationService       = errorNavigationService;
     _buildOutputLogger            = buildOutputLogger;
     _statusBarNotificationService = statusBarNotificationService;
     _buildMessagesFactory         = buildMessagesFactory;
     _windowStateService           = windowStateService;
     _solutionProvider             = solutionProvider;
     _buildService       = buildService;
     _taskBarInfoService = taskBarInfoService;
     _buildOutputLogger.OnErrorRaised += BuildOutputLogger_OnErrorRaised;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes an instance of <see cref="CommitMapEngine"/>
 /// </summary>
 public CommitMapEngine(ISolutionProvider solutionProvider, ICommitScanner commitScanner, IAnalyzer analyzer)
 {
     _solutionProvider = solutionProvider;
     _commitScanner    = commitScanner;
     _analyzer         = analyzer;
 }
Exemplo n.º 5
0
        public SolutionNotifier(ISolutionProvider solutionProvider)
        {
            var solution = solutionProvider.Provide();

            var solutionEventStream = Observable.Create <SolutionEventInfo>(observer =>
            {
                uint unregisterToken  = VSConstants.VSCOOKIE_NIL;
                var solutionEventSink = new SolutionEventSink(observer);

                // TODO check result and manage failure

                solution.AdviseSolutionEvents(solutionEventSink, out unregisterToken);

                Action disposeAction = () =>
                {
                    solution.UnadviseSolutionEvents(unregisterToken);
                };

                return(disposeAction);
            })
                                      .Publish() // this will be subscribed multiple times: avoid re-subscription side-effect
                                      .RefCount();

            {
                var hotSolutionOpenedStream = solutionEventStream
                                              .Where(eventInfo => eventInfo.Reason == SolutionEventReason.SolutionOpened)
                                              .Select(_ => new SolutionInfo()
                {
                    Solution = solution
                })
                                              .Replay(0);

                hotSolutionOpenedStream.Connect().DisposeWith(disposables);

                SolutionOpenedStream = hotSolutionOpenedStream;
            }

            {
                var hotSolutionClosingStream = solutionEventStream
                                               .Where(eventInfo => eventInfo.Reason == SolutionEventReason.SolutionClosing)
                                               .Select(_ => Unit.Default)
                                               .Replay(0);

                hotSolutionClosingStream.Connect().DisposeWith(disposables);

                SolutionClosingStream = hotSolutionClosingStream;
            }

            {
                var hotProjectAddedStream = solutionEventStream
                                            .Where(eventInfo => eventInfo.Reason == SolutionEventReason.ProjectAdded)
                                            .Select(eventInfo => new ProjectInfo()
                {
                    Hierarchy = eventInfo.ProjectHierarchy
                })
                                            .Replay(0);

                hotProjectAddedStream.Connect().DisposeWith(disposables);

                ProjectAddedStream = hotProjectAddedStream;
            }

            {
                var hotProjectRemovingtream = solutionEventStream
                                              .Where(eventInfo => eventInfo.Reason == SolutionEventReason.ProjectRemoving)
                                              .Select(eventInfo => new ProjectInfo()
                {
                    Hierarchy = eventInfo.ProjectHierarchy
                })
                                              .Replay(0);

                hotProjectRemovingtream.Connect().DisposeWith(disposables);

                ProjectRemovingtream = hotProjectRemovingtream;
            }
        }
Exemplo n.º 6
0
 protected SolutionInfoBase(IFolder solutionFolder, ISolutionProvider provider)
 {
     Folder   = solutionFolder;
     Provider = provider;
 }