Skip to content

Commit 1ba4c7e

Browse files
authored
Merge pull request #30 from kaycebasques/outdir
feat: support OUTDIR in Doxyfile
2 parents cd8ef73 + 5ef2150 commit 1ba4c7e

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.4.2]
9+
10+
### Added
11+
12+
- Support for `{{OUTDIR}}` substitution in the `Doxyfile` [#30](https://github.com/TendTo/rules_doxygen/pull/30) (thanks to @kaycebasques)
13+
814
## [2.4.1]
915

1016
### Added

docs/doxygen_doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ doxygen(
261261
| <a id="doxygen-deps"></a>deps | List of dependencies targets whose files present in the 'src', 'hdrs' and 'data' attributes will be collected to generate the documentation. Transitive dependencies are also taken into account. Since we are only considering the source files and not the outputs, these targets **will not** be built. | `[]` |
262262
| <a id="doxygen-dot_executable"></a>dot_executable | Label of the doxygen executable. Make sure it is also added to the `srcs` of the macro | `None` |
263263
| <a id="doxygen-configurations"></a>configurations | List of additional configuration parameters to pass to Doxygen. | `None` |
264-
| <a id="doxygen-doxyfile_template"></a>doxyfile_template | The template file to use to generate the Doxyfile. The following substitutions are available:<br> - `# {{INPUT}}`: Subpackage directory in the sandbox.<br> - `# {{ADDITIONAL PARAMETERS}}`: Additional parameters given in the `configurations` attribute.<br> - `# {{OUTPUT DIRECTORY}}`: The directory provided in the `outs` attribute. | `None` |
264+
| <a id="doxygen-doxyfile_template"></a>doxyfile_template | The template file to use to generate the Doxyfile. The following substitutions are available:<br> - `# {{INPUT}}`: Subpackage directory in the sandbox.<br> - `# {{ADDITIONAL PARAMETERS}}`: Additional parameters given in the `configurations` attribute.<br> - `# {{OUTPUT DIRECTORY}}`: The directory provided in the `outs` attribute.<br> - `{{OUTDIR}}`: The output directory where the generated documentation will be placed. Can be used anywhere in the Doxyfile, usually to generate additional output files, like tag files. | `None` |
265265
| <a id="doxygen-doxygen_extra_args"></a>doxygen_extra_args | Extra arguments to pass to the doxygen executable. | `[]` |
266266
| <a id="doxygen-outs"></a>outs | Output folders bazel will keep. If only the html outputs is of interest, the default value will do. otherwise, a list of folders to keep is expected (e.g. ["html", "latex"]). Note that the rule will also generate an output group for each folder in the outs list having the same name. | `["html"]` |
267267
| <a id="doxygen-doxyfile_encoding"></a>doxyfile_encoding | This tag specifies the encoding used for all characters in the configuration file that follow. | `None` |

doxygen/doxygen.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def _doxygen_impl(ctx):
7979
"# {{DOT_PATH}}": ("DOT_PATH = %s" % ctx.executable.dot_executable.dirname) if ctx.executable.dot_executable else "",
8080
"# {{ADDITIONAL PARAMETERS}}": "\n".join(configurations),
8181
"# {{OUTPUT DIRECTORY}}": "OUTPUT_DIRECTORY = %s" % doxyfile.dirname,
82+
"{{OUTDIR}}": "%s" % doxyfile.dirname,
8283
},
8384
)
8485

@@ -659,7 +660,9 @@ def doxygen(
659660
The following substitutions are available:<br>
660661
- `# {{INPUT}}`: Subpackage directory in the sandbox.<br>
661662
- `# {{ADDITIONAL PARAMETERS}}`: Additional parameters given in the `configurations` attribute.<br>
662-
- `# {{OUTPUT DIRECTORY}}`: The directory provided in the `outs` attribute.
663+
- `# {{OUTPUT DIRECTORY}}`: The directory provided in the `outs` attribute.<br>
664+
- `{{OUTDIR}}`: The output directory where the generated documentation will be placed.
665+
Can be used anywhere in the Doxyfile, usually to generate additional output files, like tag files.
663666
doxygen_extra_args: Extra arguments to pass to the doxygen executable.
664667
outs: Output folders bazel will keep. If only the html outputs is of interest, the default value will do.
665668
otherwise, a list of folders to keep is expected (e.g. ["html", "latex"]).

examples/doxyfile/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2508,7 +2508,7 @@ TAGFILES =
25082508
# tag file that is based on the input files it reads. See section "Linking to
25092509
# external documentation" for more information about the usage of tag files.
25102510

2511-
GENERATE_TAGFILE =
2511+
GENERATE_TAGFILE = {{OUTDIR}}/html/index.tag
25122512

25132513
# If the ALLEXTERNALS tag is set to YES, all external classes and namespaces
25142514
# will be listed in the class and namespace index. If set to NO, only the

examples/doxyfile/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@ Namely, the following expressions will be replaced:
1717
- `# {{DOT_PATH}}`: Indicate to doxygen the location of the `dot_executable`
1818
- `# {{ADDITIONAL PARAMETERS}}`: Additional parameters given in the `configurations` attribute.
1919
- `# {{OUTPUT DIRECTORY}}`: The directory provided in the `outs` attribute.
20+
- `{{OUTDIR}}`: The output directory where the generated documentation will be placed.
21+
Can be used anywhere in the Doxyfile, usually to generate additional output files, like tag files.
2022

23+
In this example, note how the `GENERATE_TAGFILE` value in the Doxyfile is set to `{{OUTDIR}}/html/index.tag`, which will be replaced with the actual output directory at runtime, generating the desired file.
2124
It is highly recommended to at least use the `# {{OUTPUT DIRECTORY}}` expression at the very end of your Doxyfile, since the exact path of the output is computed at runtime by Bazel and it may differ on each platform.

0 commit comments

Comments
 (0)