Example #1
0
        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");
                }
            }
        }
Example #2
0
 protected PrinterBase(Documentation documentation)
 {
     _documentation = documentation;
 }
 public void SetUp()
 {
     _documentation = new Documentation();
     _documentation.Scan(typeof(FilenameProvider).Assembly);
 }
Example #4
0
 public XmlComment(Documentation documentation, XmlElement documentationNode)
 {
     _documentation = documentation;
     _documentationNode = documentationNode;
 }
Example #5
0
 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()
         };
 }
Example #6
0
 public ExternalTypeElement(Documentation owner, Type type)
     : base(owner, type)
 {
 }
Example #7
0
 public PrinterFactory(Documentation documentation)
 {
     _documentation = documentation;
 }
Example #8
0
        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;
            }
        }
Example #9
0
        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");
            }
        }
Example #10
0
        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");
        }