Added export maps

Since some targets with different names use the same exporters (for example
LPC4088_EA and LPC4088), add an "export map" for this situation.
pull/109/head mbed_lib_rev70
Bogdan Marinescu 2013-11-18 20:24:51 +02:00
parent 86e57616ce
commit 0abfca2938
2 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,7 @@ from shutil import copytree, rmtree
from workspace_tools.utils import mkdir
from workspace_tools.export import uvision4, codesourcery, codered, gccarm, ds5_5, iar
from workspace_tools.export.exporters import zip_working_directory_and_clean_up, OldLibrariesException
from workspace_tools.targets import EXPORT_MAP
EXPORTERS = {
'uvision': uvision4.Uvision4,
@ -67,6 +67,7 @@ def export(project_path, project_name, ide, target, destination='/tmp/', tempdir
report['errormsg'] = "Unsupported toolchain"
else:
Exporter = EXPORTERS[ide]
target = EXPORT_MAP.get(target, target)
if target not in Exporter.TARGETS:
report['errormsg'] = ERROR_MESSAGE_UNSUPPORTED_TOOLCHAIN % (target, ide)
else:

View File

@ -342,3 +342,6 @@ for t in TARGETS:
TARGET_MAP[t.name] = t
TARGET_NAMES = TARGET_MAP.keys()
# Some targets with different name have the same exporters
EXPORT_MAP = {"LPC4088_EA": "LPC4088"}