ios/build/bots/scripts/run.py
def install_xcode(self):
    """Installs the requested Xcode build version.

    Returns:
      (bool, bool)
        First bool: True if installation was successful. False otherwise.
        Second bool: True if Xcode is legacy package. False if it's new.
    """
    try:
      if not self.args.mac_toolchain_cmd:
        raise test_runner.MacToolchainNotFoundError(self.args.mac_toolchain_cmd)
      # Guard against incorrect install paths. On swarming, this path
      # should be a requested named cache, and it must exist.
      if not os.path.exists(self.args.xcode_path):
        raise test_runner.XcodePathNotFoundError(self.args.xcode_path)

      runtime_cache_folder = None
      # Runner script only utilizes runtime cache when it's a simulator task.
      if self.args.version:
        runtime_cache_folder = xcode.construct_runtime_cache_folder(
            self.args.runtime_cache_prefix, self.args.version)
        if not os.path.exists(runtime_cache_folder):
          # Depending on infra project, runtime named cache might not be
          # deployed. Create the dir if it doesn't exist since xcode_util
          # assumes it exists.
          # TODO(crbug.com/1191260): Raise error instead of creating dirs after
          # runtime named cache is deployed everywhere.
          os.makedirs(runtime_cache_folder)
      # xcode.install() installs the Xcode & iOS runtime, and returns a bool
      # indicating if the Xcode version in CIPD is a legacy Xcode package (which
      # includes iOS runtimes).
      is_legacy_xcode = xcode.install(
          self.args.mac_toolchain_cmd,
          self.args.xcode_build_version,
          self.args.xcode_path,
          runtime_cache_folder=runtime_cache_folder,
          ios_version=self.args.version)
      xcode.select(self.args.xcode_path)
    except subprocess.CalledProcessError as e:
      # Flush buffers to ensure correct output ordering.
      sys.stdout.flush()
      sys.stderr.write('Xcode build version %s failed to install: %s\n' %
                       (self.args.xcode_build_version, e))
      sys.stderr.flush()
      return (False, False)
    else:
      return (True, is_legacy_xcode)
Installs the requested Xcode build version.

    Returns:
      (bool, bool)
        First bool: True if installation was successful. False otherwise.
        Second bool: True if Xcode is legacy package. False if it's new.
    
Installs the requested Xcode build version.
Installs the requested Xcode build version .
def install_xcode(self):
    try:
      if not self.args.mac_toolchain_cmd:
        raise test_runner.MacToolchainNotFoundError(self.args.mac_toolchain_cmd)
      if not os.path.exists(self.args.xcode_path):
        raise test_runner.XcodePathNotFoundError(self.args.xcode_path)
      runtime_cache_folder = None
      if self.args.version:
        runtime_cache_folder = xcode.construct_runtime_cache_folder(
            self.args.runtime_cache_prefix, self.args.version)
        if not os.path.exists(runtime_cache_folder):
          os.makedirs(runtime_cache_folder)
      is_legacy_xcode = xcode.install(
          self.args.mac_toolchain_cmd,
          self.args.xcode_build_version,
          self.args.xcode_path,
          runtime_cache_folder=runtime_cache_folder,
          ios_version=self.args.version)
      xcode.select(self.args.xcode_path)
    except subprocess.CalledProcessError as e:
      sys.stdout.flush()
      sys.stderr.write('Xcode build version %s failed to install: %s\n' %
                       (self.args.xcode_build_version, e))
      sys.stderr.flush()
      return (False, False)
    else:
      return (True, is_legacy_xcode)
def install_xcode ( self ) : try : if not self . args . mac_toolchain_cmd : raise test_runner . MacToolchainNotFoundError ( self . args . mac_toolchain_cmd ) if not os . path . exists ( self . args . xcode_path ) : raise test_runner . XcodePathNotFoundError ( self . args . xcode_path ) runtime_cache_folder = None if self . args . version : runtime_cache_folder = xcode . construct_runtime_cache_folder ( self . args . runtime_cache_prefix , self . args . version ) if not os . path . exists ( runtime_cache_folder ) : os . makedirs ( runtime_cache_folder ) is_legacy_xcode = xcode . install ( self . args . mac_toolchain_cmd , self . args . xcode_build_version , self . args . xcode_path , runtime_cache_folder = runtime_cache_folder , ios_version = self . args . version ) xcode . select ( self . args . xcode_path ) except subprocess . CalledProcessError as e : sys . stdout . flush ( ) sys . stderr . write ( 'Xcode build version %s failed to install: %s\n' % ( self . args . xcode_build_version , e ) ) sys . stderr . flush ( ) return ( False , False ) else : return ( True , is_legacy_xcode )
Installs the requested Xcode build version.
Installs the requested Xcode build version .
"""Installs the requested Xcode build version.

    Returns:
      (bool, bool)
        First bool: True if installation was successful. False otherwise.
        Second bool: True if Xcode is legacy package. False if it's new.
    """ # Guard against incorrect install paths. On swarming, this path # should be a requested named cache, and it must exist. # Runner script only utilizes runtime cache when it's a simulator task. # Depending on infra project, runtime named cache might not be # deployed. Create the dir if it doesn't exist since xcode_util # assumes it exists. # TODO(crbug.com/1191260): Raise error instead of creating dirs after # runtime named cache is deployed everywhere. # xcode.install() installs the Xcode & iOS runtime, and returns a bool # indicating if the Xcode version in CIPD is a legacy Xcode package (which # includes iOS runtimes). # Flush buffers to ensure correct output ordering.
None
self