Skip to content

Commit

Permalink
Merge branch 'thb-sb-doxygen-bin-path'
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubAndrysek committed Jun 30, 2023
2 parents c6b66d0 + 7d4410b commit 10a41e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions mkdoxy/doxyrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DoxygenRun:
"""! Class for running Doxygen.
@details This class is used to run Doxygen and parse the XML output.
"""
def __init__(self, doxygenSource: str, tempDoxyFolder: str, doxyCfgNew: dict):
def __init__(self, doxygenBinPath: str, doxygenSource: str, tempDoxyFolder: str, doxyCfgNew):
"""! Constructor.
Default Doxygen config options:
Expand All @@ -26,10 +26,12 @@ def __init__(self, doxygenSource: str, tempDoxyFolder: str, doxyCfgNew: dict):
- GENERATE_LATEX: NO
@details
@param doxygenBinPath: (str) Path to the Doxygen binary.
@param doxygenSource: (str) Source files for Doxygen.
@param tempDoxyFolder: (str) Temporary folder for Doxygen.
@param doxyCfgNew: (dict) New Doxygen config options that will be added to the default config (new options will overwrite default options)
"""
self.doxygenBinPath: str = doxygenBinPath
self.doxygenSource: str = doxygenSource
self.tempDoxyFolder: str = tempDoxyFolder
self.doxyCfgNew: dict = doxyCfgNew
Expand Down Expand Up @@ -117,7 +119,7 @@ def run(self):
"""! Run Doxygen with the current configuration using the Popen class.
@details
"""
doxyBuilder = Popen(['doxygen', '-'], stdout=PIPE, stdin=PIPE, stderr=PIPE)
doxyBuilder = Popen([self.doxygenBinPath, '-'], stdout=PIPE, stdin=PIPE, stderr=PIPE)
stdout_data = doxyBuilder.communicate(self.doxyCfgStr.encode('utf-8'))[0].decode().strip()
# log.info(self.destinationDir)
# log.info(stdout_data)
Expand Down
3 changes: 2 additions & 1 deletion mkdoxy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class MkDoxy(BasePlugin):
('ignore-errors', config_options.Type(bool, default=False)),
('save-api', config_options.Type(str, default="")),
("enabled", config_options.Type(bool, default=True)),
("doxygen-bin-path", config_options.Type(str, default="doxygen", required=False)),
)

# Config options for each project
Expand Down Expand Up @@ -110,7 +111,7 @@ def tempDir(siteDir: str, tempDir:str, projectName: str) ->str:
tempDirApi = tempDir(config['site_dir'], "assets/.doxy/", project_name)

# Check scr changes -> run Doxygen
doxygenRun = DoxygenRun(project_data.get('src-dirs'), tempDirApi, project_data.get('doxy-cfg', {}))
doxygenRun = DoxygenRun(self.config['doxygen-bin-path'], project_data.get('src-dirs'), tempDirApi, project_data.get('doxy-cfg', {}))
if doxygenRun.checkAndRun():
log.info(" -> generating Doxygen filese")
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def requirements():
# https://pypi.org/project/mkdoxy/
setup(
name='mkdoxy',
version='1.1.0',
version='1.1.1',
description='MkDoxy → MkDocs + Doxygen = easy documentation generator with code snippets',
long_description=readme(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 10a41e6

Please sign in to comment.