components/crash/content/tools/generate_breakpad_symbols.py
def GetDeveloperDirMac():
  """Finds a good DEVELOPER_DIR value to run Mac dev tools.

  It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses
  one of those if the folder exists, and falls back to one of the
  existing system folders with dev tools.

  Returns:
    (string) path to assign to DEVELOPER_DIR env var.
  """
  candidate_paths = []
  if 'DEVELOPER_DIR' in os.environ:
    candidate_paths.append(os.environ['DEVELOPER_DIR'])
  candidate_paths.extend([
    subprocess.check_output(['xcode-select', '-p']).decode('utf-8').strip(),
    # Most Mac 10.1[0-2] bots have at least one Xcode installed.
    '/Applications/Xcode.app',
    '/Applications/Xcode9.0.app',
    '/Applications/Xcode8.0.app',
    # Mac 10.13 bots don't have any Xcode installed, but have CLI tools as a
    # temporary workaround.
    '/Library/Developer/CommandLineTools',
  ])
  for path in candidate_paths:
    if os.path.exists(path):
      return path
  print('WARNING: no value found for DEVELOPER_DIR. Some commands may fail.')
Finds a good DEVELOPER_DIR value to run Mac dev tools.

  It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses
  one of those if the folder exists, and falls back to one of the
  existing system folders with dev tools.

  Returns:
    (string) path to assign to DEVELOPER_DIR env var.
  
Finds a good DEVELOPER_DIR value to run Mac dev tools.
It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses
one of those if the folder exists, and falls back to one of the
existing system folders with dev tools.
Finds a good DEVELOPER_DIR value to run Mac dev tools . It checks the existing DEVELOPER_DIR and ` xcode - select - p ` and uses one of those if the folder exists and falls back to one of the existing system folders with dev tools .
def GetDeveloperDirMac():
  candidate_paths = []
  if 'DEVELOPER_DIR' in os.environ:
    candidate_paths.append(os.environ['DEVELOPER_DIR'])
  candidate_paths.extend([
    subprocess.check_output(['xcode-select', '-p']).decode('utf-8').strip(),
    '/Applications/Xcode.app',
    '/Applications/Xcode9.0.app',
    '/Applications/Xcode8.0.app',
    '/Library/Developer/CommandLineTools',
  ])
  for path in candidate_paths:
    if os.path.exists(path):
      return path
  print('WARNING: no value found for DEVELOPER_DIR. Some commands may fail.')
def GetDeveloperDirMac ( ) : candidate_paths = [ ] if 'DEVELOPER_DIR' in os . environ : candidate_paths . append ( os . environ [ 'DEVELOPER_DIR' ] ) candidate_paths . extend ( [ subprocess . check_output ( [ 'xcode-select' , '-p' ] ) . decode ( 'utf-8' ) . strip ( ) , '/Applications/Xcode.app' , '/Applications/Xcode9.0.app' , '/Applications/Xcode8.0.app' , '/Library/Developer/CommandLineTools' , ] ) for path in candidate_paths : if os . path . exists ( path ) : return path print ( 'WARNING: no value found for DEVELOPER_DIR. Some commands may fail.' )
Finds a good DEVELOPER_DIR value to run Mac dev tools.
Finds a good DEVELOPER_DIR value to run Mac dev tools .
"""Finds a good DEVELOPER_DIR value to run Mac dev tools.

  It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses
  one of those if the folder exists, and falls back to one of the
  existing system folders with dev tools.

  Returns:
    (string) path to assign to DEVELOPER_DIR env var.
  """ # Most Mac 10.1[0-2] bots have at least one Xcode installed. # Mac 10.13 bots don't have any Xcode installed, but have CLI tools as a # temporary workaround.
(string) path to assign to DEVELOPER_DIR env var.
( string ) path to assign to DEVELOPER_DIR env var .