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

Projects
None yet
6 participants
@tsailer
Contributor

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

@0xc0170 0xc0170 requested a review from theotherjimmy Mar 27, 2018

@theotherjimmy

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 :

This comment has been minimized.

@theotherjimmy

theotherjimmy Mar 27, 2018

Contributor

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)

This comment has been minimized.

@theotherjimmy

theotherjimmy Mar 27, 2018

Contributor

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()

This comment has been minimized.

@theotherjimmy

theotherjimmy Mar 27, 2018

Contributor

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" />

This comment has been minimized.

@theotherjimmy

theotherjimmy Mar 27, 2018

Contributor

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

This comment has been minimized.

@tsailer

tsailer Mar 27, 2018

Contributor

Where would be the proper place for such a tool?

This comment has been minimized.

@theotherjimmy

theotherjimmy Mar 27, 2018

Contributor

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" />

This comment has been minimized.

@theotherjimmy

theotherjimmy Mar 27, 2018

Contributor

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]

This comment has been minimized.

@theotherjimmy

theotherjimmy Mar 27, 2018

Contributor

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

@theotherjimmy

Looks great! Thanks.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Mar 29, 2018

/morph build

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@tsailer tsailer force-pushed the tsailer:exporter-codeblocks branch from 0962c2f to ffbc9ee Apr 2, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 3, 2018

/morph build

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

Member

0xc0170 commented Apr 3, 2018

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

@mbed-ci

This comment has been minimized.

@maclobdell

This comment has been minimized.

Contributor

maclobdell commented Apr 3, 2018

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Apr 3, 2018

/morph mbed2-build

@tsailer tsailer force-pushed the tsailer:exporter-codeblocks branch from 5456369 to 696a7f5 Apr 6, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 6, 2018

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

/morph build

@tsailer

This comment has been minimized.

Contributor

tsailer commented Apr 6, 2018

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

@mbed-ci

This comment has been minimized.

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

This comment has been minimized.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 6, 2018

No failures on that exporter job...

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 9, 2018

/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

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

@theotherjimmy

Looks good. Thanks.

@theotherjimmy theotherjimmy merged commit 854e436 into ARMmbed:master Apr 9, 2018

12 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 8609 cycles
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 10092B (+0.00%)
Details
travis-ci/tools Local tools testing has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment