public void load_packages_by_assembly()
        {
            var includes = new PackageManifest();

            new FileSystem().PersistToFile(includes, theApplicationDirectory, PackageManifest.FILE);

            var links = new LinkManifest();

            links.AddLink("../TestPackage1");

            new FileSystem().PersistToFile(links, theApplicationDirectory, LinkManifest.FILE);

            var assemblyLoader = new AssemblyLoader(new BottlingDiagnostics());

            assemblyLoader.AssemblyFileLoader = file => Assembly.Load(Path.GetFileNameWithoutExtension(file));

            var package = linkedFolderReader.Load(new PackageLog()).Single();

            assemblyLoader.LoadAssembliesFromPackage(package);

            assemblyLoader
            .Assemblies
            .Single()
            .GetName()
            .Name
            .ShouldEqual("TestPackage1");
        }
示例#2
0
        public void load_all_packages_by_reading_the_include_folder()
        {
            var includes = new PackageManifest();

            includes.AddLink("../TestPackage1");

            new FileSystem().PersistToFile(includes, theApplicationDirectory, PackageManifest.FILE);

            var assemblyLoader = new AssemblyLoader(new PackagingDiagnostics());

            assemblyLoader.AssemblyFileLoader = file => Assembly.Load(File.ReadAllBytes(file));


            var package = linkedFolderReader.Load(new PackageLog()).Single();

            assemblyLoader.LoadAssembliesFromPackage(package);

            assemblyLoader.Assemblies.Single().GetName().Name.ShouldEqual("TestPackage1");
        }
示例#3
0
        private static string[] determineLinkedFolders()
        {
            var loader   = new LinkedFolderPackageLoader(FubuMvcPackageFacility.GetApplicationPath(), x => x);
            var packages = loader.Load(new PackageLog());

            var links = new List <string>();

            packages.Each(x => x.ForFolder(BottleFiles.WebContentFolder, links.Add));

            return(links.ToArray());
        }
示例#4
0
        private static string[] determineLinkedFolders()
        {
            var loader = new LinkedFolderPackageLoader(FubuMvcPackageFacility.GetApplicationPath(), x => x);
            var packages = loader.Load(new PackageLog());

            var links = new List<string>();

            packages.Each(x => x.ForFolder(BottleFiles.WebContentFolder, links.Add));

            return links.ToArray();
        }