Exemple #1
0
        private static DateTime GetStamp(IBSharpProject project)
        {
            project = project.Get <IBSharpProject>("_real_project") ?? project;
            var dirs   = project.GetSourceDirectories().ToArray();
            var stamp  = dirs.SelectMany(_ => Directory.GetFiles(_, "*.bxls", SearchOption.AllDirectories)).Max(_ => File.GetLastWriteTime(_));
            var csharp =
                Directory.GetFiles(project.GetCompileDirectory(), "*.cs", SearchOption.AllDirectories)
                .Where(_ => !_.Contains("\\obj\\")).ToArray();

            if (0 != csharp.Length)
            {
                var _s = csharp.Max(_ => File.GetLastWriteTime(_));
                if (_s > stamp)
                {
                    stamp = _s;
                }
            }
            var xslt =
                Directory.GetFiles(project.GetCompileDirectory(), "*.xslt", SearchOption.AllDirectories)
                .Where(_ => !_.Contains("\\obj\\")).ToArray();

            if (0 != xslt.Length)
            {
                var _s = xslt.Max(_ => File.GetLastWriteTime(_));
                if (_s > stamp)
                {
                    stamp = _s;
                }
            }


            return(stamp);
        }
 /// <summary>
 /// Процедура инициализации из проекта
 /// </summary>
 /// <param name="project"></param>
 public static DirectoryFileFilter Create(IBSharpProject project)
 {
     return(new DirectoryFileFilter {
         Roots = project.GetSourceDirectories().ToArray(),
         SearchMasks = project.InputExtensions.Split(';').Select(_ => "*." + _).ToArray(),
         Includes = project.Targets.Paths.Where(_ => _.Value == BSharpBuilderTargetType.Include).Select(_ => _.Key).ToArray(),
         Excludes = project.Targets.Paths.Where(_ => _.Value == BSharpBuilderTargetType.Exclude).Select(_ => _.Key).ToArray()
     });
 }