Skip to content

e2 studio exporter update #4959

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

Merged
merged 1 commit into from
Sep 25, 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
414 changes: 414 additions & 0 deletions tools/export/e2studio/.cproject.tmpl

Large diffs are not rendered by default.

43 changes: 21 additions & 22 deletions tools/export/e2studio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,34 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
from os.path import splitext, basename
from tools.export.gnuarmeclipse import GNUARMEclipse

from tools.export.exporters import Exporter, deprecated_exporter

@deprecated_exporter
class E2Studio(Exporter):
class E2Studio(GNUARMEclipse):
NAME = 'e2 studio'
TOOLCHAIN = 'GCC_ARM'

TARGETS = [
'RZ_A1H',
]

# override
def generate(self):
libraries = []
for lib in self.resources.libraries:
l, _ = splitext(basename(lib))
libraries.append(l[3:])

ctx = {
'name': self.project_name,
'include_paths': self.resources.inc_dirs,
'linker_script': self.resources.linker_script,

jinja_ctx = self.collect_tmpl_vars()

'object_files': self.resources.objects,
'libraries': libraries,
'symbols': self.toolchain.get_symbols()
}
self.gen_file('e2studio/%s_project.tmpl' % self.target.lower(), ctx, '.project')
self.gen_file('e2studio/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')
self.gen_file('e2studio/%s_gdbinit.tmpl' % self.target.lower(), ctx, '.gdbinit')
self.gen_file('e2studio/launch.tmpl', ctx, '%s OpenOCD.launch' % self.project_name)
print
print 'Create a e2 studio C++ managed project'
print 'Project name: {0}'.format(self.project_name)
print 'Target: {0}'.format(self.toolchain.target.name)
print 'Toolchain: {0}'.format(self.TOOLCHAIN)

self.gen_file('e2studio/.cproject.tmpl', jinja_ctx, '.cproject', trim_blocks=True, lstrip_blocks=True)
self.gen_file('e2studio/.gdbinit.tmpl', jinja_ctx, '.gdbinit')
self.gen_file('e2studio/launch.tmpl', jinja_ctx, '%s OpenOCD.launch' % self.project_name, trim_blocks=True, lstrip_blocks=True)

self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx, '.project', trim_blocks=True, lstrip_blocks=True)
self.gen_file('gnuarmeclipse/mbedignore.tmpl', jinja_ctx, '.mbedignore')
self.gen_file('gnuarmeclipse/makefile.targets.tmpl', jinja_ctx, 'makefile.targets', trim_blocks=True, lstrip_blocks=True)

print
print 'Done. Import the project located at \'{0}\' in e2 studio.'.format(self.project_name)
324 changes: 0 additions & 324 deletions tools/export/e2studio/rz_a1h_cproject.tmpl

This file was deleted.

27 changes: 0 additions & 27 deletions tools/export/e2studio/rz_a1h_project.tmpl

This file was deleted.

318 changes: 0 additions & 318 deletions tools/export/e2studio/vk_rz_a1h_cproject.tmpl

This file was deleted.

29 changes: 0 additions & 29 deletions tools/export/e2studio/vk_rz_a1h_gdbinit.tmpl

This file was deleted.

27 changes: 0 additions & 27 deletions tools/export/e2studio/vk_rz_a1h_project.tmpl

This file was deleted.

28 changes: 18 additions & 10 deletions tools/export/gnuarmeclipse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,13 @@ def toolchain_flags(self, toolchain):
flags['cxx_flags'] += header_options
return flags

# override
def generate(self):
"""
Generate the .project and .cproject files.
"""
def validate_resources(self):
if not self.resources.linker_script:
raise NotSupportedException("No linker script found.")

print
print 'Create a GNU ARM Eclipse C++ managed project'
print 'Project name: {0}'.format(self.project_name)
print 'Target: {0}'.format(self.toolchain.target.name)
print 'Toolchain: {0}'.format(self.TOOLCHAIN)
def create_jinja_ctx(self):

self.validate_resources()

self.resources.win_to_unix()

Expand Down Expand Up @@ -276,6 +270,20 @@ def generate(self):
# will be called repeatedly, to generate multiple UIDs.
'u': u,
}
return jinja_ctx

# override
def generate(self):
"""
Generate the .project and .cproject files.
"""
jinja_ctx = self.create_jinja_ctx()

print
print 'Create a GNU ARM Eclipse C++ managed project'
print 'Project name: {0}'.format(self.project_name)
print 'Target: {0}'.format(self.toolchain.target.name)
print 'Toolchain: {0}'.format(self.TOOLCHAIN)

self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx,
'.project', trim_blocks=True, lstrip_blocks=True)
Expand Down