tools/cr/cr/targets/target.py
def CreateTarget(cls, target_name):
    """Attempts to build a target by name.

    This searches the set of installed targets in priority order to see if any
    of them are willing to handle the supplied name.
    If a target cannot be found, the program will be aborted.
    Args:
      target_name: The name of the target we are searching for.
    Returns:
      The target that matched.
    """
    target_clses = sorted(
        cls.AllTargets(),
        key=operator.attrgetter('PRIORITY'),
        reverse=True
    )
    for handler in target_clses:
      target = handler.Build(target_name)
      if target:
        if not target.valid:
          print('Invalid target {0} as {1}'.format(target_name,
                                                   target.build_target))
          guesses = cr.Builder.GuessTargets(target_name)
          if guesses:
            print('Did you mean {0}?'
                  .format(', '.join(guesses[:-1]) + ' or ' +
                          guesses[-1] if len(guesses) > 1 else guesses[0]))
          exit(1)
        return target
    print('Unknown target {0}'.format(target_name))
    exit(1)
Attempts to build a target by name.

    This searches the set of installed targets in priority order to see if any
    of them are willing to handle the supplied name.
    If a target cannot be found, the program will be aborted.
    Args:
      target_name: The name of the target we are searching for.
    Returns:
      The target that matched.
    
Attempts to build a target by name.
This searches the set of installed targets in priority order to see if any
of them are willing to handle the supplied name.
If a target cannot be found, the program will be aborted.
Attempts to build a target by name . This searches the set of installed targets in priority order to see if any of them are willing to handle the supplied name . If a target cannot be found the program will be aborted .
def CreateTarget(cls, target_name):
    target_clses = sorted(
        cls.AllTargets(),
        key=operator.attrgetter('PRIORITY'),
        reverse=True
    )
    for handler in target_clses:
      target = handler.Build(target_name)
      if target:
        if not target.valid:
          print('Invalid target {0} as {1}'.format(target_name,
                                                   target.build_target))
          guesses = cr.Builder.GuessTargets(target_name)
          if guesses:
            print('Did you mean {0}?'
                  .format(', '.join(guesses[:-1]) + ' or ' +
                          guesses[-1] if len(guesses) > 1 else guesses[0]))
          exit(1)
        return target
    print('Unknown target {0}'.format(target_name))
    exit(1)
def CreateTarget ( cls , target_name ) : target_clses = sorted ( cls . AllTargets ( ) , key = operator . attrgetter ( 'PRIORITY' ) , reverse = True ) for handler in target_clses : target = handler . Build ( target_name ) if target : if not target . valid : print ( 'Invalid target {0} as {1}' . format ( target_name , target . build_target ) ) guesses = cr . Builder . GuessTargets ( target_name ) if guesses : print ( 'Did you mean {0}?' . format ( ', ' . join ( guesses [ : - 1 ] ) + ' or ' + guesses [ - 1 ] if len ( guesses ) > 1 else guesses [ 0 ] ) ) exit ( 1 ) return target print ( 'Unknown target {0}' . format ( target_name ) ) exit ( 1 )
Attempts to build a target by name.
Attempts to build a target by name .
"""Attempts to build a target by name.

    This searches the set of installed targets in priority order to see if any
    of them are willing to handle the supplied name.
    If a target cannot be found, the program will be aborted.
    Args:
      target_name: The name of the target we are searching for.
    Returns:
      The target that matched.
    """
The target that matched.
The target that matched .
cls
target_name
The name of the target we are searching for.
The name of the target we are searching for .