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

[20235] Add flat-output-dir flag to ignore inputs relative paths #287

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
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