-
Notifications
You must be signed in to change notification settings - Fork 134
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
Generation of VS Code debug configuration #302
Conversation
I would just commit examples/templates of these In contrast to your proposal this way is more simple and stupid, which is beneficial regarding maintenance, robustness and effectiveness. |
// OMNet++ interface can either be Qtenv or Cmdenv | ||
// "-uQtenv", | ||
"-uCmdenv" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I was wondering, is not QTenv the default graphical environment and CMDenv is deprecated afaik.
I notice this on the website as well.
So should not it be the other way around, QTenv commented in and CMDenv commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that Cmdenv is deprecated but Tkenv. Of course, Cmdenv is not a graphical environment at all but it is very useful for automated/headless simulation runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I mixed that up. Thank you for the clarification.
|
||
# collect libraries for opp_run | ||
set(opp_run_libraries "") | ||
_get_opp_run_dependencies(${args_TARGET} opp_run_dependencies) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the OmnetC++ dependencies am I right?
Do they change frequently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the libraries of Artery (e.g. libartery_core.so
, libtraci.so
, ...). These might change when building Artery with other flags (e.g. libartery_envmod.so
when WITH_ENVMOD is ON) or when you extend Artery with custom functionalities. Basically, they could change with every (re)generation of the build system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if one includes all the libs all the time in the launch.json
? Will this work?
cmake/AddVSCode.cmake
Outdated
# backup existing launch.json | ||
if(EXISTS ${args_FILE}) | ||
string(TIMESTAMP t) | ||
file(COPY_FILE ${args_FILE} ${args_FILE}.${t}) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this does overwrite the file, then custom values get lost, am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a launch.json
is found, it is moved to a new file and suffixed with the current time. This way, you would still have access to custom values, however, you would need to transfer them to newly written launch configuration again manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the biggest drawback especially for people with additional custom Configuration in their launch.json
.
@@ -0,0 +1,40 @@ | |||
function(generate_vscode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A doc-comment explaining the purpose of this function would be beneficial and appreciated 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
I think what this needs is some kind of indirection. |
I welcome any effort to make our lives easier. Just as @Enough7 I am sceptical if overwriting the launch.json is the way to go, though. |
Thanks for your feedback and comments. I agree that overwriting the
An environment file is indeed quite nice and very useful to have. I could imagine a file, containing the However, I encountered several issues after experimenting with it:
I think this approach should work to circumvent the current limitations of VS Code regarding configuration. However, I personally do not like having another runner, if it can be avoided. But if you are more in favor of this approach, I would also be fine going this route :) One further approach could be to utilize CMakes JSON support to modify the |
Maybe Edit: Brainstorming
|
Either deploys a new debug config or updates the previous one without removing other configs.
Thanks for your thoughts on this.
Based on your feedback, I adjusted the current approach to the following:
|
Generation of VS Code debug configuration
The process of adding Artery to VS Code for debugging can be quite error-prone (see #215). This PR adds the generation of a generic launch configuration for VS Code to the build process. It is only generated when building Artery in debug mode and will back up existing launch configurations.
One further consideration would be to build this config only on demand, so it does not clutter the working directory. What do you think?