def __init__(self, build_dir=None, target_os=None, target_cpu=None,
               is_debug=None, is_verbose=None, apk_name='MojoRunner.apk'):
    '''Function arguments take precedence over GN args and default values.'''
    assert target_os in (None, Config.OS_ANDROID, Config.OS_CHROMEOS,
                         Config.OS_LINUX, Config.OS_MAC, Config.OS_WINDOWS)
    assert target_cpu in (None, Config.ARCH_X86, Config.ARCH_X64,
                          Config.ARCH_ARM)
    assert is_debug in (None, True, False)
    assert is_verbose in (None, True, False)

    self.values = {
      'build_dir': build_dir,
      'target_os': self.GetHostOS(),
      'target_cpu': self.GetHostCPU(),
      'is_debug': True,
      'is_verbose': True,
      'dcheck_always_on': False,
      'is_asan': False,
      'apk_name': apk_name,
    }

    self._ParseGNArgs()
    if target_os is not None:
      self.values['target_os'] = target_os
    if target_cpu is not None:
      self.values['target_cpu'] = target_cpu
    if is_debug is not None:
      self.values['is_debug'] = is_debug
    if is_verbose is not None:
      self.values['is_verbose'] = is_verbose