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