mirror of https://github.com/ARMmbed/mbed-os.git
Allow filtering by target as well as by features
parent
1f0afebbbc
commit
4b1dcd398c
|
@ -1,8 +1,12 @@
|
||||||
{
|
{
|
||||||
"https://developer.mbed.org/teams/mbed/code/mbed_blinky" : [],
|
"https://developer.mbed.org/teams/mbed/code/mbed_blinky" : {},
|
||||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-Beacon" : ["BLE"],
|
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-Beacon" :
|
||||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-HeartRate" : ["BLE"],
|
{"features": ["BLE"]},
|
||||||
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-mesh-minimal" :["IPV4"],
|
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-ble-HeartRate" :
|
||||||
"https://github.com/ARMmbed/mbed-os-example-client" : ["IPV4"],
|
{"features": ["BLE"]},
|
||||||
"https://github.com/ARMmbed/mbed-os-example-sockets" : ["IPV4"]
|
"https://developer.mbed.org/teams/mbed-os-examples/code/mbed-os-example-mesh-minimal" :
|
||||||
|
{"features": ["IPV4"]},
|
||||||
|
"https://github.com/ARMmbed/mbed-os-example-client" : {"features": ["IPV4"]},
|
||||||
|
"https://github.com/ARMmbed/mbed-os-example-sockets" : {"features": ["IPV4"]},
|
||||||
|
"https://github.com/ARMmbed/mbed-os-example-uvisor" : {"targets": ["K64F"]}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,8 @@ def print_stuff(name, lst):
|
||||||
SUPPORTED_TOOLCHAINS = ["ARM", "IAR", "GCC_ARM"]
|
SUPPORTED_TOOLCHAINS = ["ARM", "IAR", "GCC_ARM"]
|
||||||
|
|
||||||
|
|
||||||
def target_cross_toolchain(required_features, allowed_toolchains):
|
def target_cross_toolchain(allowed_toolchains,
|
||||||
|
features=[], targets=TARGET_MAP.keys()):
|
||||||
"""Generate pairs of target and toolchains
|
"""Generate pairs of target and toolchains
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -42,8 +43,9 @@ def target_cross_toolchain(required_features, allowed_toolchains):
|
||||||
for target, toolchains in get_mbed_official_release("5"):
|
for target, toolchains in get_mbed_official_release("5"):
|
||||||
for toolchain in toolchains:
|
for toolchain in toolchains:
|
||||||
if (toolchain in allowed_toolchains and
|
if (toolchain in allowed_toolchains and
|
||||||
|
target in targets and
|
||||||
all(feature in TARGET_MAP[target].features
|
all(feature in TARGET_MAP[target].features
|
||||||
for feature in required_features)):
|
for feature in features)):
|
||||||
yield target, toolchain
|
yield target, toolchain
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,11 +61,11 @@ def main():
|
||||||
|
|
||||||
failures = []
|
failures = []
|
||||||
sucesses = []
|
sucesses = []
|
||||||
for example, build_features in EXAMPLES.iteritems():
|
for example, requirements in EXAMPLES.iteritems():
|
||||||
subprocess.call(["mbed-cli", "import", example])
|
subprocess.call(["mbed-cli", "import", example])
|
||||||
os.chdir(basename(example))
|
os.chdir(basename(example))
|
||||||
for target, toolchain in target_cross_toolchain(build_features,
|
for target, toolchain in target_cross_toolchain(args.toolchains,
|
||||||
args.toolchains):
|
**requirements):
|
||||||
proc = subprocess.Popen(["mbed-cli", "compile", "-t",
|
proc = subprocess.Popen(["mbed-cli", "compile", "-t",
|
||||||
toolchain, "-m", target])
|
toolchain, "-m", target])
|
||||||
proc.wait()
|
proc.wait()
|
||||||
|
|
Loading…
Reference in New Issue