Skip to content

Commit

Permalink
Refs #20235: Add flat-output-dir flag to ignore inputs relative paths
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed Jan 18, 2024
1 parent 0b04360 commit 84009c0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/main/java/com/eprosima/fastdds/fastddsgen.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ public class fastddsgen
// Testing
private boolean m_test = false;

// Ignore input relative file paths
// generate files under the -d directory
// ignoring the relative dir of the input files
private boolean m_flat_output_dir = false;

// Use to know the programming language
public enum LANGUAGE
{
Expand Down Expand Up @@ -297,6 +302,10 @@ else if (arg.equals("-test"))
{
m_test = true;
}
else if (arg.equals("-flat-output-dir"))
{
m_flat_output_dir = true;
}
else if (arg.equals("-I"))
{
if (count < args.length)
Expand Down Expand Up @@ -663,7 +672,15 @@ private Project parseIDL(
m_localAppProduct, m_type_object_files, m_typesc, m_type_ros2, cdr_version_);

String relative_dir = ctx.getRelativeDir(dependant_idl_dir);
String output_dir = m_outputDir + relative_dir;
String output_dir;
if (!m_flat_output_dir)
{
output_dir = m_outputDir + relative_dir;
}
else
{
output_dir = m_outputDir;
}

// Check the output directory exists or create it.
File dir = new File(output_dir);
Expand Down

0 comments on commit 84009c0

Please sign in to comment.