private void BuildEvents_OnBuildBegin(EnvDTE.vsBuildScope scope, EnvDTE.vsBuildAction action) { try { if (action == EnvDTE.vsBuildAction.vsBuildActionBuild || action == EnvDTE.vsBuildAction.vsBuildActionRebuildAll) { // // Ensure this runs once for parallel builds. // if (Building) { return; } Building = true; } List <IVsProject> projects = new List <IVsProject>(); if (scope.Equals(EnvDTE.vsBuildScope.vsBuildScopeSolution)) { projects = DTEUtil.GetProjects(); } else { IVsProject selected = DTEUtil.GetSelectedProject(); if (selected != null) { projects.Add(selected); DTEUtil.GetSubProjects(selected, ref projects); } } foreach (IVsProject project in projects) { IceBuilderProjectType type = DTEUtil.IsIceBuilderEnabled(project); if (type != IceBuilderProjectType.None) { ProjectUtil.SetupGenerated(project, type); } } } catch (Exception ex) { Package.UnexpectedExceptionWarning(ex); throw; } }
private void BuildEvents_OnBuildBegin(EnvDTE.vsBuildScope scope, EnvDTE.vsBuildAction action) { ThreadHelper.ThrowIfNotOnUIThread(); try { if (action == EnvDTE.vsBuildAction.vsBuildActionBuild || action == EnvDTE.vsBuildAction.vsBuildActionRebuildAll) { // // Ensure this runs once for parallel builds. // if (Building) { return; } Building = true; List <IVsProject> projects = new List <IVsProject>(); if (scope.Equals(EnvDTE.vsBuildScope.vsBuildScopeSolution)) { projects = DTEUtil.GetProjects(); } else { IVsProject selected = DTEUtil.GetSelectedProject(); if (selected != null) { projects.Add(selected); DTEUtil.GetSubProjects(selected, ref projects); } } foreach (IVsProject project in projects) { if (project.IsMSBuildIceBuilderInstalled()) { ProjectUtil.SetupGenerated(project); } } } } catch (Exception ex) { UnexpectedExceptionWarning(ex); } }