Ejemplo n.º 1
0
 public void CopyDirectory(string from, string to, IEnumerable <string> excludes, IEnumerable <string> includes)
 {
     if (!DirectoryUtils.DirectoryExists(to) || DirectoryUtils.GetLastModTimeForDirectory(from) > DirectoryUtils.GetLastModTimeForDirectory(to))
     {
         DirectoryUtils.CopyDirectory(from, to, excludes, includes);
     }
 }
Ejemplo n.º 2
0
 public DateTime GetLastModTimeForPath(string path)
 {
     if (DirectoryUtils.DirectoryExists(path))
     {
         return(DirectoryUtils.GetLastModTimeForDirectory(path));
     }
     else if (FileUtils.FileExists(path))
     {
         return(FileUtils.LastWriteTimeForFile(path));
     }
     else
     {
         throw new FileNotFoundException(String.Format("file not found `{0}'", path));
     }
 }
Ejemplo n.º 3
0
        public override void Build()
        {
            var zipFileName = ZipFileName.Value;
            var directory   = Directory.Value;

            if (!FileUtils.FileExists(zipFileName) || (FileUtils.LastWriteTimeForFile(zipFileName) < DirectoryUtils.GetLastModTimeForDirectory(directory)))
            {
                FileUtils.DeleteFile(zipFileName);
                ZipFileCreator.CreateZipFile(zipFileName, directory);
            }
        }