예제 #1
0
        public List <IDEFileActions> RunIncremental(List <string> updatedFiles, RootNodes projectRules)
        {
            var ideFileActions = new List <IDEFileActions>();

            var             allReferences   = _sourceFileResults?.SelectMany(s => s.References).Distinct();
            RulesFileLoader rulesFileLoader = new RulesFileLoader(allReferences, Constants.RulesDefaultPath, RulesEngineConfiguration.TargetVersions, string.Empty, RulesEngineConfiguration.AssemblyDir);

            projectRules = rulesFileLoader.Load();

            RulesAnalysis walker         = new RulesAnalysis(_sourceFileResults, projectRules);
            var           projectActions = walker.Analyze();

            CodeReplacer baseReplacer = new CodeReplacer(_sourceFileBuildResults, RulesEngineConfiguration, _metaReferences, updatedFiles);

            _projectResult.ExecutedActions = baseReplacer.Run(projectActions, RulesEngineConfiguration.ProjectType);

            ideFileActions = projectActions
                             .FileActions
                             .SelectMany(f => f.NodeTokens.Select(n => new IDEFileActions()
            {
                TextSpan = n.TextSpan, Description = n.Description, FilePath = f.FilePath, TextChanges = n.TextChanges
            }))
                             .ToList();
            return(ideFileActions);
        }
예제 #2
0
        /// <summary>
        /// Runs the project rewriter using a previously initialized analysis
        /// </summary>
        /// <param name="projectActions"></param>
        public ProjectResult Run(ProjectActions projectActions)
        {
            _projectResult.ProjectActions = projectActions;
            CodeReplacer baseReplacer = new CodeReplacer(_sourceFileBuildResults, RulesEngineConfiguration, _metaReferences);

            _projectResult.ExecutedActions = baseReplacer.Run(projectActions, RulesEngineConfiguration.ProjectType);
            return(_projectResult);
        }
예제 #3
0
파일: ProjectRewriter.cs 프로젝트: aws/cta
        /// <summary>
        /// Runs the project rewriter using a previously initialized analysis
        /// </summary>
        /// <param name="projectActions"></param>
        public virtual ProjectResult Run(ProjectActions projectActions)
        {
            _projectResult.ProjectActions = projectActions;
            CodeReplacer baseReplacer = new CodeReplacer(_sourceFileBuildResults, ProjectConfiguration, _metaReferences, _analyzerResult, projectResult: _projectResult);

            _projectResult.ExecutedActions = baseReplacer.Run(projectActions, ProjectConfiguration.ProjectType);
            return(_projectResult);
        }