public IEnumerable <IPackageInfo> Load(IPackageLog log) { var reader = new PackageManifestReader(new FileSystem(), folder => folder); var docDirs = TopicLoader.FindDocumentDirectories(_directory); return(docDirs .Where(BottlesFilter.ShouldLoad) .SelectMany(dir => loadPackageFromDirectory(dir, reader))); }
public IEnumerable<IPackageInfo> Load(IPackageLog log) { var exploder = PackageExploder.GetPackageExploder(log); var reader = new PackageManifestReader(new FileSystem(), GetContentFolderForPackage); return FubuMvcPackageFacility.GetPackageDirectories().SelectMany(dir => { return exploder.ExplodeDirectory(new ExplodeDirectory(){ DestinationDirectory = FubuMvcPackageFacility.GetExplodedPackagesDirectory(), PackageDirectory = dir, Log = log }); }).Select(dir => reader.LoadFromFolder(dir)); }
public void SetUp() { packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath(); var fileSystem = new FileSystem(); var manifest = new PackageManifest() { Assemblies = "TestPackage1", Name = "pak1" }; fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE); reader = new PackageManifestReader("../../".ToFullPath(), fileSystem, folder => folder); }
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); }
public void SetUp() { packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath(); var fileSystem = new FileSystem(); var manifest = new PackageManifest { Name = "pak1" }; manifest.AddAssembly("TestPackage1"); fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE); linkedFolderReader = new LinkedFolderPackageLoader(theApplicationDirectory, f => f); reader = new PackageManifestReader(fileSystem, folder => folder); }
public static PackageManifest DetermineManifest(Assembly assembly) { var resourceName = assembly.GetName().Name + "." + PackageManifest.FILE; using (var resource = assembly.GetManifestResourceStream(resourceName)) { if (resource != null) { var manifest = new PackageManifestReader(new FileSystem(), s => s).LoadFromStream(resource); if (manifest.Name.IsEmpty()) { manifest.Name = assembly.GetName().Name; } return(manifest); } } return(defaults(assembly)); }
public IEnumerable <IPackageInfo> Load(IPackageLog log) { var manifestReader = new PackageManifestReader(new FileSystem(), folder => folder); var pis = PackageManifest.FindManifestFilesInDirectory(_searchPoint) .Select(Path.GetDirectoryName) .Select(manifestReader.LoadFromFolder); var filtered = pis.Where(pi => BottleRoles.Module.Equals(pi.Role)); LogWriter.Current.PrintHorizontalLine(); LogWriter.Current.Trace("Solution Package Loader found:"); LogWriter.Current.Indent(() => { filtered.Each(p => LogWriter.Current.Trace(p.Name)); }); LogWriter.Current.PrintHorizontalLine(); return(filtered); }
public IEnumerable<IPackageInfo> Load(IPackageLog log) { var manifestReader = new PackageManifestReader(new FileSystem(), folder => folder); var pis = PackageManifest.FindManifestFilesInDirectory(_searchPoint) .Select(Path.GetDirectoryName) .Select(manifestReader.LoadFromFolder); var filtered = pis.Where(pi=>BottleRoles.Module.Equals(pi.Role)); LogWriter.Current.PrintHorizontalLine(); LogWriter.Current.Trace("Solution Package Loader found:"); LogWriter.Current.Indent(() => { filtered.Each(p => LogWriter.Current.Trace(p.Name)); }); LogWriter.Current.PrintHorizontalLine(); return filtered; }
public static ZipFilePackageLoader BuildZipFilePackageLoader(string applicationPath, FileSystem fileSystem) { var zipFileManifestReader = new PackageManifestReader(applicationPath, fileSystem, ZipFilePackageLoader.GetContentFolderForPackage); PackageExploder packageExploder = PackageExploder.GetPackageExploder(fileSystem); return new ZipFilePackageLoader(zipFileManifestReader, packageExploder); }
public LinkedFolderPackageLoader(string applicationDirectory, Func <string, string> getContentFolderFromPackageFolder) { _applicationDirectory = applicationDirectory; _reader = new PackageManifestReader(_fileSystem, getContentFolderFromPackageFolder); }
public IEnumerable <IPackageInfo> Load(IPackageLog log) { var reader = new PackageManifestReader(new FileSystem(), folder => folder); yield return(reader.LoadFromFolder(_directory)); }
public void SetUp() { packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath(); var fileSystem = new FileSystem(); var manifest = new PackageManifest(){ Name = "pak1" }; manifest.AddAssembly("TestPackage1"); fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE); linkedFolderReader = new LinkedFolderPackageLoader(theApplicationDirectory, f => f); reader = new PackageManifestReader(fileSystem, folder => folder); }
private static IEnumerable <IPackageInfo> loadPackageFromDirectory(string dir, PackageManifestReader reader) { Console.WriteLine("Loading documentation from folder " + dir); var pak = reader.LoadFromFolder(dir).As <PackageInfo>(); pak.RemoveAllAssemblies(); var assemblyFiles = new FileSystem().FindFiles(dir, FileSet.Deep("*.Docs.dll", Path.GetFileName(dir) + ".dll")); foreach (var file in assemblyFiles) { var assemblyName = Path.GetFileNameWithoutExtension(file); var assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x => x.GetName().Name == assemblyName); if (assembly == null) { try { assembly = Assembly.LoadFrom(file); } catch { } } if (assembly != null && BottlesFilter.ShouldLoad(assembly)) { yield return(new AssemblyPackageInfo(assembly)); } } yield return(pak); }
public PackageReaderTests() { _testPackagePath = @"..\..\..\..\acceptance-test\01-package.update"; _reader = new PackageManifestReader(); }
public LinkedFolderPackageLoader(string applicationDirectory, Func<string, string> getContentFolderFromPackageFolder) { _applicationDirectory = applicationDirectory; _reader = new PackageManifestReader(_fileSystem, getContentFolderFromPackageFolder); }
public void SetUp() { packageFolder = FileSystem.Combine("../../../TestPackage1").ToFullPath(); var fileSystem = new FileSystem(); var manifest = new PackageManifest(){ Name = "pak1" }; manifest.AddAssembly("TestPackage1"); fileSystem.PersistToFile(manifest, packageFolder, PackageManifest.FILE); reader = new PackageManifestReader("../../".ToFullPath(), fileSystem, folder => folder); }
public TopshelfPackageLoader(IPackageExploder exploder) { _exploder = exploder; _reader = new PackageManifestReader(new FileSystem(), getContentFolderForPackage); }