Skip to content

Commit 9d51b1a

Browse files
committed
Add imports for build
1 parent 32c56b2 commit 9d51b1a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tools/export/mcuxpresso/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@
2424
"""
2525

2626
import copy
27+
import tempfile
28+
import shutil
2729

30+
from subprocess import Popen, PIPE
31+
from os import getcwd, remove
2832
from os.path import splitext, basename, exists
2933
from random import randint
3034

@@ -258,12 +262,12 @@ def build(project_name, log_name="build_log.txt", cleanup=True):
258262
tmp_folder = tempfile.mkdtemp()
259263

260264
cmd = [
261-
'mcuxpressoidec',
265+
'mcuxpressoide',
262266
'--launcher.suppressErrors',
263267
'-nosplash',
264268
'-application org.eclipse.cdt.managedbuilder.core.headlessbuild',
265269
'-data', tmp_folder,
266-
'-import', os.getcwd(),
270+
'-import', getcwd(),
267271
'-cleanBuild', project_name
268272
]
269273

@@ -291,15 +295,15 @@ def build(project_name, log_name="build_log.txt", cleanup=True):
291295
# Cleanup the exported and built files
292296
if cleanup:
293297
if exists(log_name):
294-
os.remove(log_name)
295-
os.remove('.project')
296-
os.remove('.cproject')
298+
remove(log_name)
299+
remove('.project')
300+
remove('.cproject')
297301
if exists('Debug'):
298302
shutil.rmtree('Debug')
299303
if exists('Release'):
300304
shutil.rmtree('Release')
301305
if exists('makefile.targets'):
302-
os.remove('makefile.targets')
306+
remove('makefile.targets')
303307

304308
# Always remove the temporary folder.
305309
if exists(tmp_folder):

0 commit comments

Comments
 (0)