-
Notifications
You must be signed in to change notification settings - Fork 1
Allow custom path for doxygen #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,33 @@ | |
| import tempfile | ||
|
|
||
| from obidog.config import SOURCE_DIRECTORIES | ||
| from obidog.logger import log | ||
|
|
||
|
|
||
| DOXYGEN_PATH = os.environ.get("DOXYGEN_PATH", "doxygen") | ||
|
|
||
| def _check_doxygen(): | ||
| try: | ||
| with subprocess.Popen( | ||
| [DOXYGEN_PATH, "--version"], stdout=subprocess.PIPE | ||
| ) as clang_format_exec: | ||
| version = clang_format_exec.stdout.read().decode("utf-8").strip() | ||
| try: | ||
| version = version.split()[0].split(".") | ||
| if int(version[0]) >= 1 and int(version[1]) >= 8: | ||
|
||
| return True | ||
| else: | ||
| return False | ||
| except: | ||
| return False | ||
| except FileNotFoundError as e: | ||
| return False | ||
|
|
||
| def build_doxygen_documentation(source_path): | ||
| if DOXYGEN_PATH is None: | ||
| log.warn("doxygen not found, could not create doxygen files") | ||
|
||
| return "" | ||
|
|
||
| path = tempfile.mkdtemp() | ||
| src_directories = [ | ||
| os.path.join(source_path, directory) | ||
|
|
@@ -19,6 +43,10 @@ def build_doxygen_documentation(source_path): | |
| "{{input_directories}}", (" \\\n" + " " * 25).join(src_directories) | ||
| ) | ||
| ) | ||
| with open(os.path.join(path, "out.log"), "w") as log: | ||
| subprocess.run(["doxygen", "Doxyfile"], cwd=path, stdout=log, stderr=log) | ||
| with open(os.path.join(path, "out.log"), "w") as logger: | ||
| subprocess.run([DOXYGEN_PATH, "Doxyfile"], cwd=path, stdout=logger, stderr=logger) | ||
| return path | ||
|
|
||
|
|
||
| if not _check_doxygen(): | ||
| DOXYGEN_PATH = None | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it named
clang_format_exec?