コード例 #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);
        }
コード例 #3
0
        private async System.Threading.Tasks.Task GatherAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            OutputLog.Focus();

            SetState(StateType.Gathering);

            DocumentLifetimeManager.UnWatchFile();

            string inputPath    = CompilerSource == Compiler.Clang ? FixPath(Evaluator.Evaluate(SettingsManager.Instance.Settings.ScoreGenerator.InputPath)) : "";
            string inputCommand = inputPath.Length > 0 ? " -i " + inputPath : "";

            string outputPath    = Evaluator.Evaluate(SettingsManager.Instance.Settings.ScoreGenerator.OutputPath);
            string outputCommand = outputPath.Length > 0 ? " -o " + outputPath : "";

            string detail   = " -d " + (int)OverviewDetail;
            string timeline = TimelinePacking == 0 ? " -nt" : " -tp " + TimelinePacking + " -td " + (int)TimelineDetail;

            string commandLine = GetPlatformFlag() + " -stop" + timeline + detail + inputCommand + outputCommand;

            CreateDirectory(Path.GetDirectoryName(outputPath));

            OutputLog.Log("Calling ScoreDataExtractor with " + commandLine);
            int exitCode = ExternalProcess.ExecuteSync(GetScoreExtractorToolPath(), commandLine);

            if (exitCode != 0)
            {
                DisplayError("Score Data Extractor process failed with code " + exitCode + ". Please check the output pane for more information.");
            }

            CompilerData.Instance.ForceLoadFromFilename(outputPath);
            EditorUtils.FocusOverviewWindow();

            OutputLog.Log("Score generation completed!");
            SetState(StateType.Idle);
        }