Example #1
0
        private static string ProcessEnvironmentPath(string path)
        {
            path = FileProbe.NormalizeFilePath(path).TrimEnd('\\', ' ');
            if (path.EndsWith(Constants.SettingsFileName, StringComparison.OrdinalIgnoreCase))
            {
                path = Path.GetDirectoryName(path);
            }

            return(path);
        }
Example #2
0
        /// <summary>
        /// Is this a source mapping for the current referenced file
        /// </summary>
        private bool IsCurrentFile(string relativePath, ReferencedFile referencedFile)
        {
            var candidatePath = FileProbe.NormalizeFilePath(new Uri(Path.Combine(Path.GetDirectoryName(referencedFile.SourceMapFilePath), relativePath)).AbsolutePath);

            return(referencedFile.Path.Equals(candidatePath, StringComparison.OrdinalIgnoreCase));
        }
Example #3
0
        public bool IsIgnored(string filePath)
        {
            // If no ignore pattern is given then include all files. Otherwise ignore the ones that match an ignore pattern
            if (ignorePatterns.Any() && ignorePatterns.Any(ignorePattern => NativeImports.PathMatchSpec(filePath, FileProbe.NormalizeFilePath(ignorePattern))))
            {
                return(true);
            }

            return(false);
        }
Example #4
0
        private bool IsFileEligibleForInstrumentation(string filePath)
        {
            // If no include patterns are given then include all files. Otherwise include only the ones that match an include pattern
            if (includePatterns.Any() && !includePatterns.Any(includePattern => NativeImports.PathMatchSpec(filePath, FileProbe.NormalizeFilePath(includePattern))))
            {
                return(false);
            }

            // If no exclude pattern is given then exclude none otherwise exclude the patterns that match any given exclude pattern
            if (excludePatterns.Any() && excludePatterns.Any(excludePattern => NativeImports.PathMatchSpec(filePath, FileProbe.NormalizeFilePath(excludePattern))))
            {
                return(false);
            }

            return(true);
        }