Skip to content

[23150] Apply user template to included IDL files#472

Merged
MiguelCompany merged 2 commits intomasterfrom
user_template_for_included_idl
May 16, 2025
Merged

[23150] Apply user template to included IDL files#472
MiguelCompany merged 2 commits intomasterfrom
user_template_for_included_idl

Conversation

@cferreiragonz
Copy link
Contributor

@cferreiragonz cferreiragonz commented May 13, 2025

Description

This PR adds the required logic to apply user templates to included IDL files.
If the output file name specified in -extrastg contains the character '@', the custom template will be also applied to included IDL files. The '$' will be replaced with the included file name.

Usage example:
-extrastg /path/to/template/Custom.stg @MyCustomTemplate.cpp

Above command will generate file: HelloWorldMyCustomTemplate.cpp in case HelloWorld.idl was included.

@Mergifyio backport 4.0.x 3.3.x 2.5.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • N/A Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • New feature has been documented/Current behavior is correctly described in the documentation.
  • Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
@cferreiragonz cferreiragonz requested review from richiprosima and removed request for richiprosima May 13, 2025 08:49
@github-actions github-actions bot added the ci-pending PR which CI is running label May 13, 2025
@MiguelCompany MiguelCompany added this to the v4.1.0 milestone May 13, 2025
@MiguelCompany
Copy link
Member

Remember to escape the '$' when calling Fast DDS Gen from CLI:
-extrastg /path/to/template/Custom.stg \$MyCustomTemplate.cpp

I didn't think about this. It might be better to use another character like @

Copy link
Member

@MiguelCompany MiguelCompany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should backport this. Please include backports in the description.

Documentation PR pending.

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
@cferreiragonz cferreiragonz added ready-to-merge Ready to be merged. CI and changes have been reviewed and approved. and removed ci-pending PR which CI is running labels May 16, 2025
@MiguelCompany MiguelCompany merged commit e180325 into master May 16, 2025
4 checks passed
@MiguelCompany MiguelCompany deleted the user_template_for_included_idl branch May 16, 2025 08:03
@MiguelCompany
Copy link
Member

@Mergifyio backport 4.0.x 3.3.x 2.5.x

1 similar comment
@MiguelCompany
Copy link
Member

@Mergifyio backport 4.0.x 3.3.x 2.5.x

@mergify
Copy link

mergify bot commented May 16, 2025

backport 4.0.x 3.3.x 2.5.x

🟠 Waiting for conditions to match

Details
  • merged [📌 backport requirement]

cferreiragonz added a commit that referenced this pull request May 20, 2025
* Refs #23150: Apply user template to included IDL files

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

* Refs #23150: Apply Review

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
@cferreiragonz
Copy link
Contributor Author

Backport to 4.0.x has been manually done with:

Other backports will be created from that PR

cferreiragonz added a commit that referenced this pull request May 20, 2025
* Refs #23150: Apply user template to included IDL files



* Refs #23150: Apply Review



---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
mergify bot pushed a commit that referenced this pull request May 20, 2025
* Refs #23150: Apply user template to included IDL files

* Refs #23150: Apply Review

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
(cherry picked from commit fbb0672)

# Conflicts:
#	src/main/java/com/eprosima/fastdds/fastddsgen.java
mergify bot pushed a commit that referenced this pull request May 20, 2025
* Refs #23150: Apply user template to included IDL files

* Refs #23150: Apply Review

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
(cherry picked from commit fbb0672)

# Conflicts:
#	src/main/java/com/eprosima/fastdds/fastddsgen.java
cferreiragonz added a commit that referenced this pull request May 20, 2025
* Apply user template to included IDL files (#472) (#474)

* Refs #23150: Apply user template to included IDL files

* Refs #23150: Apply Review

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
(cherry picked from commit fbb0672)

# Conflicts:
#	src/main/java/com/eprosima/fastdds/fastddsgen.java

* Fix Conflicts

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
Co-authored-by: Carlos Ferreira González <carloos.499@gmail.com>
Co-authored-by: cferreiragonz <carlosferreira@eprosima.com>
MiguelCompany added a commit that referenced this pull request May 27, 2025
* Apply user template to included IDL files (#472) (#474)

* Refs #23150: Apply user template to included IDL files

* Refs #23150: Apply Review

---------

Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
(cherry picked from commit fbb0672)

# Conflicts:
#	src/main/java/com/eprosima/fastdds/fastddsgen.java

* 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 <carloos.499@gmail.com>
Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Ready to be merged. CI and changes have been reviewed and approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants