Correct mbed export with multiple --source params

pull/6461/head
Jimmy Brisson 2018-02-20 10:44:16 -06:00 committed by adbridge
parent 99a250e9d8
commit 6ddb13573a
1 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@ supported IDEs or project structures.
from __future__ import absolute_import, print_function from __future__ import absolute_import, print_function
import sys import sys
from os.path import (join, abspath, dirname, exists, basename, normpath, from os.path import (join, abspath, dirname, exists, basename, normpath,
realpath, basename) realpath, relpath, basename)
from os import remove from os import remove
ROOT = abspath(join(dirname(__file__), "..")) ROOT = abspath(join(dirname(__file__), ".."))
sys.path.insert(0, ROOT) sys.path.insert(0, ROOT)
@ -48,7 +48,7 @@ def setup_project(ide, target, program=None, source_dir=None, build=None, export
project_name = TESTS[program] project_name = TESTS[program]
else: else:
project_name = basename(normpath(realpath(source_dir[0]))) project_name = basename(normpath(realpath(source_dir[0])))
src_paths = source_dir src_paths = {relpath(path, project_dir): [path] for path in source_dir}
lib_paths = None lib_paths = None
else: else:
test = Test(program) test = Test(program)
@ -254,7 +254,10 @@ def main():
except (NotImplementedError, IOError, OSError): except (NotImplementedError, IOError, OSError):
pass pass
for f in EXPORTERS.values()[0].CLEAN_FILES: for f in EXPORTERS.values()[0].CLEAN_FILES:
remove(f) try:
remove(f)
except (IOError, OSError):
pass
try: try:
export(mcu, options.ide, build=options.build, export(mcu, options.ide, build=options.build,
src=options.source_dir, macros=options.macros, src=options.source_dir, macros=options.macros,