|
16 | 16 | import json
|
17 | 17 | import logging
|
18 | 18 | import os
|
| 19 | +from pathlib import Path |
19 | 20 | import shutil
|
20 | 21 | import subprocess
|
21 | 22 |
|
@@ -471,15 +472,31 @@ def build(self, *, doc_build_folder, output_staging_directory):
|
471 | 472 |
|
472 | 473 | always_run_doxygen = build_context.always_run_doxygen
|
473 | 474 | has_cpp = build_context.build_type in ['ament_cmake', 'cmake'] or always_run_doxygen
|
| 475 | + package = self.build_context.package |
| 476 | + |
| 477 | + # Detect meta packages. They have no build_dependencies, do have exec_dependencies, |
| 478 | + # and have no subdirectories except for possibly 'doc'. |
| 479 | + is_meta = True |
| 480 | + if package.build_depends or not package.exec_depends: |
| 481 | + is_meta = False |
| 482 | + else: |
| 483 | + pp = Path(package_xml_directory) |
| 484 | + subdirectories = [x for x in pp.iterdir() if x.is_dir()] |
| 485 | + for subdirectory in subdirectories: |
| 486 | + if subdirectory.name != 'doc': |
| 487 | + is_meta = False |
| 488 | + continue |
| 489 | + |
474 | 490 | self.template_variables.update({
|
475 | 491 | 'has_python': has_python,
|
476 | 492 | 'has_cpp': has_cpp,
|
477 | 493 | 'has_standard_docs': bool(standard_docs),
|
478 | 494 | 'has_documentation': bool(doc_directories),
|
479 | 495 | 'has_readme': 'readme' in standard_docs,
|
480 | 496 | 'interface_counts': interface_counts,
|
481 |
| - 'package': self.build_context.package, |
| 497 | + 'package': package, |
482 | 498 | 'base_url': base_url,
|
| 499 | + 'is_meta': is_meta or package.is_metapackage(), |
483 | 500 | })
|
484 | 501 |
|
485 | 502 | # Setup rosdoc2 Sphinx file which will include and extend the one in
|
|
0 commit comments