public virtual void SetUp() { _documentation = new Documentation(); Assembly assembly = typeof(Documentation).Assembly; _documentation.Scan(assembly); if (!_documentation.AddDocumentation(assembly)) { string assemblyFile = Path.Combine(Environment.CurrentDirectory, Path.GetFileName(assembly.Location)); if (!_documentation.AddDocumentationFromAssemblyFile(assembly, assemblyFile)) { Assert.Fail("Could not find documentation"); } } }
protected PrinterBase(Documentation documentation) { _documentation = documentation; }
public void SetUp() { _documentation = new Documentation(); _documentation.Scan(typeof(FilenameProvider).Assembly); }
public XmlComment(Documentation documentation, XmlElement documentationNode) { _documentation = documentation; _documentationNode = documentationNode; }
public Documentation Merge(Documentation that) { return new Documentation { Namespaces = Namespaces.Union(that.Namespaces).ToArray(), Types = Types.Union(that.Types).ToArray(), DocumentationSources = DocumentationSources.Union(that.DocumentationSources).ToArray() }; }
public ExternalTypeElement(Documentation owner, Type type) : base(owner, type) { }
public PrinterFactory(Documentation documentation) { _documentation = documentation; }
private Documentation ProcessAssembly(string file) { Console.WriteLine("Processing assembly {0}", file); try { string fullPath = Path.GetFullPath(file); _possibleAssemblyPaths.Add(Path.GetDirectoryName(fullPath)); Assembly assembly = Assembly.LoadFrom(fullPath); Documentation documentation = new Documentation(); documentation.Scan(assembly); if (!documentation.AddDocumentationFromAssemblyFile(assembly, fullPath)) { Console.WriteLine("Could not find matching xml file for assembly {0}", fullPath); } return documentation; } catch (ReflectionTypeLoadException ex) { Console.WriteLine("Could not load assembly {0}", file); foreach (Exception loaderEx in ex.LoaderExceptions) { Console.WriteLine(loaderEx); } throw; } }
private void RunGenerator(Documentation documentation) { string outputDirectory = Path.GetFullPath(_options.OutputDirectory); Directory.CreateDirectory(outputDirectory); // path of IglooCastle.exe // this is also the path where the CSS/JS are supposed to be and also the generator.py string assemblyPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); // prepare python engine var engine = Python.CreateEngine(); var searchPaths = engine.GetSearchPaths(); searchPaths.Add(assemblyPath); engine.SetSearchPaths(searchPaths); // load generator.py dynamic generator = engine.Runtime.UseFile("generator.py"); // run dynamic generator generator.Generate(documentation, outputDirectory); // copy CSS/JS to output folder if (assemblyPath != outputDirectory) { Console.WriteLine("Copying static files"); CopyStatic(assemblyPath, outputDirectory, "app.js", "jquery-1.11.1.min.js", "style.css"); } }
private void Run() { // hook in assembly resolver event handler AddAssemblyResolver(); // aggregate documentation Documentation documentation = new Documentation(); documentation = _options.InputAssemblies.Aggregate( documentation, (current, arg) => current.Merge(ProcessAssembly(arg))); // run python generator RunGenerator(documentation); Console.WriteLine("All done"); }