@@ -1035,18 +1035,16 @@ private Project parseIDL(
1035
1035
maintemplates .getTemplate ("com/eprosima/fastdds/idl/templates/InterfaceDetails.stg" ), m_replace );
1036
1036
}
1037
1037
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 ))
1039
1041
{
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 );
1049
1046
}
1047
+
1050
1048
returnedValue &=
1051
1049
Utils .writeFile (output_dir + ctx .getFilename () + "PubSubTypes.hpp" ,
1052
1050
maintemplates .getTemplate ("com/eprosima/fastdds/idl/templates/DDSPubSubTypeHeader.stg" ), m_replace );
@@ -1056,15 +1054,13 @@ private Project parseIDL(
1056
1054
maintemplates .getTemplate ("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg" ), m_replace ))
1057
1055
{
1058
1056
project .addCommonSrcFile (relative_dir + ctx .getFilename () + "PubSubTypes.cxx" );
1059
- if (ctx .existsLastStructure () || ctx .isThereIsInterface ())
1057
+
1058
+ if (m_python )
1060
1059
{
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 );
1068
1064
}
1069
1065
}
1070
1066
@@ -1288,45 +1284,36 @@ private boolean genSolution(
1288
1284
1289
1285
final String METHOD_NAME = "genSolution" ;
1290
1286
boolean returnedValue = true ;
1291
- if (m_atLeastOneStructure == true )
1287
+ if (m_exampleOption != null )
1292
1288
{
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 + "..." );
1296
1290
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" ))
1298
1300
{
1299
- System .out .println ("Generating CMakeLists solution" );
1300
- returnedValue = genCMakeLists (solution );
1301
+ returnedValue = genVS (solution , null , "16" , "142" );
1301
1302
}
1302
- else if (m_exampleOption .substring ( 3 , 6 ). equals ( "Win " ))
1303
+ else if (m_exampleOption .startsWith ( "x64 " ))
1303
1304
{
1304
- System .out .println ("Generating Windows solution" );
1305
- if (m_exampleOption .startsWith ("i86" ))
1305
+ for (int index = 0 ; index < m_vsconfigurations .length ; index ++)
1306
1306
{
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" );
1320
1308
}
1309
+ returnedValue = genVS (solution , "x64" , "16" , "142" );
1310
+ }
1311
+ else
1312
+ {
1313
+ returnedValue = false ;
1321
1314
}
1322
1315
}
1323
1316
}
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
- }
1330
1317
1331
1318
return returnedValue ;
1332
1319
}
0 commit comments