Exemplo n.º 1
0
        public DependencyAnalyzerService()
        {
            _resultBuilder = new AnalyzeProjectResultBuilder();
            var typeDependencyEnumerator = new Roslyn2TypeDependencyEnumerator(LogTrace);

            _dependencyAnalyzerFactory = new DependencyAnalyzerFactory(typeDependencyEnumerator, LogTrace);
        }
Exemplo n.º 2
0
        public AnalyzerMessageBase[] AnalyzeProject(IAnalyzerConfig config, string[] sourcePaths, string[] referencedAssemblyPaths)
        {
            var resultBuilder = new AnalyzeProjectResultBuilder();

            var dependencyAnalyzer  = _dependencyAnalyzerFactory.Create(config);
            var illegalDependencies = dependencyAnalyzer.AnalyzeProject(sourcePaths, referencedAssemblyPaths);

            foreach (var illegalDependency in illegalDependencies)
            {
                resultBuilder.AddIllegalDependency(illegalDependency);
            }

            return(resultBuilder.ToArray());
        }