Skip to content

Deprecate unsupported exporters #4742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions tools/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
'eclipse_armc5' : cdt.EclipseArmc5,
'gnuarmeclipse': gnuarmeclipse.GNUARMEclipse,
'qtcreator': qtcreator.QtCreator,
'zip' : zip.ZIP,
'cmsis' : cmsis.CMSIS,
'vscode_gcc_arm' : vscode.VSCodeGcc,
'vscode_iar' : vscode.VSCodeIAR,
'vscode_armc5' : vscode.VSCodeArmc5
Expand Down
7 changes: 6 additions & 1 deletion tools/export/atmelstudio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
import uuid
from os.path import splitext, basename, dirname

from tools.export.exporters import Exporter
from tools.export.exporters import Exporter, deprecated_exporter


@deprecated_exporter
class AtmelStudio(Exporter):
NAME = 'AtmelStudio'
TOOLCHAIN = 'GCC_ARM'
Expand All @@ -36,6 +37,10 @@ class AtmelStudio(Exporter):

MBED_CONFIG_HEADER_SUPPORTED = True

@classmethod
def is_target_supported(cls, maybe_supported):
return maybe_supported in cls.TARGETS

def generate(self):

source_files = []
Expand Down
3 changes: 2 additions & 1 deletion tools/export/coide/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"""
from os.path import splitext, basename

from tools.export.exporters import Exporter
from tools.export.exporters import Exporter, deprecated_exporter


@deprecated_exporter
class CoIDE(Exporter):
NAME = 'CoIDE'
TOOLCHAIN = 'GCC_ARM'
Expand Down
3 changes: 2 additions & 1 deletion tools/export/e2studio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"""
from os.path import splitext, basename

from tools.export.exporters import Exporter
from tools.export.exporters import Exporter, deprecated_exporter

@deprecated_exporter
class E2Studio(Exporter):
NAME = 'e2 studio'
TOOLCHAIN = 'GCC_ARM'
Expand Down
12 changes: 12 additions & 0 deletions tools/export/exporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ def __init__(self, func):
def __get__(self, inst, cls):
return self.func(cls)

def deprecated_exporter(CLS):
old_init = CLS.__init__
old_name = CLS.NAME
def __init__(*args, **kwargs):
print("==================== DEPRECATION NOTICE ====================")
print("The exporter %s is no longer maintained, and deprecated." % old_name)
print("%s will be removed from mbed OS for the mbed OS 5.6 release." % old_name)
old_init(*args, **kwargs)
CLS.__init__ = __init__
CLS.NAME = "%s (DEPRECATED)" % old_name
return CLS

class Exporter(object):
"""Exporter base class

Expand Down
3 changes: 2 additions & 1 deletion tools/export/kds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"""
from os.path import splitext, basename

from tools.export.exporters import Exporter
from tools.export.exporters import Exporter, deprecated_exporter


@deprecated_exporter
class KDS(Exporter):
NAME = 'Kinetis Design Studio'
TOOLCHAIN = 'GCC_ARM'
Expand Down
3 changes: 2 additions & 1 deletion tools/export/lpcxpresso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
"""
from os.path import splitext, basename

from tools.export.exporters import Exporter
from tools.export.exporters import Exporter, deprecated_exporter

@deprecated_exporter
class LPCXpresso(Exporter):
NAME = 'LPCXpresso'
TOOLCHAIN = 'GCC_ARM'
Expand Down
3 changes: 2 additions & 1 deletion tools/export/simplicity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"""
from os.path import split,splitext, basename

from tools.export.exporters import Exporter
from tools.export.exporters import Exporter, deprecated_exporter

class Folder:
def __init__(self, name):
Expand Down Expand Up @@ -54,6 +54,7 @@ def addChild(self, folderName):

return self.findChild(folderName)

@deprecated_exporter
class SimplicityV3(Exporter):
NAME = 'SimplicityV3'
TOOLCHAIN = 'GCC_ARM'
Expand Down