Skip to content

Commit d2ad886

Browse files
Merge pull request #4742 from theotherjimmy/deprecate-exporters
Deprecate unsupported exporters
2 parents 9207365 + 54cb6ef commit d2ad886

File tree

8 files changed

+28
-8
lines changed

8 files changed

+28
-8
lines changed

tools/export/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
'eclipse_armc5' : cdt.EclipseArmc5,
5858
'gnuarmeclipse': gnuarmeclipse.GNUARMEclipse,
5959
'qtcreator': qtcreator.QtCreator,
60-
'zip' : zip.ZIP,
61-
'cmsis' : cmsis.CMSIS,
6260
'vscode_gcc_arm' : vscode.VSCodeGcc,
6361
'vscode_iar' : vscode.VSCodeIAR,
6462
'vscode_armc5' : vscode.VSCodeArmc5

tools/export/atmelstudio/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
import uuid
1818
from os.path import splitext, basename, dirname
1919

20-
from tools.export.exporters import Exporter
20+
from tools.export.exporters import Exporter, deprecated_exporter
2121

2222

23+
@deprecated_exporter
2324
class AtmelStudio(Exporter):
2425
NAME = 'AtmelStudio'
2526
TOOLCHAIN = 'GCC_ARM'
@@ -36,6 +37,10 @@ class AtmelStudio(Exporter):
3637

3738
MBED_CONFIG_HEADER_SUPPORTED = True
3839

40+
@classmethod
41+
def is_target_supported(cls, maybe_supported):
42+
return maybe_supported in cls.TARGETS
43+
3944
def generate(self):
4045

4146
source_files = []

tools/export/coide/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"""
1717
from os.path import splitext, basename
1818

19-
from tools.export.exporters import Exporter
19+
from tools.export.exporters import Exporter, deprecated_exporter
2020

2121

22+
@deprecated_exporter
2223
class CoIDE(Exporter):
2324
NAME = 'CoIDE'
2425
TOOLCHAIN = 'GCC_ARM'

tools/export/e2studio/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"""
1717
from os.path import splitext, basename
1818

19-
from tools.export.exporters import Exporter
19+
from tools.export.exporters import Exporter, deprecated_exporter
2020

21+
@deprecated_exporter
2122
class E2Studio(Exporter):
2223
NAME = 'e2 studio'
2324
TOOLCHAIN = 'GCC_ARM'

tools/export/exporters.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ def __init__(self, func):
2525
def __get__(self, inst, cls):
2626
return self.func(cls)
2727

28+
def deprecated_exporter(CLS):
29+
old_init = CLS.__init__
30+
old_name = CLS.NAME
31+
def __init__(*args, **kwargs):
32+
print("==================== DEPRECATION NOTICE ====================")
33+
print("The exporter %s is no longer maintained, and deprecated." % old_name)
34+
print("%s will be removed from mbed OS for the mbed OS 5.6 release." % old_name)
35+
old_init(*args, **kwargs)
36+
CLS.__init__ = __init__
37+
CLS.NAME = "%s (DEPRECATED)" % old_name
38+
return CLS
39+
2840
class Exporter(object):
2941
"""Exporter base class
3042

tools/export/kds/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"""
1717
from os.path import splitext, basename
1818

19-
from tools.export.exporters import Exporter
19+
from tools.export.exporters import Exporter, deprecated_exporter
2020

2121

22+
@deprecated_exporter
2223
class KDS(Exporter):
2324
NAME = 'Kinetis Design Studio'
2425
TOOLCHAIN = 'GCC_ARM'

tools/export/lpcxpresso/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
"""
1717
from os.path import splitext, basename
1818

19-
from tools.export.exporters import Exporter
19+
from tools.export.exporters import Exporter, deprecated_exporter
2020

21+
@deprecated_exporter
2122
class LPCXpresso(Exporter):
2223
NAME = 'LPCXpresso'
2324
TOOLCHAIN = 'GCC_ARM'

tools/export/simplicity/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"""
1717
from os.path import split,splitext, basename
1818

19-
from tools.export.exporters import Exporter
19+
from tools.export.exporters import Exporter, deprecated_exporter
2020

2121
class Folder:
2222
def __init__(self, name):
@@ -54,6 +54,7 @@ def addChild(self, folderName):
5454

5555
return self.findChild(folderName)
5656

57+
@deprecated_exporter
5758
class SimplicityV3(Exporter):
5859
NAME = 'SimplicityV3'
5960
TOOLCHAIN = 'GCC_ARM'

0 commit comments

Comments
 (0)