private void writeZipFile(CreatePackageInput input, PackageManifest manifest, AssemblyFiles assemblies)
        {
            var zipFileName = input.GetZipFileName(manifest);
            
            if (_fileSystem.FileExists(zipFileName))
            {
                LogWriter.Current.Highlight("    Deleting existing file at " + zipFileName);
                _fileSystem.DeleteFile(zipFileName);
            }

            _zipFileService.CreateZipFile(zipFileName, zipFile =>
            {
                assemblies.Files.Each(file =>
                {
                    zipFile.AddFile(file, "bin");
                });

                if (input.PdbFlag)
                {
                    assemblies.PdbFiles.Each(file =>
                    {
                        zipFile.AddFile(file, "bin");
                    });
                }

                WriteVersion(zipFile);

                zipFile.AddFile(FileSystem.Combine(input.PackageFolder, PackageManifest.FILE), "");

                // TODO -- there's an opportunity to generalize this
                AddDataFiles(input, zipFile, manifest);
                AddContentFiles(input, zipFile, manifest);
                AddConfigFiles(input, zipFile, manifest);
            });
        }
Exemple #2
0
        private void writeZipFile(CreatePackageInput input, PackageManifest manifest, AssemblyFiles assemblies)
        {
            _zipFileService.CreateZipFile(input.GetZipFileName(manifest), zipFile =>
            {
                assemblies.Files.Each(file =>
                {
                    zipFile.AddFile(file, "bin");
                });

                if (input.PdbFlag)
                {
                    assemblies.PdbFiles.Each(file =>
                    {
                        zipFile.AddFile(file, "bin");
                    });
                }

                WriteVersion(zipFile);

                zipFile.AddFile(FileSystem.Combine(input.PackageFolder, PackageManifest.FILE), "");

                // TODO -- there's an opportunity to generalize this
                AddDataFiles(input, zipFile, manifest);
                AddContentFiles(input, zipFile, manifest);
                AddConfigFiles(input, zipFile, manifest);
            });
        }
        private void writeZipFile(CreatePackageInput input, PackageManifest manifest, AssemblyFiles assemblies)
        {
            var zipFileName = input.GetZipFileName(manifest);

            if (_fileSystem.FileExists(zipFileName))
            {
                LogWriter.Current.Highlight("    Deleting existing file at " + zipFileName);
                _fileSystem.DeleteFile(zipFileName);
            }

            _zipFileService.CreateZipFile(zipFileName, zipFile =>
            {
                assemblies.Files.Each(file =>
                {
                    zipFile.AddFile(file, "bin");
                });

                if (input.PdbFlag)
                {
                    assemblies.PdbFiles.Each(file =>
                    {
                        zipFile.AddFile(file, "bin");
                    });
                }

                WriteVersion(zipFile);

                zipFile.AddFile(FileSystem.Combine(input.PackageFolder, PackageManifest.FILE), "");

                // TODO -- there's an opportunity to generalize this
                AddDataFiles(input, zipFile, manifest);
                AddContentFiles(input, zipFile, manifest);
                AddConfigFiles(input, zipFile, manifest);
            });
        }
Exemple #4
0
 public void AddConfigFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
 {
     zipFile.AddFiles(new ZipFolderRequest(){
         FileSet = manifest.ConfigFileSet,
         RootDirectory = input.PackageFolder,
         ZipDirectory = BottleFiles.ConfigFolder
     });
 }
Exemple #5
0
 public void AddDataFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
 {
     zipFile.AddFiles(new ZipFolderRequest()
     {
         FileSet       = manifest.DataFileSet,
         ZipDirectory  = BottleFiles.DataFolder,
         RootDirectory = Path.Combine(input.PackageFolder, BottleFiles.DataFolder)
     });
 }
Exemple #6
0
 public void AddConfigFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
 {
     zipFile.AddFiles(new ZipFolderRequest()
     {
         FileSet       = manifest.ConfigFileSet,
         RootDirectory = input.PackageFolder,
         ZipDirectory  = BottleFiles.ConfigFolder
     });
 }
Exemple #7
0
 public void WriteAssembliesNotFound(AssemblyFiles theAssemblyFiles, PackageManifest manifest, CreatePackageInput input)
 {
     Console.WriteLine("Did not locate all designated assemblies at {0}", input.PackageFolder);
     Console.WriteLine("Looking for these assemblies in the package manifest file:");
     manifest.Assemblies.Each(name => Console.WriteLine("  " + name));
     Console.WriteLine("But only found:");
     if(!theAssemblyFiles.Files.Any()) Console.WriteLine("  Found no files");
     theAssemblyFiles.Files.Each(file => Console.WriteLine("  " + file));
 }
Exemple #8
0
 public void AddDataFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
 {
     zipFile.AddFiles(new ZipFolderRequest()
                      {
                          FileSet = manifest.DataFileSet,
                          ZipDirectory = BottleFiles.DataFolder,
                          RootDirectory = Path.Combine(input.PackageFolder, BottleFiles.DataFolder)
                      });
 }
Exemple #9
0
        public void AddContentFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            manifest.ContentFileSet.AppendExclude(FileSystem.Combine("bin", "*.*"));

            zipFile.AddFiles(new ZipFolderRequest()
            {
                FileSet       = manifest.ContentFileSet,
                ZipDirectory  = BottleFiles.WebContentFolder,
                RootDirectory = input.PackageFolder
            });
        }
Exemple #10
0
        public void AddContentFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            manifest.ContentFileSet.AppendExclude(FileSystem.Combine("bin","*.*"));

            zipFile.AddFiles(new ZipFolderRequest()
                             {
                                 FileSet = manifest.ContentFileSet,
                                 ZipDirectory = BottleFiles.WebContentFolder,
                                 RootDirectory = input.PackageFolder
                             });
        }
Exemple #11
0
        public void WriteAssembliesNotFound(AssemblyFiles theAssemblyFiles, PackageManifest manifest, CreatePackageInput input, string binFolder)
        {
            ConsoleWriter.Write("Did not locate all designated assemblies at '{0}'", binFolder);
            ConsoleWriter.Write("Looking for these assemblies in the package manifest file:");
            manifest.Assemblies.Each(name => ConsoleWriter.Write("  " + name));
            ConsoleWriter.Write("But only found:");
            if(!theAssemblyFiles.Files.Any()) ConsoleWriter.Write("  Found no files");
            theAssemblyFiles.Files.Each(file => ConsoleWriter.Write("  " + file));

            ConsoleWriter.Write("Missing");
            theAssemblyFiles.MissingAssemblies.Each(file => ConsoleWriter.Write("  " + file));

            throw new ApplicationException("Invalid package manifest or missing files");
        }
Exemple #12
0
        public void CreatePackage(CreatePackageInput input, PackageManifest manifest)
        {
            var binFolder = _fileSystem.FindBinaryDirectory(input.PackageFolder, input.TargetFlag);

            var assemblies = _assemblyFinder.FindAssemblies(binFolder, manifest.Assemblies);
            if (assemblies.Success)
            {
                writeZipFile(input, manifest, assemblies);
            }
            else
            {
                _logger.WriteAssembliesNotFound(assemblies, manifest, input);
            }
        }
        public void CreatePackage(CreatePackageInput input, PackageManifest manifest)
        {
            var binFolder = _fileSystem.FindBinaryDirectory(input.PackageFolder, input.TargetFlag);

            var assemblies = _assemblyFinder.FindAssemblies(binFolder, manifest.Assemblies);

            if (assemblies.Success)
            {
                writeZipFile(input, manifest, assemblies);
            }
            else
            {
                _logger.WriteAssembliesNotFound(assemblies, manifest, input, binFolder);
            }
        }
Exemple #14
0
        public void AddConfigFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            if (manifest.ConfigFileSet == null)
            {
                ConsoleWriter.Write("      No config files");
                return;
            }

            ConsoleWriter.Write("      Adding Config folder for " + manifest.ConfigFileSet);
            zipFile.AddFiles(new ZipFolderRequest(){
                FileSet = manifest.ConfigFileSet,
                RootDirectory = input.PackageFolder,
                ZipDirectory = BottleFiles.ConfigFolder
            });
        }
        public void AddDataFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            if (manifest.DataFileSet == null)
            {
                ConsoleWriter.Write("      No data files");
                return;
            }

            ConsoleWriter.Write("      Adding Data folder for " + manifest.DataFileSet);
            zipFile.AddFiles(new ZipFolderRequest()
            {
                FileSet       = manifest.DataFileSet,
                ZipDirectory  = BottleFiles.DataFolder,
                RootDirectory = Path.Combine(input.PackageFolder, BottleFiles.DataFolder)
            });
        }
Exemple #16
0
        public void AddDataFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            if (manifest.DataFileSet == null)
            {
                ConsoleWriter.Write("      No data files");
                return;
            }

            ConsoleWriter.Write("      Adding Data folder for " + manifest.DataFileSet);
            zipFile.AddFiles(new ZipFolderRequest()
                             {
                                 FileSet = manifest.DataFileSet,
                                 ZipDirectory = BottleFiles.DataFolder,
                                 RootDirectory = Path.Combine(input.PackageFolder, BottleFiles.DataFolder)
                             });
        }
        public void AddConfigFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            if (manifest.ConfigFileSet == null)
            {
                ConsoleWriter.Write("      No config files");
                return;
            }


            ConsoleWriter.Write("      Adding Config folder for " + manifest.ConfigFileSet);
            zipFile.AddFiles(new ZipFolderRequest()
            {
                FileSet       = manifest.ConfigFileSet,
                RootDirectory = input.PackageFolder,
                ZipDirectory  = BottleFiles.ConfigFolder
            });
        }
        public void AddContentFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            if (manifest.ContentFileSet == null)
            {
                ConsoleWriter.Write("      No WebContent files");
                return;
            }

            ConsoleWriter.Write("      Adding WebContent folder for " + manifest.ContentFileSet);
            manifest.ContentFileSet.AppendExclude(FileSystem.Combine("bin", "*.*"));

            zipFile.AddFiles(new ZipFolderRequest()
            {
                FileSet       = manifest.ContentFileSet,
                ZipDirectory  = BottleFiles.WebContentFolder,
                RootDirectory = input.PackageFolder
            });
        }
Exemple #19
0
        public void AddContentFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            if (manifest.ContentFileSet == null)
            {
                ConsoleWriter.Write("      No WebContent files");
                return;
            }

            ConsoleWriter.Write("      Adding WebContent folder for " + manifest.ContentFileSet);
            manifest.ContentFileSet.AppendExclude(FileSystem.Combine("bin","*.*"));

            zipFile.AddFiles(new ZipFolderRequest()
                             {
                                 FileSet = manifest.ContentFileSet,
                                 ZipDirectory = BottleFiles.WebContentFolder,
                                 RootDirectory = input.PackageFolder
                             });
        }
Exemple #20
0
        private void writeZipFile(CreatePackageInput input, PackageManifest manifest, AssemblyFiles assemblies)
        {
            _zipFileService.CreateZipFile(input.GetZipFileName(manifest), zipFile =>
            {
                assemblies.Files.Each(file =>
                {
                    zipFile.AddFile(file, "bin");
                });

                if (input.PdbFlag)
                {
                    assemblies.PdbFiles.Each(file =>
                    {
                        zipFile.AddFile(file, "bin");
                    });
                }

                WriteVersion(zipFile);

                zipFile.AddFile(FileSystem.Combine(input.PackageFolder, PackageManifest.FILE), "");

                // TODO -- there's an opportunity to generalize this
                AddDataFiles(input, zipFile, manifest);
                AddContentFiles(input, zipFile, manifest);
                AddConfigFiles(input, zipFile, manifest);
            });
        }
Exemple #21
0
 public void WriteAssembliesNotFound(AssemblyFiles theAssemblyFiles, PackageManifest manifest, CreatePackageInput input)
 {
     Console.WriteLine("Did not locate all designated assemblies at {0}", input.PackageFolder);
     Console.WriteLine("Looking for these assemblies in the package manifest file:");
     manifest.Assemblies.Each(name => Console.WriteLine("  " + name));
     Console.WriteLine("But only found:");
     if (!theAssemblyFiles.Files.Any())
     {
         Console.WriteLine("  Found no files");
     }
     theAssemblyFiles.Files.Each(file => Console.WriteLine("  " + file));
 }