Skip to content

Commit 0abfca2

Browse files
author
Bogdan Marinescu
committed
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.
1 parent 86e5761 commit 0abfca2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

workspace_tools/export/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from workspace_tools.utils import mkdir
2323
from workspace_tools.export import uvision4, codesourcery, codered, gccarm, ds5_5, iar
2424
from workspace_tools.export.exporters import zip_working_directory_and_clean_up, OldLibrariesException
25-
25+
from workspace_tools.targets import EXPORT_MAP
2626

2727
EXPORTERS = {
2828
'uvision': uvision4.Uvision4,
@@ -67,6 +67,7 @@ def export(project_path, project_name, ide, target, destination='/tmp/', tempdir
6767
report['errormsg'] = "Unsupported toolchain"
6868
else:
6969
Exporter = EXPORTERS[ide]
70+
target = EXPORT_MAP.get(target, target)
7071
if target not in Exporter.TARGETS:
7172
report['errormsg'] = ERROR_MESSAGE_UNSUPPORTED_TOOLCHAIN % (target, ide)
7273
else:

workspace_tools/targets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,6 @@ def __init__(self):
342342
TARGET_MAP[t.name] = t
343343

344344
TARGET_NAMES = TARGET_MAP.keys()
345+
346+
# Some targets with different name have the same exporters
347+
EXPORT_MAP = {"LPC4088_EA": "LPC4088"}

0 commit comments

Comments
 (0)