Skip to content

Commit f478a21

Browse files
author
Qinghao Shi
authored
Merge pull request #12982 from 0xc0170/fix_release_version
build api: fix release version
2 parents e345542 + 9b4cddd commit f478a21

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

targets/targets.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
"std"
3333
]
3434
},
35+
"supported_application_profiles": [
36+
"rtos",
37+
"bare-metal"
38+
],
3539
"config": {
3640
"console-uart": {
3741
"help": "Target has UART console on pins STDIO_UART_TX, STDIO_UART_RX. Value is only significant if target has SERIAL device.",
@@ -313,7 +317,9 @@
313317
]
314318
},
315319
"c_lib": "small",
316-
"supported_application_profiles": ["bare-metal"],
320+
"supported_application_profiles": [
321+
"bare-metal"
322+
],
317323
"device_name": "LPC1114FN28/102",
318324
"detect_code": [
319325
"1114"
@@ -4745,6 +4751,7 @@
47454751
"inherits": [
47464752
"Target"
47474753
],
4754+
"public": false,
47484755
"core": "Cortex-A9",
47494756
"supported_toolchains": [
47504757
"ARM",
@@ -7496,4 +7503,4 @@
74967503
"version": "1",
74977504
"public": false
74987505
}
7499-
}
7506+
}

tools/build_api.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def transform_release_toolchains(target, version):
400400
else:
401401
return target.supported_toolchains
402402

403-
def get_mbed_official_release(version):
403+
def get_mbed_official_release(version, profile=None):
404404
""" Given a release version string, return a tuple that contains a target
405405
and the supported toolchains for that release.
406406
Ex. Given '2', return (('LPC1768', ('ARM', 'GCC_ARM')),
@@ -411,26 +411,26 @@ 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 empty 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+
return tuple(tuple([]))
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
]
422429
) for target in TARGET_NAMES \
423-
if (hasattr(TARGET_MAP[target], 'release_versions')
424-
and version in TARGET_MAP[target].release_versions)
430+
if not profile or profile in TARGET_MAP[target].supported_application_profiles
425431
)
426432
)
427433

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-
434434
return mbed_official_release
435435

436436
def target_supports_toolchain(target, toolchain_name):

0 commit comments

Comments
 (0)