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

Code::Blocks project file exporter #6481

Merged
merged 8 commits into from
Apr 9, 2018

Conversation

tsailer
Copy link
Contributor

@tsailer tsailer commented Mar 27, 2018

Description

Add an exporter for Code::Blocks project files. It outputs native Code::Blocks projects, i.e. not makefile projects. Furthermore, if the target is NCS36510, it adds the necessary post build steps to add the required fib block to the generated elf file.

Pull request type

[ ] Fix
[ ] Refactor
[X] New target
[ ] Feature
[ ] Breaking change

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split all lines around 80 characters.

Further, this seems very NCS36510 specific. Could you submit the exporter and the NCS changes separately?

KEEP(*(.trim))
} > TRIM

.isr_vector :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change, and all other changis in this file, are not related to creating an exporter. Please submit them as another PR.

if f.startswith('-O') or f.startswith('-g'):
debug_flags.append(f)
continue
comp_flags.append(f)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be in an else branch. Please rewrite the prior 4 lines as:

if f.startswith('-O') or f.startswith('-g):
    debug_flags.append(f)
else:
    comp_flags.append(f)

debug_flags = []
next_is_include = False
for f in self.flags['c_flags'] + self.flags['cxx_flags'] + self.flags['common_flags']:
f=f.strip()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put spaces around the =.

{% if ncs36510addfib -%}
<ExtraCommands>
<Add after="arm-none-eabi-objcopy -O ihex -R .fib -R .trim bin/Debug/{{project_name}}.elf bin/Debug/{{project_name}}.hex" />
<Add after="mbed-os/tools/export/codeblocks/ncs36510addfib.py bin/Debug/{{project_name}}.hex bin/Debug/{{project_name}}.fib" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not allowed: after export on the website, a project will not contain the tools.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where would be the proper place for such a tool?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where things get tricky. You could export that python script so that it is in the root of the project, then you can rely on it's existence. You can rely on anything in resources, and anything you explicitly create, so if you explicitly create the file, you're good to go. I, and possibly future users, would appreciate an addition to the third party notes section explaining that you need Python to compile with Code::Blocks and NCS36510.

{% if ncs36510addfib -%}
<ExtraCommands>
<Add after="arm-none-eabi-objcopy -O ihex -R .fib -R .trim bin/Release/{{project_name}}.elf bin/Release/{{project_name}}.hex" />
<Add after="mbed-os/tools/export/codeblocks/ncs36510addfib.py bin/Release/{{project_name}}.hex bin/Release/{{project_name}}.fib" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for this line.

inc_dirs = [x for x in inc_dirs if x is not None and x != '' and x != '.' and not x.startswith('bin') and not x.startswith('obj')];

c_sources = [self.filter_dot(s) for s in self.resources.c_sources]
targ = TARGET_MAP[self.target]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will not have any configuration variables overridden on this target, making configuration incorrect. Please use self.toolchain.target instead.

theotherjimmy
theotherjimmy previously approved these changes Mar 27, 2018
Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks.

@theotherjimmy
Copy link
Contributor

/morph build

@mbed-ci
Copy link

mbed-ci commented Mar 29, 2018

Build : SUCCESS

Build number : 1626
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6481/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Mar 29, 2018

@mbed-ci
Copy link

mbed-ci commented Mar 29, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 3, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Apr 3, 2018

Build : SUCCESS

Build number : 1641
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6481/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 3, 2018

Similar problem with jenkins CI as reported here #6510 (comment), investigating

@mbed-ci
Copy link

mbed-ci commented Apr 3, 2018

@maclobdell
Copy link
Contributor

cc @ARMmbed/team-onsemi

@mbed-ci
Copy link

mbed-ci commented Apr 3, 2018

@cmonr
Copy link
Contributor

cmonr commented Apr 3, 2018

/morph mbed2-build

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 6, 2018

@tsailer Is this completed? I noticed some new commits. Restarting the CI

/morph build

@tsailer
Copy link
Contributor Author

tsailer commented Apr 6, 2018

@0xc0170 yes, the generic part of the exporter is finished now

@mbed-ci
Copy link

mbed-ci commented Apr 6, 2018

Build : SUCCESS

Build number : 1674
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/6481/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Apr 6, 2018

@theotherjimmy
Copy link
Contributor

No failures on that exporter job...

@mbed-ci
Copy link

mbed-ci commented Apr 6, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2018

/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Apr 9, 2018

@0xc0170 0xc0170 removed the needs: CI label Apr 9, 2018
Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

@theotherjimmy theotherjimmy merged commit 854e436 into ARMmbed:master Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants