예제 #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);
        }
예제 #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);
        }