Skip to content

Commit c489c21

Browse files
committed
build api: fix release version
This is non trivial fix as the function is being used outside of this repository. Tools rely on it to return list of targets for 2 or 5. As we removed release_version from many targets, this broke the logic. To keep the logic as it was, without updating all tools out there now, lets just return full set of targets - all are supported. In case for Mbed 2, returning all targets does not make sense, but rather raise an exception here. Not supported. This avoids suprised. If you look at build api functions there are many checks for 2 or 5 so more clean up needed to actually get release_version out of the tools.
1 parent 475621c commit c489c21

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

tools/build_api.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,26 +411,25 @@ def get_mbed_official_release(version):
411411
RELEASE_VERSIONS
412412
"""
413413

414+
# we ignore version for Mbed 6 as all targets in targets.json file are being supported
415+
# if someone passes 2, we return emtpy tuple, if 5, we keep the behavior the same as
416+
# release version is deprecated and all targets are being supported that are present
417+
# in targets.json file
418+
419+
if version == `2`:
420+
raise InvalidReleaseTargetException("Mbed 2 not supported anymore with this version of tools")
421+
414422
mbed_official_release = (
415423
tuple(
416424
tuple(
417425
[
418426
TARGET_MAP[target].name,
419-
tuple(transform_release_toolchains(
420-
TARGET_MAP[target], version))
427+
tuple('ARM', 'GCC_ARM')
421428
]
422-
) for target in TARGET_NAMES \
423-
if (hasattr(TARGET_MAP[target], 'release_versions')
424-
and version in TARGET_MAP[target].release_versions)
429+
) for target in TARGET_NAMES
425430
)
426431
)
427432

428-
for target in mbed_official_release:
429-
is_official, reason = is_official_target(target[0], version)
430-
431-
if not is_official:
432-
raise InvalidReleaseTargetException(reason)
433-
434433
return mbed_official_release
435434

436435
def target_supports_toolchain(target, toolchain_name):

0 commit comments

Comments
 (0)