Exemplo n.º 1
0
def _test_changes(dest):
  logging.info('Testing changes in open source tree')
  configure_options_file = 'out/configure.options'

  # This script should run under src/build/run_python, so PYTHONPATH should
  # contain the paths to ARC repository. To avoid importing modules from
  # the ARC repository (rather than the created testee open-source repository)
  # accidentally, here remove ARC related paths from the PYTHONPATH.
  # Note that the PYTHONPATH for open source repo is set in
  # {dest}/src/build/run_python executed in the ./configure below.
  env = build_common.remove_arc_pythonpath(os.environ)
  with open(configure_options_file) as f:
    configure_args = f.read().split()
  subprocess.check_call(['./configure'] + configure_args, cwd=dest, env=env)
  subprocess.check_call(['ninja', 'all', '-j50'], cwd=dest)
Exemplo n.º 2
0
def _build_crx(parsed_args):
  external_metadata = _convert_launch_chrome_options_to_external_metadata(
      parsed_args)
  apk_to_crx_args = _generate_apk_to_crx_args(
      parsed_args,
      metadata=external_metadata,
      combined_metadata_file=(
          _DOGFOOD_METADATA_PATH if parsed_args.dogfood_metadata else None))
  env = build_common.remove_arc_pythonpath(os.environ)
  env['ANDROID_HOME'] = 'third_party/android-sdk'

  # Return True on success, otherwise False.
  result = subprocess.call(
      ['python',
       os.path.join(build_common.get_tools_dir(), 'apk_to_crx.zip')] +
      apk_to_crx_args,
      env=env)
  return result == 0