Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix including an IDL file with no structures [19387] #212

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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