Skip to content

Commit d3b095c

Browse files
authored
Fix typedef-only IDL (#491)
* Refs #23657: Update dds-types-test submodule Signed-off-by: Jesus Perez <[email protected]> * Refs #23657: Fix test generation Signed-off-by: Jesus Perez <[email protected]> * Refs #23657: Always generate *CdrAux.hpp and *PubSubTypes.i Signed-off-by: Jesus Perez <[email protected]> * Refs #23657: Update dds-types-test submodule Signed-off-by: Jesus Perez <[email protected]> --------- Signed-off-by: Jesus Perez <[email protected]>
1 parent b1a003e commit d3b095c

File tree

2 files changed

+35
-48
lines changed

2 files changed

+35
-48
lines changed

src/main/java/com/eprosima/fastdds/fastddsgen.java

Lines changed: 34 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,18 +1035,16 @@ private Project parseIDL(
10351035
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/InterfaceDetails.stg"), m_replace);
10361036
}
10371037

1038-
if (ctx.isThereIsStructOrUnion() || ctx.isThereIsException())
1038+
if (returnedValue &=
1039+
Utils.writeFile(output_dir + ctx.getFilename() + "CdrAux.hpp",
1040+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/TypesCdrAuxHeader.stg"), m_replace))
10391041
{
1040-
if (returnedValue &=
1041-
Utils.writeFile(output_dir + ctx.getFilename() + "CdrAux.hpp",
1042-
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/TypesCdrAuxHeader.stg"), m_replace))
1043-
{
1044-
project.addProjectIncludeFile(relative_dir + ctx.getFilename() + "CdrAux.hpp");
1045-
returnedValue &=
1046-
Utils.writeFile(output_dir + ctx.getFilename() + "CdrAux.ipp",
1047-
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/TypesCdrAuxHeaderImpl.stg"), m_replace);
1048-
}
1042+
project.addProjectIncludeFile(relative_dir + ctx.getFilename() + "CdrAux.hpp");
1043+
returnedValue &=
1044+
Utils.writeFile(output_dir + ctx.getFilename() + "CdrAux.ipp",
1045+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/TypesCdrAuxHeaderImpl.stg"), m_replace);
10491046
}
1047+
10501048
returnedValue &=
10511049
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.hpp",
10521050
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeHeader.stg"), m_replace);
@@ -1056,15 +1054,13 @@ private Project parseIDL(
10561054
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg"), m_replace))
10571055
{
10581056
project.addCommonSrcFile(relative_dir + ctx.getFilename() + "PubSubTypes.cxx");
1059-
if (ctx.existsLastStructure() || ctx.isThereIsInterface())
1057+
1058+
if (m_python)
10601059
{
1061-
if (m_python)
1062-
{
1063-
System.out.println("Generating Swig interface files...");
1064-
returnedValue &= Utils.writeFile(
1065-
output_dir + ctx.getFilename() + "PubSubTypes.i",
1066-
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSwigInterface.stg"), m_replace);
1067-
}
1060+
System.out.println("Generating Swig interface files...");
1061+
returnedValue &= Utils.writeFile(
1062+
output_dir + ctx.getFilename() + "PubSubTypes.i",
1063+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSwigInterface.stg"), m_replace);
10681064
}
10691065
}
10701066

@@ -1288,45 +1284,36 @@ private boolean genSolution(
12881284

12891285
final String METHOD_NAME = "genSolution";
12901286
boolean returnedValue = true;
1291-
if (m_atLeastOneStructure == true)
1287+
if (m_exampleOption != null)
12921288
{
1293-
if (m_exampleOption != null)
1294-
{
1295-
System.out.println("Generating solution for arch " + m_exampleOption + "...");
1289+
System.out.println("Generating solution for arch " + m_exampleOption + "...");
12961290

1297-
if (m_exampleOption.equals("CMake") || m_test)
1291+
if (m_exampleOption.equals("CMake") || m_test)
1292+
{
1293+
System.out.println("Generating CMakeLists solution");
1294+
returnedValue = genCMakeLists(solution);
1295+
}
1296+
else if (m_exampleOption.substring(3, 6).equals("Win"))
1297+
{
1298+
System.out.println("Generating Windows solution");
1299+
if (m_exampleOption.startsWith("i86"))
12981300
{
1299-
System.out.println("Generating CMakeLists solution");
1300-
returnedValue = genCMakeLists(solution);
1301+
returnedValue = genVS(solution, null, "16", "142");
13011302
}
1302-
else if (m_exampleOption.substring(3, 6).equals("Win"))
1303+
else if (m_exampleOption.startsWith("x64"))
13031304
{
1304-
System.out.println("Generating Windows solution");
1305-
if (m_exampleOption.startsWith("i86"))
1305+
for (int index = 0; index < m_vsconfigurations.length; index++)
13061306
{
1307-
returnedValue = genVS(solution, null, "16", "142");
1308-
}
1309-
else if (m_exampleOption.startsWith("x64"))
1310-
{
1311-
for (int index = 0; index < m_vsconfigurations.length; index++)
1312-
{
1313-
m_vsconfigurations[index].setPlatform("x64");
1314-
}
1315-
returnedValue = genVS(solution, "x64", "16", "142");
1316-
}
1317-
else
1318-
{
1319-
returnedValue = false;
1307+
m_vsconfigurations[index].setPlatform("x64");
13201308
}
1309+
returnedValue = genVS(solution, "x64", "16", "142");
1310+
}
1311+
else
1312+
{
1313+
returnedValue = false;
13211314
}
13221315
}
13231316
}
1324-
else
1325-
{
1326-
System.out.println(
1327-
ColorMessage.warning() +
1328-
"No structure found in any of the provided IDL; no example files have been generated");
1329-
}
13301317

13311318
return returnedValue;
13321319
}

thirdparty/dds-types-test

0 commit comments

Comments
 (0)