Exemplo n.º 1
0
        private AnalyzerFileReference?ResolveAnalyzerReference(
            CommandLineAnalyzerReference reference,
            IAnalyzerAssemblyLoader analyzerLoader
            )
        {
            string?resolvedPath = FileUtilities.ResolveRelativePath(
                reference.FilePath,
                basePath: null,
                baseDirectory: BaseDirectory,
                searchPaths: ReferencePaths,
                fileExists: File.Exists
                );

            if (resolvedPath != null)
            {
                resolvedPath = FileUtilities.TryNormalizeAbsolutePath(resolvedPath);
            }

            if (resolvedPath != null)
            {
                return(new AnalyzerFileReference(resolvedPath, analyzerLoader));
            }

            return(null);
        }
Exemplo n.º 2
0
        private AnalyzerFileReference ResolveAnalyzerReference(CommandLineAnalyzerReference reference)
        {
            string resolvedPath = FileUtilities.ResolveRelativePath(reference.FilePath, basePath: null, baseDirectory: BaseDirectory, searchPaths: ReferencePaths, fileExists: File.Exists);

            if (File.Exists(resolvedPath))
            {
                resolvedPath = FileUtilities.TryNormalizeAbsolutePath(resolvedPath);
            }
            else
            {
                resolvedPath = null;
            }

            if (resolvedPath != null)
            {
                return(new AnalyzerFileReference(resolvedPath));
            }

            return(null);
        }