Clone of official tools

Revision:
41:2a77626a4c21
Parent:
40:7d3fa6b99b2b
Child:
43:2a7da56ebd24
--- a/export/e2studio/__init__.py	Tue Oct 10 16:56:30 2017 -0500
+++ b/export/e2studio/__init__.py	Wed Oct 25 14:46:50 2017 -0500
@@ -14,35 +14,35 @@
 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',
+        'VK_RZ_A1H',
     ]
 
+    # override
     def generate(self):
-        libraries = []
-        for lib in self.resources.libraries:
-            l, _ = splitext(basename(lib))
-            libraries.append(l[3:])
+
+        jinja_ctx = self.collect_tmpl_vars()
+            
+        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)
 
-        ctx = {
-            'name': self.project_name,
-            'include_paths': self.resources.inc_dirs,
-            'linker_script': self.resources.linker_script,
-            
-            '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)
+        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)