Skip to content

Commit

Permalink
Fix including an IDL file with no structures (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
richiware authored Aug 22, 2023
1 parent 0977d6a commit e752b38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/main/java/com/eprosima/fastdds/fastddsgen.java
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ private Project parseIDL(
returnedValue =
Utils.writeFile(fileNameH, maintemplates.getTemplate("SerializationHeader"), m_replace);
project.addCommonTestingFile(relative_dir + ctx.getFilename() + "PubSubTypes.cxx");

for (String element : project.getFullDependencies())
{
String trimmedElement = element.substring(0, element.length() - 4);// Remove .idl
Expand All @@ -884,29 +884,28 @@ private Project parseIDL(
}

// TODO: Uncomment following lines and create templates
System.out.println("Generating TopicDataTypes files...");
returnedValue &=
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.h",
maintemplates.getTemplate("DDSPubSubTypeHeader"), m_replace);

if (ctx.existsLastStructure())
{
m_atLeastOneStructure = true;
project.setHasStruct(true);

System.out.println("Generating TopicDataTypes files...");
if (returnedValue =
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.h",
maintemplates.getTemplate("DDSPubSubTypeHeader"), m_replace))
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.cxx",
maintemplates.getTemplate("DDSPubSubTypeSource"), m_replace))
{
if (returnedValue =
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.cxx",
maintemplates.getTemplate("DDSPubSubTypeSource"), m_replace))
project.addProjectIncludeFile(relative_dir + ctx.getFilename() + "PubSubTypes.h");
project.addProjectSrcFile(relative_dir + ctx.getFilename() + "PubSubTypes.cxx");
if (m_python)
{
project.addProjectIncludeFile(relative_dir + ctx.getFilename() + "PubSubTypes.h");
project.addProjectSrcFile(relative_dir + ctx.getFilename() + "PubSubTypes.cxx");
if (m_python)
{
System.out.println("Generating Swig interface files...");
returnedValue = Utils.writeFile(
output_dir + ctx.getFilename() + "PubSubTypes.i",
maintemplates.getTemplate("DDSPubSubTypeSwigInterface"), m_replace);
}
System.out.println("Generating Swig interface files...");
returnedValue = Utils.writeFile(
output_dir + ctx.getFilename() + "PubSubTypes.i",
maintemplates.getTemplate("DDSPubSubTypeSwigInterface"), m_replace);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ message(STATUS "Configuring $project.name$...")
add_library($project.name$_lib $project.commonSrcFiles : {$it$}; separator=" "$)
target_link_libraries($project.name$_lib $solution.libraries : {$it$}; separator=" "$)

$if(!project.projectSrcFiles.empty)$
add_executable($project.name$ $project.projectSrcFiles : {$it$}; separator=" "$)
target_link_libraries($project.name$ $solution.libraries : {$it$}; separator=" "$
$project.name$_lib $project.dependencies : {$it$_lib}; separator=" "$)
$endif$


$if(test)$
Expand Down

0 comments on commit e752b38

Please sign in to comment.