(p, output_dir, options, spec,
                          sources, excluded_sources,
                          actions_to_add)
Generate all the rules for a particular project.

  Arguments:
    p: the project
    output_dir: directory to emit rules to
    options: global options passed to the generator
    spec: the specification for this project
    sources: the set of all known source files in this project
    excluded_sources: the set of sources excluded from normal processing
    actions_to_add: deferred list of actions to add in
Generate all the rules for a particular project.
Generate all the rules for a particular project .
def _GenerateRulesForMSVS(p, output_dir, options, spec,
                          sources, excluded_sources,
                          actions_to_add):
  """Generate all the rules for a particular project.

  Arguments:
    p: the project
    output_dir: directory to emit rules to
    options: global options passed to the generator
    spec: the specification for this project
    sources: the set of all known source files in this project
    excluded_sources: the set of sources excluded from normal processing
    actions_to_add: deferred list of actions to add in
  """
  rules = spec.get('rules', [])
  rules_native = [r for r in rules if not int(r.get('msvs_external_rule', 0))]
  rules_external = [r for r in rules if int(r.get('msvs_external_rule', 0))]

  # Handle rules that use a native rules file.
  if rules_native:
    _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options)

  # Handle external rules (non-native rules).
  if rules_external:
    _GenerateExternalRules(rules_external, output_dir, spec,
                           sources, options, actions_to_add)
  _AdjustSourcesForRules(rules, sources, excluded_sources, False)
def _GenerateRulesForMSVS ( p , output_dir , options , spec , sources , excluded_sources , actions_to_add ) : rules = spec . get ( 'rules' , [ ] ) rules_native = [ r for r in rules if not int ( r . get ( 'msvs_external_rule' , 0 ) ) ] rules_external = [ r for r in rules if int ( r . get ( 'msvs_external_rule' , 0 ) ) ] # Handle rules that use a native rules file. if rules_native : _GenerateNativeRulesForMSVS ( p , rules_native , output_dir , spec , options ) # Handle external rules (non-native rules). if rules_external : _GenerateExternalRules ( rules_external , output_dir , spec , sources , options , actions_to_add ) _AdjustSourcesForRules ( rules , sources , excluded_sources , False )