示例#1
0
def target_cross_toolchain(allowed_toolchains,
                           features=[],
                           targets=TARGET_MAP.keys()):
    """Generate pairs of target and toolchains

    Args:
    allowed_toolchains - a list of all possible toolchains

    Kwargs:
    features - the features that must be in the features array of a
               target
    targets - a list of available targets
    """
    for target, toolchains in get_mbed_official_release("5"):
        for toolchain in toolchains:
            if (toolchain in allowed_toolchains and target in targets
                    and all(feature in TARGET_MAP[target].features
                            for feature in features)):
                yield target, toolchain
示例#2
0
def target_cross_ide(allowed_ides, features=[], targets=[]):
    """Generate pairs of target and ides

    Args:
    allowed_ides - a list of all possible IDEs

    Kwargs:
    features - the features that must be in the features array of a
               target
    targets - a list of available targets
    """
    if len(targets) == 0:
        targets = TARGET_MAP.keys()

    for target, toolchains in get_mbed_official_release("5"):
        for ide in allowed_ides:
            if (EXPORTERS[ide].TOOLCHAIN in toolchains
                    and target in EXPORTERS[ide].TARGETS and target in targets
                    and all(feature in TARGET_MAP[target].features
                            for feature in features)):
                yield target, ide
 def all_supported_targets(cls):
     return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)]
示例#4
0
                for arg in argv if vars(parsed_args)[arg] is not None
            }

            return command(**argv)

        subparser.set_defaults(command=_thunk)
        return command

    return __subcommand


@subcommand("targets",
            dict(name="mcus",
                 nargs="+",
                 metavar="MCU",
                 choices=TARGET_MAP.keys(),
                 type=str.upper))
def targets_cmd(mcus=[]):
    """Find and print errors about specific targets"""
    print dump_all([check_hierarchy(TARGET_MAP[m]) for m in mcus],
                   default_flow_style=False)


@subcommand("all-targets")
def all_targets_cmd():
    """Print all errors about all parts"""
    print dump_all([check_hierarchy(m) for m in TARGET_MAP.values()],
                   default_flow_style=False)


@subcommand("orphans")
示例#5
0
文件: lint.py 项目: sg-/mbed-os
                    for arg in args]
            argv = [(arg if isinstance(arg, basestring)
                     else arg[-1]).strip('-').replace('-', '_')
                    for arg in argv]
            argv = {arg: vars(parsed_args)[arg] for arg in argv
                    if vars(parsed_args)[arg] is not None}

            return command(**argv)

        subparser.set_defaults(command=_thunk)
        return command
    return __subcommand

@subcommand("targets",
            dict(name="mcus", nargs="+", metavar="MCU",
                 choices=TARGET_MAP.keys(), type=str.upper))
def targets_cmd(mcus=[]):
    """Find and print errors about specific targets"""
    print dump_all([check_hierarchy(TARGET_MAP[m]) for m in mcus],
                   default_flow_style=False)

@subcommand("all-targets")
def all_targets_cmd():
    """Print all errors about all parts"""
    print dump_all([check_hierarchy(m) for m in TARGET_MAP.values()],
                   default_flow_style=False)

@subcommand("orphans")
def orphans_cmd():
    """Find and print all orphan targets"""
    orphans = Target.get_json_target_data().keys()
示例#6
0
文件: exporters.py 项目: sg-/mbed-os
 def all_supported_targets(cls):
     return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)]