def GenerateOutput(target_list, target_dicts, data, params):
  config = Config()
  try:
    config.Init(params)

    if not config.files:
      raise Exception('Must specify files to analyze via config_path generator '
                      'flag')

    if config.deprecated_mode:
      _GenerateOutputDeprecated(target_list, target_dicts, data, params,
                                config)
      return

    toplevel_dir = _ToGypPath(os.path.abspath(params['options'].toplevel_dir))
    if debug:
      print 'toplevel_dir', toplevel_dir

    if _WasGypIncludeFileModified(params, config.files):
      result_dict = { 'status': all_changed_string,
                      'test_targets': list(config.test_target_names),
                      'compile_targets': list(
                        config.additional_compile_target_names |
                        config.test_target_names) }
      _WriteOutput(params, **result_dict)
      return

    calculator = TargetCalculator(config.files,
                                  config.additional_compile_target_names,
                                  config.test_target_names, data,
                                  target_list, target_dicts, toplevel_dir,
                                  params['build_files'])
    if not calculator.is_build_impacted():
      _WriteOutput(params, test_targets=[], compile_targets=[],
                   status=no_dependency_string,
                   invalid_targets=calculator.invalid_targets)
      return

    test_target_names = calculator.find_matching_test_target_names()
    compile_target_names = calculator.find_matching_compile_target_names()
    found_at_least_one_target = compile_target_names or test_target_names
    result_dict = { 'test_targets': test_target_names,
                    'status': found_dependency_string if
                        found_at_least_one_target else no_dependency_string,
                    'compile_targets': compile_target_names}
    if calculator.invalid_targets:
      result_dict['invalid_targets'] = calculator.invalid_targets
    _WriteOutput(params, **result_dict)

  except Exception as e:
    _WriteOutput(params, error=str(e))
Called by gyp as the final stage. Outputs results.
dataset/ETHPy150Open adblockplus/gyp/pylib/gyp/generator/analyzer.py/GenerateOutput