Пример #1
0
        private void TriggerBuildSolution()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            if (!ValidateBuild())
            {
                return;
            }

            OutputLog.Focus();
            OutputLog.Clear();
            Evaluator.Clear();

            SetState(StateType.Triggering);

            try
            {
                //TODO ~ ramonv ~ find a way to call Build All in 'Open Folder' projects
                DTE2 applicationObject = ServiceProvider.GetService(typeof(SDTE)) as DTE2;
                Assumes.Present(applicationObject);
                applicationObject.ExecuteCommand(Operation == BuildOperation.Rebuild? "Build.RebuildSolution" : "Build.BuildSolution");

                //applicationObject.ExecuteCommand("Build.BuildSolution");
                //applicationObject.ExecuteCommand("Build.RebuildSolution");

                //TODO ~ Ramonv ~ 'Open Folder' does not trigger build events!

                //DTE2 applicationObject = ServiceProvider.GetService(typeof(SDTE)) as DTE2;
                //Assumes.Present(applicationObject);
                //applicationObject.Solution.SolutionBuild.Build();

                /*
                 * // Rebuild - direct call alternative for .sln projects
                 * IVsSolutionBuildManager2 buildManager = ServiceProvider.GlobalProvider.GetService(typeof(SVsSolutionBuildManager)) as IVsSolutionBuildManager2;
                 * if (ErrorHandler.Failed(buildManager.StartSimpleUpdateSolutionConfiguration((uint)(VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_FORCE_UPDATE | VSSOLNBUILDUPDATEFLAGS.SBF_OPERATION_BUILD),
                 *  (uint)VSSOLNBUILDQUERYRESULTS.VSSBQR_OUTOFDATE_QUERY_YES, 0)))
                 * {
                 *  //handle the error
                 * }
                 */
            }
            catch (Exception e)
            {
                DisplayError("Unable to Trigger the build. " + e.Message);
                SetState(StateType.Idle);
            }
        }
Пример #2
0
        private async System.Threading.Tasks.Task TriggerClangGeneratorAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            if (!ValidateGenerator())
            {
                return;
            }

            OutputLog.Focus();
            OutputLog.Clear();
            Evaluator.Clear();

            SetState(StateType.Gathering);

            await GenerateClangScoreAsync();

            SetState(StateType.Idle);
        }