-
Notifications
You must be signed in to change notification settings - Fork 207
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
Use CommandLineUtil to split and join command lines in CBS Makefile support #1073
base: main
Are you sure you want to change the base?
Conversation
…upport Without this the build and clean command entered in the CBS settings could be parsed and re-assembled incorrectly. A simple example is that an extra space (e.g. "make clean") would lead to an error when running make like: ``` make: *** empty string invalid as file name. Stop. ``` This happened because the code used trivial split on " " and join with " " to handle parsing that command line string into array of arguments. This change fixes that by using the functionality already available in CommandLineUtil Fixes eclipse-cdt#1072
Initially CommandLineUtil.argumentsToString was used to provide properly quoted string when interacting with GDB. But it is also useful to print a string that can be copied + pasted to a terminal for the user. When doing this the always quote every argument looks less nice, so this change updates the code to only quote argument if needed. Tests have also been added for the quoting. Improves look and feel of changes in eclipse-cdt#1073
@@ -24,6 +24,11 @@ The following classes have been removed or modified in API breaking ways: | |||
- spelling corrected for methods with Uninitialized in the name | |||
- setWarnUnused renamed to setWarnUnusedVars and isWarnUnused renamed to isWarnUnusedVars | |||
|
|||
### StandardBuildConfiguration.setBuildCommand(String[]) and StandardBuildConfiguration.setCleanCommand(String[]) removed |
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.
@ewaterlander I have gone back and forth a little on straight out removing this API in favour of my new code. Please let me know if you are depending on the array version of setBuildCommand and setCleanCommand.
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 Jonah,
I'm not depending on the array versions of these methods.
See #1074 |
Without this the build and clean command entered in the CBS settings could be parsed and re-assembled incorrectly.
A simple example is that an extra space (e.g. "make clean") would lead to an error when running make like:
This happened because the code used trivial split on " " and join with " " to handle parsing that command line string into array of arguments. This change fixes that by using the functionality already available in CommandLineUtil
Fixes #1072
For example, when building with a quoted argument with a space it works now, and it also quotes the output correctly in the Console so it can be copied and pasted if needed:
Note that
make
, and other arguments that don't need quoting are always output quoted. A separate PR will address that.