Skip to content

Commit de6cce7

Browse files
authored
Merge pull request #4168 from theotherjimmy/gnuarmeclipse-more-templates
Generate GNU ARM Eclipse .mbedignore file with jinja2
2 parents af63b57 + 6fa1de2 commit de6cce7

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

tools/export/gnuarmeclipse/__init__.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -273,22 +273,13 @@ def generate(self):
273273
'u': u,
274274
}
275275

276-
# TODO: it would be good to have jinja stop if one of the
277-
# expected context values is not defined.
278276
self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx,
279277
'.project', trim_blocks=True, lstrip_blocks=True)
280278
self.gen_file('gnuarmeclipse/.cproject.tmpl', jinja_ctx,
281279
'.cproject', trim_blocks=True, lstrip_blocks=True)
282280
self.gen_file('gnuarmeclipse/makefile.targets.tmpl', jinja_ctx,
283281
'makefile.targets', trim_blocks=True, lstrip_blocks=True)
284-
285-
if not exists('.mbedignore'):
286-
print
287-
print 'Create .mbedignore'
288-
with open('.mbedignore', 'w') as f:
289-
for bf in build_folders:
290-
print bf + '/'
291-
f.write(bf + '/\n')
282+
self.gen_file('gnuarmeclipse/mbedignore.tmpl', jinja_ctx, '.mbedignore')
292283

293284
print
294285
print 'Done. Import the \'{0}\' project in Eclipse.'.format(self.project_name)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- for config in options.values() -%}
2+
{{config.name}}/*
3+
{% endfor -%}

0 commit comments

Comments
 (0)