예제 #1
0
        public void MultipleIgnoreExpressions()
        {
            var ignoreList = new SourceSetIgnoreList();

            ignoreList.Add(@".+\.tmp$");
            ignoreList.Add(@".+\.log$");

            ignoreList.IsIgnored(new SuiteRelativePath(@"a\b\c.dll.tmp")).Should().BeTrue();
            ignoreList.IsIgnored(new SuiteRelativePath(@"x.log")).Should().BeTrue();
            ignoreList.IsIgnored(new SuiteRelativePath(@"tmp")).Should().BeFalse();
        }
예제 #2
0
        /// <summary>
        /// Recursively adds every file in a given directory to a source set (<see cref="SourceSet"/>)
        /// </summary>
        /// <param name="target">The target source set to be extended</param>
        /// <param name="dir">The root directory for the operation</param>
        /// <param name="ignoreList">Ignore list for the target source set</param>
        private void AddAllFiles(SourceSet target, IFileSystemDirectory dir, SourceSetIgnoreList ignoreList)
        {
            foreach (var fileName in dir.Files)
            {
                var suiteRelativePath = new SuiteRelativePath(Path.Combine(suiteRoot.GetRelativePath(dir), fileName));
                if (!ignoreList.IsIgnored(suiteRelativePath))
                {
                    target.Add(suiteRelativePath);
                }
            }

            foreach (var childDirectory in dir.ChildDirectories)
            {
                AddAllFiles(target, dir.GetChildDirectory(childDirectory), ignoreList);
            }
        }
예제 #3
0
        /// <summary>
        /// Recursively adds every file in a given directory to a source set (<see cref="SourceSet"/>)
        /// </summary>
        /// <param name="target">The target source set to be extended</param>
        /// <param name="dir">The root directory for the operation</param>
        /// <param name="ignoreList">Ignore list for the target source set</param>
        private void AddAllFiles(SourceSet target, IFileSystemDirectory dir, SourceSetIgnoreList ignoreList)
        {
            foreach (var fileName in dir.Files)
            {
                var suiteRelativePath = new SuiteRelativePath(Path.Combine(suiteRoot.GetRelativePath(dir), fileName));
                if (!ignoreList.IsIgnored(suiteRelativePath))
                {
                    target.Add(suiteRelativePath);
                }
            }

            foreach (var childDirectory in dir.ChildDirectories)
            {
                AddAllFiles(target, dir.GetChildDirectory(childDirectory), ignoreList);
            }
        }