Skip to content

Commit f1dbff8

Browse files
mergify[bot]cferreiragonzMiguelCompany
authored
Apply custom templates to included IDL files (#1066) (#1074)
* Docs - Apply custom templates to included IDL files (#1066) * Refs #23150: Apply custom templates to included IDL files Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #23150: Apply suggestion Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> (cherry picked from commit bf0dfe6) # Conflicts: # code/FastDDSGenCodeTester.cpp # docs/fastddsgen/dataTypes/dataTypes.rst * Fix conflicts Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: Carlos Ferreira González <carlosferreira@eprosima.com> Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 3bedaee commit f1dbff8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

code/FastDDSGenCodeTester.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,6 @@ enum MyBitMask : uint8_t
136136
// INCLUDE_MORE_IDL_FILES
137137
#include "OtherFile.idl"
138138
#include <AnotherFile.idl>
139+
#include <IncludedIDL.idl>
139140
//!
140141
/**/

docs/fastddsgen/dataTypes/dataTypes.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,22 @@ If *Fast DDS-Gen* does not find a C/C++ preprocessor in default system paths, th
373373
using parameter ``-ppPath``.
374374
The parameter ``-ppDisable`` can be used to disable the usage of the C/C++ preprocessor.
375375

376+
The parameter ``-extrastg`` can also be used to apply custom templates to included IDL files.
377+
To enable this feature, the output file name passed to ``-extrastg`` must include the character ``@``, which will be
378+
replaced by the name of the included file to generate the output file.
379+
380+
The following command will generate two custom templates, one for the main IDL file and another for the included one:
381+
382+
- ``MainIDL_Custom.cpp``
383+
- ``IncludedIDL_Custom.cpp``
384+
385+
Where ``IncludedIDL.idl`` is included in ``MainIDL.idl`` file.
386+
387+
.. code-block:: bash
388+
389+
<path/to/Fast DDS-Gen>/scripts/fastddsgen MainIDL.idl -I <path/to/idls> -extrastg <path/to/template>/Custom.stg @_Custom.cpp
390+
391+
Check :ref:`fastddsgen_supported_options` for more information about the ``-extrastg`` option.
376392

377393
Annotations
378394
--------------

0 commit comments

Comments
 (0)