PyXMake Developer Guide: src/PyXMake/VTL/doxygen.py Source File

| PyXMake Developer Guide 1.0 PyXMake

Loading...
Searching...
No Matches
doxygen.py
1# -*- coding: utf-8 -*-
2# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3# % PyXMake - Build environment for PyXMake %
4# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5"""
6Triple-use minimum working example for PyXMake. This script can be
7executed in three different ways in varying levels of accessibility
8
9@note: Create html source code documentations for PyXMake, PyCODAC,
10 MCODAC & BoxBeam with Doxygen.
11Created on 22.03.2018
12
13@version: 1.0
14----------------------------------------------------------------------------------------------
15@requires:
16 - PyXMake, PyCODAC
17
18@change:
19 -
20
21@author: garb_ma [DLR-FA,STM Braunschweig]
22----------------------------------------------------------------------------------------------
23"""
24import os, sys
25
26try:
27 import PyXMake as _ #@UnusedImport
28except ImportError:
29 # Script is executed as a plug-in
30 sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
31finally:
32 from PyXMake.Tools import Utility #@UnresolvedImport
33 from PyXMake.Build import Make
34 from PyXMake.Build.Make import Doxygen
35 from PyXMake import VTL #@UnresolvedImport
36
37try:
38 # Import PyCODAC to build library locally during setup.
39 from PyCODAC.Tools.Utility import GetPyCODACPath
40 # Import and set local path to PyCODAC
41 __mcd_core_path = os.path.join(GetPyCODACPath(),"Core")
42except ImportError:
43 # This script is not executed as plug-in
44 __mcd_core_path = ""
45except:
46 # Something else went wrong.
47 from PyXMake.Tools import ErrorHandling
48 ErrorHandling.InputError(20)
49
50 def main(
51 BuildID,
52 # Build MCODAC by default
53 title=["MCODAC", "MCODAC Developer Guide"],
54 files=VTL.GetSourceCode(0), ftype="Fortran",
55 # Resource paths
56 source=os.path.join(__mcd_core_path,"src"),
57 output=os.path.join(os.path.dirname(__mcd_core_path),"VTL","doc","mcd_core"),
58 # Scratch directory & verbosity
59 scratch=VTL.Scratch, verbosity=0,
60 # Additional keyword arguments
61 **kwargs):
62 """
63 Main function to execute the script.
64 """
65 # Default command. Use settings to modify the documentation.
66 doxcommand = kwargs.get("config",os.path.join(Make.Path2Config,"stm_doc_config"))
67 DoxyBuild = Doxygen(BuildID, files, stype=ftype, msvsc="vs2015", scratch=scratch, verbose=verbosity)
68 if ftype not in ("Python", "Java"):
69 DoxyBuild.SourcePath(source)
70 DoxyBuild.OutputPath(output)
71 if ftype not in ("Python", "Java"):
72 DoxyBuild.Preprocessing(VTL.GetPreprocessingCommand(1 if not Utility.GetPlatform() in ["windows"] else 0), inend=".for", outend=".fpp")
73 DoxyBuild.Build(doxcommand)
74 DoxyBuild.Settings(brief=title[0], header=title[1], **kwargs)
75 DoxyBuild.create()
76
77if __name__ == "__main__":
78# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79# % Access command line inputs %
80# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 # Execute CLI command
82 Doxygen.run()
83 # Finish
84 print("==================================")
85 print("Finished building HTML documentations")
86 print("==================================")
87 sys.exit()
PyXMake.Build.Make.Doxygen
Base class for all Doxygen build events.
PyXMake.Tools.ErrorHandling.InputError
Base class for all input errors.
PyXMake.Build.Make
Create a make object to define the building environment.
Definition Make.py:1
PyXMake.Build
Module containing all relevant modules and scripts associated with the building process.
Definition __init__.py:1
PyXMake.Tools
Module containing basic functionalities defined for convenience.
Definition __init__.py:1
PyXMake.VTL.doxygen.main
main(BuildID, title=["MCODAC", "MCODAC Developer Guide"], files=VTL.GetSourceCode(0), ftype="Fortran", source=os.path.join(__mcd_core_path,"src"), output=os.path.join(os.path.dirname(__mcd_core_path),"VTL","doc","mcd_core"), scratch=VTL.Scratch, verbosity=0, **kwargs)
Definition doxygen.py:61