From 78bfac741ab51aa59a2e043116e4a49e095c5679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Ferreira=20Gonz=C3=A1lez?= Date: Fri, 16 May 2025 10:04:30 +0200 Subject: [PATCH 1/2] Docs - Apply custom templates to included IDL files (#1066) * Refs #23150: Apply custom templates to included IDL files Signed-off-by: cferreiragonz * Refs #23150: Apply suggestion Signed-off-by: cferreiragonz --------- Signed-off-by: cferreiragonz (cherry picked from commit bf0dfe627edfb8c98dac22c3635a958a326d85ae) # Conflicts: # code/FastDDSGenCodeTester.cpp # docs/fastddsgen/dataTypes/dataTypes.rst --- code/FastDDSGenCodeTester.cpp | 9 +++++++++ docs/fastddsgen/dataTypes/dataTypes.rst | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/code/FastDDSGenCodeTester.cpp b/code/FastDDSGenCodeTester.cpp index ae3275223..2b5e7bf65 100644 --- a/code/FastDDSGenCodeTester.cpp +++ b/code/FastDDSGenCodeTester.cpp @@ -133,8 +133,17 @@ enum MyBitMask : uint8_t //! /* +<<<<<<< HEAD // INCLUDE_MORE_IDL_FILES #include "OtherFile.idl" #include //! /**/ +======= + // INCLUDE_MORE_IDL_FILES + #include "OtherFile.idl" + #include + #include + //! + /**/ +>>>>>>> bf0dfe6 (Docs - Apply custom templates to included IDL files (#1066)) diff --git a/docs/fastddsgen/dataTypes/dataTypes.rst b/docs/fastddsgen/dataTypes/dataTypes.rst index cfa2895d5..dfe7d6252 100644 --- a/docs/fastddsgen/dataTypes/dataTypes.rst +++ b/docs/fastddsgen/dataTypes/dataTypes.rst @@ -373,6 +373,25 @@ If *Fast DDS-Gen* does not find a C/C++ preprocessor in default system paths, th using parameter ``-ppPath``. The parameter ``-ppDisable`` can be used to disable the usage of the C/C++ preprocessor. +<<<<<<< HEAD +======= +The parameter ``-extrastg`` can also be used to apply custom templates to included IDL files. +To enable this feature, the output file name passed to ``-extrastg`` must include the character ``@``, which will be +replaced by the name of the included file to generate the output file. + +The following command will generate two custom templates, one for the main IDL file and another for the included one: + +- ``MainIDL_Custom.cpp`` +- ``IncludedIDL_Custom.cpp`` + +Where ``IncludedIDL.idl`` is included in ``MainIDL.idl`` file. + +.. code-block:: bash + + /scripts/fastddsgen MainIDL.idl -I -extrastg /Custom.stg @_Custom.cpp + +Check :ref:`fastddsgen_supported_options` for more information about the ``-extrastg`` option. +>>>>>>> bf0dfe6 (Docs - Apply custom templates to included IDL files (#1066)) Annotations -------------- From 68b143e1a04f01986fb4cf30eb29be23aaf4e56e Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Wed, 28 May 2025 16:30:35 +0200 Subject: [PATCH 2/2] Fix conflicts Signed-off-by: Miguel Company --- code/FastDDSGenCodeTester.cpp | 10 +--------- docs/fastddsgen/dataTypes/dataTypes.rst | 3 --- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/code/FastDDSGenCodeTester.cpp b/code/FastDDSGenCodeTester.cpp index 2b5e7bf65..cd98feed3 100644 --- a/code/FastDDSGenCodeTester.cpp +++ b/code/FastDDSGenCodeTester.cpp @@ -133,17 +133,9 @@ enum MyBitMask : uint8_t //! /* -<<<<<<< HEAD // INCLUDE_MORE_IDL_FILES #include "OtherFile.idl" #include +#include //! /**/ -======= - // INCLUDE_MORE_IDL_FILES - #include "OtherFile.idl" - #include - #include - //! - /**/ ->>>>>>> bf0dfe6 (Docs - Apply custom templates to included IDL files (#1066)) diff --git a/docs/fastddsgen/dataTypes/dataTypes.rst b/docs/fastddsgen/dataTypes/dataTypes.rst index dfe7d6252..02cefa3d6 100644 --- a/docs/fastddsgen/dataTypes/dataTypes.rst +++ b/docs/fastddsgen/dataTypes/dataTypes.rst @@ -373,8 +373,6 @@ If *Fast DDS-Gen* does not find a C/C++ preprocessor in default system paths, th using parameter ``-ppPath``. The parameter ``-ppDisable`` can be used to disable the usage of the C/C++ preprocessor. -<<<<<<< HEAD -======= The parameter ``-extrastg`` can also be used to apply custom templates to included IDL files. To enable this feature, the output file name passed to ``-extrastg`` must include the character ``@``, which will be replaced by the name of the included file to generate the output file. @@ -391,7 +389,6 @@ Where ``IncludedIDL.idl`` is included in ``MainIDL.idl`` file. /scripts/fastddsgen MainIDL.idl -I -extrastg /Custom.stg @_Custom.cpp Check :ref:`fastddsgen_supported_options` for more information about the ``-extrastg`` option. ->>>>>>> bf0dfe6 (Docs - Apply custom templates to included IDL files (#1066)) Annotations --------------