-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Correctly format include paths for eclipse export #3531
Correctly format include paths for eclipse export #3531
Conversation
Eclipse CDT expects the include paths to include the project name like '/<project>/<include-path>' for workspace include directories. See issue ARMmbed#3529.
@@ -12,13 +14,14 @@ def generate(self): | |||
py_ocd_settings launch file, and software link .p2f file | |||
""" | |||
super(Eclipse, self).generate() | |||
include_paths_replace_re= re.compile(r'(^[.]/|^[.]$)') |
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.
Could this variable have a shorter name? maybe starting_dot
? which implies that this is the same as <string>.startswith(".")
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.
Done.
ctx = { | ||
'name': self.project_name, | ||
'elf_location': join('BUILD',self.project_name)+'.elf', | ||
'c_symbols': self.toolchain.get_symbols(), | ||
'asm_symbols': self.toolchain.get_symbols(True), | ||
'target': self.target, | ||
'include_paths': self.resources.inc_dirs, | ||
'include_paths': map(lambda s: include_paths_replace_re.sub('%s/' % self.project_name, s), self.resources.inc_dirs), |
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.
For consistency with the rest of the tools, could this be a comprehension?
'include_paths': [starrting_dot.sub('%s/' % self.project_name, inc) for inc in self.resources.inc_dirs],
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.
Done.
I'm a python newbie did not know about comprehension.
Thanks
I like where this is going! Did you test it manually? is that why you checked the "Tests" Todo? |
- Shorten variable name - Use comprehension to format include paths
@theotherjimmy Yes I just did a manual test on my machine and did not add a unit test for it. Was probably to quick to check "Tests" Todo. I'm new to python and new to mbed-os, could you point me to the place where I should add a unit test and how to run then. I tried to run:
But this failed with:
|
Sorry about that @bittailor #3538 has the fix. |
For this PR, a manual check that it looks correct on your end will do. I don't know how we would automate that check at the moment. Suggestions welcome! Because you said that you have already done the manual check, I checked the "Tests" todo for you. |
Eclipse CDT expects the include paths to include the project name like '//' for workspace include directories.
See issue #3529.
Status
READY
Migrations
NO
Related PRs
Todos
Deploy notes
Steps to test or reproduce
See issue #3529