예제 #1
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);
        }
예제 #2
0
        public void ForceLoadFromFilename(string filename)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            bool locationChanged = SetScoreLocation(EditorUtils.NormalizePath(filename));

            if (Source == DataSource.Default)
            {
                if (locationChanged)
                {
                    //requested a force file different than current ( force it and disable file watching )
                    SetSource(DataSource.Forced);
                    DocumentLifetimeManager.UnWatchFile();
                }
                else
                {
                    //if the forced file is the same as the current deafult file, then just reenabled the file watcher
                    WatchScoreFile();
                }

                LoadSeverities(ScoreLocation);
            }
            else
            {
                string defaultPath = GetSettingsScoreLocation();
                if (defaultPath == filename)
                {
                    //We are forcing back to default
                    LoadDefaultSource();
                }
                else
                {
                    LoadSeverities(ScoreLocation);
                }
            }
        }
예제 #3
0
        private async System.Threading.Tasks.Task GenerateClangScoreAsync()
        {
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            if (CompilerSource != Compiler.Clang)
            {
                return;
            }

            //Stop watching as the data extractor might modify the watched file
            DocumentLifetimeManager.UnWatchFile();

            //Process Data
            string inputPath  = FixPath(Evaluator.Evaluate(SettingsManager.Instance.Settings.ScoreGenerator.InputPath));
            string outputPath = Evaluator.Evaluate(SettingsManager.Instance.Settings.ScoreGenerator.OutputPath);

            CreateDirectory(Path.GetDirectoryName(outputPath));

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

            string commandLine = "-clang -extract" + timeline + detail + " -i " + inputPath + " -o " + outputPath;

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

            if (exitCode != 0)
            {
                DisplayError("Compile 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!");
        }