Skip to content

Commit

Permalink
added config option source_patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed May 6, 2021
1 parent d227640 commit f0a37c7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
15 changes: 15 additions & 0 deletions poxy/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,9 @@ class _Defaults(object):
r'm_keyword{3}' : r'@xmlonly<mcss:search xmlns:mcss="http://mcss.mosra.cz/doxygen/" mcss:keyword="\1" mcss:title="\2" mcss:suffix-length="\3" />@endxmlonly',
r'm_enum_values_as_keywords' : r'@xmlonly<mcss:search xmlns:mcss="http://mcss.mosra.cz/doxygen/" mcss:enum-values-as-keywords="true" />@endxmlonly'
}
source_patterns = {
r'*.h', r'*.hh', r'*.hxx', r'*.hpp', r'*.h++', r'*.inc', r'*.markdown', r'*.md', r'*.dox'
}



Expand Down Expand Up @@ -760,6 +763,7 @@ class Context(object):
Optional(r'strip_includes') : ValueOrArray(str, name=r'strip_includes'),
Optional(r'sources') : ValueOrArray(str, name=r'sources'),
Optional(r'recursive_sources') : ValueOrArray(str, name=r'recursive_sources'),
Optional(r'source_patterns') : ValueOrArray(str, name=r'source_patterns'),
Optional(r'meta_tags') : {str : Or(str, int)},
Optional(r'tagfiles') : {str : str},
Optional(r'defines') : {str : Or(str, int, bool)},
Expand Down Expand Up @@ -1110,6 +1114,17 @@ def __init__(self, config_path, output_dir, threads, cleanup, verbose, mcss_dir,
self.sources.sort()
self.verbose_value(r'Context.sources', self.sources)

# sources (FILE_PATTERNS)
if 'source_patterns' in config:
self.source_patterns = set()
for v in coerce_collection(config['source_patterns']):
val = v.strip()
if val:
self.source_patterns.add(val)
else:
self.source_patterns = copy.deepcopy(_Defaults.source_patterns)
self.verbose_value(r'Context.source_patterns', self.source_patterns)

# m.css navbar
if 'navbar' in config:
self.navbar = []
Expand Down
4 changes: 1 addition & 3 deletions poxy/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@
(r'EXTRACT_PRIV_VIRTUAL', True),
(r'EXTRACT_PRIVATE', False),
(r'EXTRACT_STATIC', False),
(r'FILE_PATTERNS',
(r'*.h', r'*.hh', r'*.hxx', r'*.hpp', r'*.h++', r'*.inc', r'*.markdown', r'*.md', r'*.dox')
),
(r'FILTER_PATTERNS', None),
(r'FORCE_LOCAL_INCLUDES', False),
(r'FULL_PATH_NAMES', True),
Expand Down Expand Up @@ -158,6 +155,7 @@ def _preprocess_doxyfile(context):
# apply regular doxygen settings
if 1:
df.set_value(r'INPUT', context.sources)
df.set_value(r'FILE_PATTERNS', context.source_patterns)
df.set_value(r'OUTPUT_DIRECTORY', context.output_dir)
df.add_value(r'EXCLUDE', context.html_dir)
df.add_value(r'EXCLUDE', context.xml_dir)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def enum_subdirs(root):

setup_args = dict(
name=r'poxy',
version=r'0.1.2',
version=r'0.2.0',
description=r'Documentation generator for C++.',
long_description_content_type=r'text/markdown',
long_description=f'{README}\n\n{HISTORY}'.strip(),
Expand Down

0 comments on commit f0a37c7

Please sign in to comment.