Esempio n. 1
0
        public void CopyFiles(FileCopyRequest request)
        {
            _fileSystem.CreateDirectory(request.To);

            // Hack!
            if (!_fileSystem.DirectoryExists(request.From) && request.From.ToLower().Contains("release"))
            {
                var dir = request.From.ToLower().Replace("release", "debug");
                if (_fileSystem.DirectoryExists(dir))
                {
                    request.From = dir;
                }
            }

            var files = _fileSystem.FindFiles(request.From, request.Matching);
            if (!files.Any())
            {
                throw new ApplicationException("Unable to find any files matching {1} in {0}".ToFormat(request.From, request.Matching.Include));
            }

            files.Each(f =>
            {
                _logger.Trace("Copying {0} to {1}", f, request.To);
                _fileSystem.Copy(f, request.To);
            });
        }
Esempio n. 2
0
        // Tested manually.
        public void Execute(IRippleStepRunner runner)
        {
            string packageFolder;
            try
            {
                 packageFolder = _destination.NugetFolderFor(_nuget);
            }
            catch (ArgumentOutOfRangeException exc)
            {
                RippleLog.Error(ToString(), exc);
                throw;
            }

            runner.CleanDirectory(packageFolder);
            _nuget.PublishedAssemblies.Each(x =>
            {
                var request = new FileCopyRequest{
                    From = x.Directory,
                    Matching = new FileSet{Include = x.Pattern},
                    To = packageFolder.AppendPath(x.SubFolder.Replace('/', Path.DirectorySeparatorChar))
                };

                runner.CopyFiles(request);
            });
        }
Esempio n. 3
0
        // Tested manually.
        public void Execute(IRippleStepRunner runner)
        {
            string packageFolder;

            try
            {
                packageFolder = _destination.NugetFolderFor(_nuget);
            }
            catch (ArgumentOutOfRangeException exc)
            {
                RippleLog.Error(ToString(), exc);
                throw;
            }

            runner.CleanDirectory(packageFolder);
            _nuget.PublishedAssemblies.Each(x =>
            {
                var request = new FileCopyRequest {
                    From     = x.Directory,
                    Matching = new FileSet {
                        Include = x.Pattern
                    },
                    To = packageFolder.AppendPath(x.SubFolder.Replace('/', Path.DirectorySeparatorChar))
                };

                runner.CopyFiles(request);
            });
        }
Esempio n. 4
0
        public void CopyFiles(FileCopyRequest request)
        {
            _fileSystem.CreateDirectory(request.To);

            // Hack!
            if (!_fileSystem.DirectoryExists(request.From) && request.From.ToLower().Contains("release"))
            {
                var dir = request.From.ToLower().Replace("release", "debug");
                if (_fileSystem.DirectoryExists(dir))
                {
                    request.From = dir;
                }
            }

            var files = _fileSystem.FindFiles(request.From, request.Matching);

            if (!files.Any())
            {
                throw new ApplicationException("Unable to find any files matching {1} in {0}".ToFormat(request.From, request.Matching.Include));
            }

            files.Each(f =>
            {
                _logger.Trace("Copying {0} to {1}", f, request.To);
                _fileSystem.Copy(f, request.To);
            });
        }
Esempio n. 5
0
        public void CopyFiles(FileCopyRequest request)
        {
            _fileSystem.CreateDirectory(request.To);

            var files = _fileSystem.FindFiles(request.From, request.Matching);
            files.Each(f =>
            {
                _logger.Trace("Copying {0} to {1}", f, request.To);
                _fileSystem.Copy(f, request.To);
            });
        }
Esempio n. 6
0
 public bool Equals(FileCopyRequest other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.Matching, Matching) && Equals(other.From, From) && Equals(other.To, To));
 }
Esempio n. 7
0
        // Tested manually.
        public void Execute(IRippleStepRunner runner)
        {
            var packageFolder = _destination.NugetFolderFor(_nuget);

            runner.CleanDirectory(packageFolder);
            _nuget.PublishedAssemblies.Each(x =>
            {
                var request = new FileCopyRequest{
                    From = x.Directory,
                    Matching = new FileSet{Include = x.Pattern},
                    To = packageFolder.AppendPath(x.SubFolder.Replace('/', Path.DirectorySeparatorChar))
                };

                runner.CopyFiles(request);
            });
        }
Esempio n. 8
0
        public void CopyFiles(FileCopyRequest request)
        {
            _fileSystem.CreateDirectory(request.To);

            // Hack!
            if (!_fileSystem.DirectoryExists(request.From) && request.From.Contains("release"))
            {
                var dir = request.From.Replace("release", "debug");
                if (_fileSystem.DirectoryExists(dir))
                {
                    request.From = dir;
                }
            }

            var files = _fileSystem.FindFiles(request.From, request.Matching);
            files.Each(f =>
            {
                _logger.Trace("Copying {0} to {1}", f, request.To);
                _fileSystem.Copy(f, request.To);
            });
        }
Esempio n. 9
0
 public bool Equals(FileCopyRequest other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Matching, Matching) && Equals(other.From, From) && Equals(other.To, To);
 }