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))]
 if rules_native:
  _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options)
 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 ) ) ] if rules_native : _GenerateNativeRulesForMSVS ( p , rules_native , output_dir , spec , options ) if rules_external : _GenerateExternalRules ( rules_external , output_dir , spec , sources , options , actions_to_add ) _AdjustSourcesForRules ( rules , sources , excluded_sources , False )
generate all the rules for a particular project .