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

Exporter for Netbeans GCC_ARM #5532

Merged
merged 12 commits into from Jan 22, 2018

Conversation

Projects
None yet
7 participants
@cmens23

cmens23 commented Nov 20, 2017

Description

Added a Netbeans Exporter which creates following items:

  • nbproject Directory
  • nbproject/configurations.xml
  • nbproject/project.xml
  • ./.mbedignore (which contains the nbproject Folder)
  • ./Makefile (Netbeans Makefile)

Status

READY

  • Linking works and is using the Linker Script
  • Code Assistance works with one exclusion in mbed-os/rtos/TARGET_CORTEX/rtx5/core_cm.h -> Line 57: #error "Unknown ARM Architecture!"

Migrations

File __init__.py in mbed-os\tools\export is modified and has a new configuration:

  • netbeans

Related PRs

NONE

Todos

  • Tests
  • Documentation

Deploy notes

NONE

Steps to test or reproduce

Execute following command to get a Netbeans Project:
mbed-cli export -i netbeans

c.mandl added some commits Nov 20, 2017

@0xc0170 0xc0170 requested a review from theotherjimmy Nov 20, 2017

c.mandl

@cmens23 cmens23 changed the title from Exporter for Netbeans to Exporter for Netbeans GCC_ARM Nov 24, 2017

Clemens Mandl
@theotherjimmy

Minor nit.

@@ -207,11 +211,19 @@ def create_jinja_ctx(self):
sources = [self.filter_dot(field) for field in sources]
include_paths = [self.filter_dot(field) for field in self.resources.inc_dirs]
sys_libs = [self.prepare_sys_lib(lib) for lib
in self.toolchain.sys_libs]
preproc = " ".join([part for part

This comment has been minimized.

@theotherjimmy

theotherjimmy Nov 27, 2017

Contributor

You don't need this list comprehension. Could you remove it?

This comment has been minimized.

@cmens23

cmens23 Nov 28, 2017

Sorry, I don't understand. Could you please more specific?

This comment has been minimized.

@theotherjimmy

theotherjimmy Nov 28, 2017

Contributor
        preproc = " ".join([part for part
                            in ([basename(self.toolchain.preproc[0])] +
                                self.toolchain.preproc[1:] +
                                self.toolchain.ld[1:])])

==

        preproc = " ".join([basename(self.toolchain.preproc[0])] +
                           self.toolchain.preproc[1:] +
                           self.toolchain.ld[1:])

This comment has been minimized.

@cmens23
@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Nov 27, 2017

@cmens23 Why did you add your own Makefile exporter? could you have imported a Makefile exporter from the makefile module and inherited from that instead?

@theotherjimmy

More nits. I apparently only reviewed the last commit last time. huh.

def prepare_sys_lib(libname):
return "-l" + libname
def toolchain_flags(self, toolchain):

This comment has been minimized.

@theotherjimmy

theotherjimmy Nov 27, 2017

Contributor

This is the same as the Exporter.flags attribute. Is there some reason that you could not use that?

This comment has been minimized.

@cmens23
def generate(self):
"""Generate Makefile, configurations.xml & project.xml Netbeans project file
"""
# super(Netbeans, self).generate()

This comment has been minimized.

@theotherjimmy

theotherjimmy Nov 27, 2017

Contributor

Could you remove this commented out code?

This comment has been minimized.

@cmens23
# profile_names = [basename(fn).replace(".json", "")
# for fn in file_names]
# print profile_names

This comment has been minimized.

@theotherjimmy

theotherjimmy Nov 27, 2017

Contributor

Could you remove commented out code? (5 lines)

This comment has been minimized.

@cmens23
prev_dir = cur_dir
output.append('<itemPath>' + str(item) + '</itemPath>')
# if last iteration close all open tags
if idx == len(file_list) - 1 and cur_dir != '':

This comment has been minimized.

@theotherjimmy

theotherjimmy Nov 27, 2017

Contributor

I have a refactor proposal:
Remove the enumerate from the loop, move dir_depth out of the loop and close all open tags after the loop. I think that may make for clearer code. For example:

for item in file_list:
    ...
last_dir_len = len(os.path.dirname(file_list[-1]).split(os.path.sep))
output.append('</logicalFolder>' * last_dir_len)
return output

This comment has been minimized.

@cmens23
@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Nov 27, 2017

@cmens23 I'm excited to see net beans become an Mbed OS exporter! Please let me know if I can help with the porting effort.

Clemens Mandl added some commits Nov 28, 2017

@adbridge

This comment has been minimized.

Contributor

adbridge commented Dec 29, 2017

@theotherjimmy Are you happy with the rework ?

@mbed-ci

This comment has been minimized.

mbed-ci commented Dec 29, 2017

Automatic CI verification build not done, please verify manually.

c_sources = [self.filter_dot(field) for field in getattr(self.resources, 'c_sources')]
cpp_sources = [self.filter_dot(field) for field in getattr(self.resources, 'cpp_sources')]
s_sources = [self.filter_dot(field) for field in getattr(self.resources, 's_sources')]
headers = [self.filter_dot(field) for field in getattr(self.resources, 'headers')]

This comment has been minimized.

@theotherjimmy

theotherjimmy Jan 8, 2018

Contributor

Please don't use getattr when you don't need to. It can make the code much harder to follow. This applies to the preceding 4 lines.

sys_libs = [self.prepare_sys_lib(lib) for lib
in self.toolchain.sys_libs]
preproc = " ".join([basename(self.toolchain.preproc[0])] +
self.toolchain.preproc[1:] +

This comment has been minimized.

@theotherjimmy

theotherjimmy Jan 8, 2018

Contributor

This indentation looks off. I think the s in self should line up with the [ in the previous line.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 12, 2018

@theotherjimmy Thoughts on the latest commits?

@theotherjimmy

Looks good! Thanks for the exporter.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jan 12, 2018

@cmens23 If there is a method to build an exported project from the command line, we can put this in our CI to prevent subsequent PRs from breaking this exporter.

@cmonr cmonr added needs: CI and removed needs: review labels Jan 12, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 12, 2018

/morph build

1 similar comment
@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 15, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 15, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@MikeDK

This comment has been minimized.

Contributor

MikeDK commented Jan 15, 2018

@theotherjimmy regarding your question about a method to build from command line...: unfortunately, the needed sub-makefiles are only generated if one starts a build from within the netbeans IDE at least once. From this time on, the sub-makefiles are present in the nbproject directory, and one can issue a simple "make" from the project root.

In MPLAB-X, which is basically a microchip-specific fork of netbeans, there is a .jar file which does exactly what we would need: generate the sub-makefiles from the command line ... but unfortunately this looks like something microchip did only for their MPLAB-X IDE ... I cannot find similar tool in vanilla netbeans :(

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 15, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 15, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit c2784c8 into ARMmbed:master Jan 22, 2018

19 checks passed

ARM mbed CI Verification build successful.
Details
AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter 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 Local events testing has passed
Details
travis-ci/littlefs Local littlefs testing has passed
Details
travis-ci/mbed2-ATMEL Local mbed2-ATMEL testing has passed
Details
travis-ci/mbed2-MAXIM Local mbed2-MAXIM testing has passed
Details
travis-ci/mbed2-NORDIC Local mbed2-NORDIC testing has passed
Details
travis-ci/mbed2-NUVOTON Local mbed2-NUVOTON testing has passed
Details
travis-ci/mbed2-NXP Local mbed2-NXP testing has passed
Details
travis-ci/mbed2-RENESAS Local mbed2-RENESAS testing has passed
Details
travis-ci/mbed2-SILICON_LABS Local mbed2-SILICON_LABS testing has passed
Details
travis-ci/mbed2-STM Local mbed2-STM testing has passed
Details
travis-ci/tools Local tools testing has passed
Details

@cmonr cmonr removed the needs: CI label Jan 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment