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

Support for Qt Creator Generic project export and associated Makefile #4115

Merged
merged 4 commits into from Apr 10, 2017

Conversation

Projects
None yet
6 participants
@cvtsi2sd
Contributor

cvtsi2sd commented Apr 5, 2017

Description

This commit adds minimal support to mbed export to generate Qt Creator Generic Projects.

Status

READY


Link to my profile, with signed contributor agreement: https://developer.mbed.org/users/cvtsi2sd/

@cvtsi2sd cvtsi2sd changed the title from Added minimal support for Qt Creator projects to Added minimal support for Qt Creator Generic projects Apr 5, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 5, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 5, 2017

@cvtsi2sd Thanks ! What does it minimal ? what it covers? any space for improvements?

@0xc0170 0xc0170 requested a review from theotherjimmy Apr 5, 2017

@cvtsi2sd

This comment has been minimized.

Contributor

cvtsi2sd commented Apr 5, 2017

Well it's minimal because it generates a "Qt Creator Generic" project, which doesn't integrate with Qt Creator's build/debug features (as opposed to qmake, CMake and QBS based projects).

Other than that, I'd say it's complete - it produces all that a QC generic project can accept (files belonging to the project, preprocessor definitions + mbed_config.h, include paths). This enables the project pane, the class view and almost all the editing goodies - clang-based autocomplete/instant error reporting/fixits, go to definition, find usages, refactoring actions and the like.
mbed_qtcreator

@theotherjimmy

theotherjimmy requested changes Apr 5, 2017 edited

This exporter looks great!

I have one nit: You generate files in the current directory only. For this exporter to work as an online service, it cannot modify the root of the project. In the online export service, we export to a temporary directory.

Could you change the open calls to heed the export directory and add the files you generate to the generated_files member?

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 5, 2017

Another note: your code might be made simpler if you use the jinja2 template system and the self.gen_file() method

@cvtsi2sd

This comment has been minimized.

Contributor

cvtsi2sd commented Apr 5, 2017

Export directory: sure, for some reason I was convinced that this was handled by invoking mbed directly from the other directory, and providing an appropriate --source option (as you do e.g. in cmake to have an out-of-tree build); I'll fix it this evening.

Jinja: I considered that when looking at the other exporters, but the format is so trivial that it seemed to me that it would just spread around the logic for no particular gain. OTOH if it already manages the subtleties above I may switch to it.

@cvtsi2sd

This comment has been minimized.

Contributor

cvtsi2sd commented Apr 5, 2017

I also just noticed that, although in a "generic project" it's not possible to specify the build steps through the documented files, by default Qt Creator tries to launch make in the project directory when asked to build the project, so it turns out that it may be useful to generate a Makefile as well.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 5, 2017

@cvtsi2sd You're in luck! You can inherit from the GCC ARM Makefile exporter and call the super class generate. That will get you a makefile without any work by you.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 5, 2017

OTOH if it already manages the subtleties above I may switch to it.

It does.

@cvtsi2sd cvtsi2sd force-pushed the cvtsi2sd:master branch Apr 6, 2017

QtCreator exporter: switch to jinja-based templates
this also makes so that the export directory setting is honored

@cvtsi2sd cvtsi2sd force-pushed the cvtsi2sd:master branch to 70412ec Apr 6, 2017

Qt Creator exporter: added derivation from GccArm Makefile
this allows Qt Creator to build the generated project "out of the box",
enabling integration with the "Issues" list
@cvtsi2sd

This comment has been minimized.

Contributor

cvtsi2sd commented Apr 6, 2017

Ok, I switched to Jinja2 templates and added the Makefile generation, everything seems to be working well!

@0xc0170 0xc0170 added needs: work and removed needs: review labels Apr 6, 2017

@@ -0,0 +1 @@
[General]

This comment has been minimized.

@theotherjimmy

theotherjimmy Apr 6, 2017

Contributor

10/10 best template

This comment has been minimized.

@cvtsi2sd

cvtsi2sd Apr 6, 2017

Contributor

Hahaha I told you that I was a bit ashamed to inconvenience Jinja just for this kind of output. 😄

This comment has been minimized.

@theotherjimmy

theotherjimmy Apr 6, 2017

Contributor

Now it's there if we need to add something to that configuration file.

@@ -0,0 +1,68 @@
"""
mbed SDK
Copyright (c) 2014-2016 ARM Limited

This comment has been minimized.

@theotherjimmy

theotherjimmy Apr 6, 2017

Contributor

Maybe extend this to 2017?

This comment has been minimized.

@cvtsi2sd

cvtsi2sd Apr 6, 2017

Contributor

Done!

@theotherjimmy

Nice job! LGTM

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 6, 2017

@cvtsi2sd Thanks so much for the exporter.

@0xc0170 After export-build finishes this is Ready for Merge

/morph export-build

@theotherjimmy theotherjimmy added needs: CI and removed needs: work labels Apr 6, 2017

@cvtsi2sd cvtsi2sd changed the title from Added minimal support for Qt Creator Generic projects to Support for Qt Creator Generic projects and associated Makefile Apr 6, 2017

@cvtsi2sd cvtsi2sd changed the title from Support for Qt Creator Generic projects and associated Makefile to Support for Qt Creator Generic project export and associated Makefile Apr 6, 2017

@bridadan

This comment has been minimized.

Contributor

bridadan commented Apr 6, 2017

FYI, pretty sure the export-build test will fail at the moment due to an issue with gnuarmeclipse. The issue is being addressed in #4069.

@mbed-bot

This comment has been minimized.

mbed-bot commented Apr 7, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 153

Exporter Build failed!

@bridadan bridadan referenced this pull request Apr 7, 2017

Merged

Update gnuarmeclipse to preprocess linker scripts #4069

3 of 3 tasks complete
@bridadan

This comment has been minimized.

Contributor

bridadan commented Apr 7, 2017

I've since disabled the exporter for now to test the release branch, so I'll go ahead and test this one now as well (should be passing)

/morph export-build

@mbed-bot

This comment has been minimized.

mbed-bot commented Apr 7, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 155

All exports and builds passed!

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Apr 10, 2017

@sg-

This comment has been minimized.

Member

sg- commented Apr 10, 2017

@cvtsi2sd Can you also write a handbook page on how to use this exporter? https://github.com/ARMmbed/Handbook/tree/5.4

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 10, 2017

@sg- are you going to block merging this until we get a PR for adding this exporter to the handbook?

@cvtsi2sd

This comment has been minimized.

Contributor

cvtsi2sd commented Apr 10, 2017

@sg- I hope I did it correctly, there isn't much to write about this, so I essentially outlined what is supported and how to use it.
ARMmbed/mbed-os-5-docs#146

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 10, 2017

Thanks @cvtsi2sd. Looks like nothing is blocking this.

@theotherjimmy theotherjimmy merged commit 55884de into ARMmbed:master Apr 10, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-export-build Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 21, 2017

@theotherjimmy release label for this one please?

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 21, 2017

whoops. I have got to get that habit going.

exmachina-auto-deployer pushed a commit to exmachina-dev/mbed-os that referenced this pull request May 16, 2017

Merge tag 'mbed-os-5.4.5' of github.com:ARMmbed/mbed-os into feature/…
…lwip_broadcast

Release mbed OS 5.4.5 and mbed lib v142

Ports for Upcoming Targets

Fixes and Changes

4059: [Silicon Labs] Rename targets ARMmbed#4059
4115: Support for Qt Creator Generic project export and associated Makefile ARMmbed#4115
3915: Feature vscode ARMmbed#3915
4205: tests: race test - add not supported for single threaded env ARMmbed#4205
4187: [NCS36510] Reduce default heap size allocated by IAR to 1/4 of RAM ARMmbed#4187
4145: test - add nanostack to examples.json file ARMmbed#4145
4093: Update.py: New feature - update a branch instead of a fork, plus general improvements. ARMmbed#4093
4225: fixed missing device_name for xDot and removed progen ARMmbed#4225
4243: Config: config header file should contain new line ARMmbed#4243
4251: Fix C++11 build error w/ u-blox EVK-ODIN-W2 ARMmbed#4251
4236: STM32 Fixed warning related to __packed redefinition ARMmbed#4236
4224: Add `mbed new .` output to export ARMmbed#4224
4190: LPC4088: Enable LWIP feature ARMmbed#4190
4136: Error when bootloader is specified but does not exist ARMmbed#4136
3881: Remove debug links to printf/exit in NDEBUG builds ARMmbed#3881
4260: Inherit Xadow M0 target from LPC11U35_501 ARMmbed#4260
4249: Add consistent button names across targets ARMmbed#4249
4254: Removed unused variable in TARGET_NXP/lpc17_emac.c ARMmbed#4254
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment