Skip to content

Commit 9d31e2a

Browse files
committed
Updating supported toolchain printing with new options
1 parent 169234c commit 9d31e2a

File tree

3 files changed

+9
-33
lines changed

3 files changed

+9
-33
lines changed

tools/build_api.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,30 +1139,6 @@ def _lowercase_release_version(release_version):
11391139
except AttributeError:
11401140
return 'all'
11411141

1142-
def mcu_toolchain_list(release_version='5'):
1143-
""" Shows list of toolchains
1144-
1145-
"""
1146-
release_version = _lowercase_release_version(release_version)
1147-
version_release_targets = {}
1148-
version_release_target_names = {}
1149-
1150-
for version in RELEASE_VERSIONS:
1151-
version_release_targets[version] = get_mbed_official_release(version)
1152-
version_release_target_names[version] = [x[0] for x in
1153-
version_release_targets[
1154-
version]]
1155-
1156-
if release_version in RELEASE_VERSIONS:
1157-
release_targets = version_release_targets[release_version]
1158-
else:
1159-
release_targets = None
1160-
1161-
unique_supported_toolchains = get_unique_supported_toolchains(
1162-
release_targets)
1163-
columns = ["mbed OS %s" % x for x in RELEASE_VERSIONS] + unique_supported_toolchains
1164-
return "\n".join(columns)
1165-
11661142

11671143
def mcu_target_list(release_version='5'):
11681144
""" Shows target list

tools/make.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
from tools.options import get_default_options_parser
4242
from tools.options import extract_profile
4343
from tools.options import extract_mcus
44+
from tools.options import get_toolchain_list
4445
from tools.notifier.term import TerminalNotifier
4546
from tools.build_api import build_project
4647
from tools.build_api import mcu_toolchain_matrix
47-
from tools.build_api import mcu_toolchain_list
4848
from tools.build_api import mcu_target_list
4949
from tools.build_api import merge_build_data
5050
from tools.build_api import find_valid_toolchain
@@ -297,11 +297,7 @@ def main():
297297
release_version=None
298298
))
299299
elif options.supported_toolchains == "toolchains":
300-
toolchain_list = mcu_toolchain_list()
301-
# Only print the lines that matter
302-
for line in toolchain_list.split("\n"):
303-
if "mbed" not in line:
304-
print(line)
300+
print('\n'.join(get_toolchain_list()))
305301
elif options.supported_toolchains == "targets":
306302
print(mcu_target_list())
307303
elif options.list_tests is True:

tools/options.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
"Documentation may be found in "\
3333
"docs/Toolchain_Profiles.md"
3434

35+
def get_toolchain_list():
36+
toolchainlist = list(TOOLCHAINS)
37+
toolchainlist.extend(EXTRA_TOOLCHAIN_NAMES)
38+
toolchainlist.sort()
39+
return toolchainlist
40+
3541
def get_default_options_parser(add_clean=True, add_options=True,
3642
add_app_config=False):
3743
"""Create a new options parser with the default compiler options added
@@ -44,9 +50,7 @@ def get_default_options_parser(add_clean=True, add_options=True,
4450

4551
targetnames = TARGET_NAMES
4652
targetnames.sort()
47-
toolchainlist = list(TOOLCHAINS)
48-
toolchainlist.extend(EXTRA_TOOLCHAIN_NAMES)
49-
toolchainlist.sort()
53+
toolchainlist = get_toolchain_list()
5054

5155
parser.add_argument("-m", "--mcu",
5256
help=("build for the given MCU (%s)" %

0 commit comments

Comments
 (0)