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

Generate GNU ARM Eclipse .mbedignore file with jinja2 #4168

Merged
merged 1 commit into from
Apr 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions tools/export/gnuarmeclipse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,22 +273,13 @@ def generate(self):
'u': u,
}

# TODO: it would be good to have jinja stop if one of the
# expected context values is not defined.
self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx,
'.project', trim_blocks=True, lstrip_blocks=True)
self.gen_file('gnuarmeclipse/.cproject.tmpl', jinja_ctx,
'.cproject', trim_blocks=True, lstrip_blocks=True)
self.gen_file('gnuarmeclipse/makefile.targets.tmpl', jinja_ctx,
'makefile.targets', trim_blocks=True, lstrip_blocks=True)

if not exists('.mbedignore'):
print
print 'Create .mbedignore'
with open('.mbedignore', 'w') as f:
for bf in build_folders:
print bf + '/'
f.write(bf + '/\n')
self.gen_file('gnuarmeclipse/mbedignore.tmpl', jinja_ctx, '.mbedignore')

print
print 'Done. Import the \'{0}\' project in Eclipse.'.format(self.project_name)
Expand Down
3 changes: 3 additions & 0 deletions tools/export/gnuarmeclipse/mbedignore.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%- for config in options.values() -%}
{{config.name}}/*
{% endfor -%}