Exemple #1
0
        public void ProjectBuildFinished(BuildAction buildAction, string projectIdentifier, bool success, bool canceled)
        {
            if (BuildInformationModel.BuildAction == BuildAction.Deploy)
            {
                return;
            }

            var currentProject = Projects.First(item => ProjectIdentifierGenerator.GetIdentifierForProjectItem(item) == projectIdentifier);

            currentProject.Success         = success;
            currentProject.State           = GetProjectState(success, canceled, currentProject);
            currentProject.BuildFinishTime = DateTime.Now;

            if (currentProject.State == ProjectState.BuildError && _packageSettingsProvider.Settings.GeneralSettings.StopBuildAfterFirstError)
            {
                _buildService.CancelBuildSolution();
            }

            BuildInformationModel.SucceededProjectsCount = Projects.Count(x => x.State == ProjectState.BuildDone || x.State == ProjectState.CleanDone);
            BuildInformationModel.FailedProjectsCount    = Projects.Count(x => x.State == ProjectState.BuildError || x.State == ProjectState.CleanError);
            BuildInformationModel.WarnedProjectsCount    = Projects.Count(x => x.State == ProjectState.BuildWarning);
            BuildInformationModel.UpToDateProjectsCount  = Projects.Count(x => x.State == ProjectState.UpToDate);
            BuildInformationModel.MessagesCount          = Projects.Sum(x => x.MessagesCount);
            BuildInformationModel.ErrorCount             = Projects.Sum(x => x.ErrorsCount);
            BuildInformationModel.WarningsCount          = Projects.Sum(x => x.WarningsCount);

            if (BuildInformationModel.CurrentProject == null)
            {
                BuildInformationModel.CurrentProject = Projects.Last();
            }

            UpdateTaskBar();
            BuildStateChanged();
        }
Exemple #2
0
        public void ProjectBuildStarted(IProjectItem projectItem, BuildAction buildAction)
        {
            if (BuildInformationModel.BuildAction == BuildAction.Deploy)
            {
                return;
            }

            var projInCollection = Projects.FirstOrDefault(item => ProjectIdentifierGenerator.GetIdentifierForProjectItem(item) == ProjectIdentifierGenerator.GetIdentifierForProjectItem(projectItem));

            if (projInCollection == null)
            {
                Projects.Add(projectItem);
                projInCollection = projectItem;
            }
            projInCollection.State           = BuildInformationModel.BuildAction.GetProjectState();
            projInCollection.BuildFinishTime = null;
            projInCollection.BuildStartTime  = DateTime.Now;

            UpdateTaskBar();

            _currentQueuePosOfBuildingProject++;

            if (BuildInformationModel.BuildScope == BuildScope.Solution &&
                (BuildInformationModel.BuildAction == BuildAction.Build ||
                 BuildInformationModel.BuildAction == BuildAction.RebuildAll))
            {
                projInCollection.BuildOrder = _currentQueuePosOfBuildingProject;
            }
            BuildInformationModel.CurrentProject = projInCollection;
            BuildStateChanged();
        }
Exemple #3
0
 public int UpdateProjectCfg_Done(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, int fSuccess, int fCancel)
 {
     try
     {
         var buildAction = StateConverterHelper.ConvertSolutionBuildFlagsToBuildAction(dwAction, (VSSOLNBUILDUPDATEFLAGS)dwAction);
         _buildInformationProvider.ProjectBuildFinished(buildAction, ProjectIdentifierGenerator.GetIdentifierForInteropTypes(pHierProj, pCfgProj), fSuccess == 1, fCancel == 1);
         return(VSConstants.S_OK);
     }
     catch (Exception ex)
     {
         _logger.Error(ex, "");
         throw;
     }
 }