Clone of official tools

Revision:
43:2a7da56ebd24
Parent:
41:2a77626a4c21
--- a/export/e2studio/__init__.py	Mon Nov 06 13:17:14 2017 -0600
+++ b/export/e2studio/__init__.py	Tue Sep 25 13:43:09 2018 -0500
@@ -14,6 +14,7 @@
 See the License for the specific language governing permissions and
 limitations under the License.
 """
+from os import remove
 from tools.export.gnuarmeclipse import GNUARMEclipse
 
 class E2Studio(GNUARMEclipse):
@@ -23,26 +24,24 @@
     TARGETS = [
         'RZ_A1H',
         'VK_RZ_A1H',
+        'GR_LYCHEE',
     ]
 
     # override
     def generate(self):
 
-        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)
+        jinja_ctx = self.create_jinja_ctx()
 
         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/launch5x.tmpl', jinja_ctx, '%s OpenOCD 5x.launch' % self.project_name, trim_blocks=True, lstrip_blocks=True)
         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_nonoverwrite('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)
+    @staticmethod
+    def clean(project_name):
+        remove('%s OpenOCD 5x.launch' % project_name)
+        remove('%s OpenOCD.launch' % project_name)