예제 #1
0
        public void SetUp()
        {
            fileSystem = new FileSystem();
            fileSystem.DeleteDirectory("app1");
            var exploder = new BottleExploder(new ZipFileService(fileSystem),
                                              new BottleExploderLogger(s => ConsoleWriter.Write(s)), fileSystem);

            var thePackage = new PackageInfo(new PackageManifest());

            exploder.ExplodeAssembly("app1", typeof(EmptyPackageMarker).Assembly, thePackage);
        }
예제 #2
0
        public IEnumerable <IPackageInfo> Load(IPackageLog log)
        {
            var exploder = BottleExploder.GetPackageExploder(log);
            var reader   = new BottleManifestReader(new FileSystem(), GetContentFolderForPackage);

            return(FubuMvcPackageFacility.GetPackageDirectories().SelectMany(dir =>
            {
                return exploder.ExplodeDirectory(new ExplodeDirectory()
                {
                    DestinationDirectory = FubuMvcPackageFacility.GetExplodedPackagesDirectory(),
                    BottleDirectory = dir,
                    Log = log
                });
            }).Select(dir => reader.LoadFromFolder(dir)));
        }
예제 #3
0
        public AssemblyPackageInfo(Assembly assembly)
        {
            _manifest = DetermineManifest(assembly);
            _inner    = new Lazy <PackageInfo>(() =>
            {
                var inner = new PackageInfo(_manifest);

                var exploder = BottleExploder.GetPackageExploder(new FileSystem());
                exploder.ExplodeAssembly(PackageRegistry.GetApplicationDirectory(), assembly, inner);

                return(inner);
            });

            _assembly = assembly;
        }
예제 #4
0
        public IEnumerable <IPackageInfo> Load(IPackageLog log)
        {
            BottleExploder exploder = BottleExploder.GetPackageExploder(log);
            var            reader   = new PackageManifestReader(new FileSystem(), GetContentFolderForPackage);

            return(_folders.SelectMany(dir => {
                var explodeDirectory = new ExplodeDirectory
                {
                    DestinationDirectory = _explosionDirectory,
                    BottleDirectory = dir,
                    Log = log
                };

                return exploder.ExplodeDirectory(explodeDirectory);
            }).Select(reader.LoadFromFolder));
        }
예제 #5
0
        public static IEnumerable <ContentOnlyPackageInfo> FromAssemblies(string applicationDirectory)
        {
            var exploder   = BottleExploder.GetPackageExploder(new FileSystem());
            var assemblies = FubuModuleAttributePackageLoader.FindAssemblies(new string[] { applicationDirectory.AppendPath("bin") });

            var list = new List <ContentOnlyPackageInfo>();

            foreach (var assembly in assemblies)
            {
                var package = new PackageInfo(new PackageManifest());
                exploder.ExplodeAssembly(applicationDirectory, assembly, package);

                package.ForFolder(BottleFiles.WebContentFolder, dir => {
                    list.Add(new ContentOnlyPackageInfo(dir, assembly.GetName().Name));
                });
            }

            return(list);
        }
예제 #6
0
 //REVIEW: should this be here?
 public virtual IBottleExploder BuildExploder()
 {
     return(BottleExploder.GetPackageExploder(new FileSystem()));
 }