Exemple #1
0
        private void writeZipFile(CreatePackageInput input, PackageManifest manifest, AssemblyFiles assemblies)
        {
            _zipFileService.CreateZipFile(input.ZipFile, 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), "");

                AddDataFiles(input, zipFile, manifest);

                AddContentFiles(input, zipFile, manifest);
            });
        }
Exemple #2
0
        private void writeZipFile(CreatePackageInput input, PackageManifest manifest, AssemblyFiles assemblies)
        {
            _zipFileService.CreateZipFile(input.ZipFile, 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), "");

                AddDataFiles(input, zipFile, manifest);

                AddContentFiles(input, zipFile, manifest);
            });
        }
Exemple #3
0
 public void AddDataFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
 {
     zipFile.AddFiles(new ZipFolderRequest()
     {
         FileSet       = manifest.DataFileSet,
         ZipDirectory  = FubuMvcPackages.DataFolder,
         RootDirectory = Path.Combine(input.PackageFolder, FubuMvcPackages.DataFolder)
     });
 }
Exemple #4
0
 public void AddDataFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
 {
     zipFile.AddFiles(new ZipFolderRequest()
                      {
                          FileSet = manifest.DataFileSet,
                          ZipDirectory = PackageInfo.DataFolder,
                          RootDirectory = Path.Combine(input.PackageFolder, PackageInfo.DataFolder)
                      });
 }
Exemple #5
0
        public void AddContentFiles(CreatePackageInput input, IZipFile zipFile, PackageManifest manifest)
        {
            manifest.ContentFileSet.AppendExclude(FileSystem.Combine("bin", "*.*"));

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

            zipFile.AddFiles(new ZipFolderRequest()
                             {
                                 FileSet = manifest.ContentFileSet,
                                 ZipDirectory = FubuMvcPackages.WebContentFolder,
                                 RootDirectory = input.PackageFolder
                             });
        }
Exemple #7
0
 public void CreatePackage(CreatePackageInput input, PackageManifest manifest)
 {
     var binFolder = Path.Combine(input.PackageFolder, "bin");
     var assemblies = _assemblyFinder.FindAssemblies(binFolder, manifest.AssemblyNames);
     if (assemblies.Success)
     {
         writeZipFile(input, manifest, assemblies);
     }
     else
     {
         _logger.WriteAssembliesNotFound(assemblies, manifest, input);
     }
 }
Exemple #8
0
        public void CreatePackage(CreatePackageInput input, PackageManifest manifest)
        {
            var binFolder   = Path.Combine(input.PackageFolder, "bin");
            var debugFolder = Path.Combine(binFolder, "debug");

            if (Directory.Exists(debugFolder))
            {
                binFolder = debugFolder;
            }


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

            if (assemblies.Success)
            {
                writeZipFile(input, manifest, assemblies);
            }
            else
            {
                _logger.WriteAssembliesNotFound(assemblies, manifest, input);
            }
        }
Exemple #9
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.AssemblyNames.Each(name => Console.WriteLine("  " + name));
     Console.WriteLine("But only found");
     theAssemblyFiles.Files.Each(file => Console.WriteLine("  " + file));
 }