Generate the .props file.
(props_path, msbuild_rules)
| 2426 | |
| 2427 | |
| 2428 | def _GenerateMSBuildRulePropsFile(props_path, msbuild_rules): |
| 2429 | """Generate the .props file.""" |
| 2430 | content = [ |
| 2431 | "Project", |
| 2432 | {"xmlns": "http://schemas.microsoft.com/developer/msbuild/2003"}, |
| 2433 | ] |
| 2434 | for rule in msbuild_rules: |
| 2435 | content.extend( |
| 2436 | [ |
| 2437 | [ |
| 2438 | "PropertyGroup", |
| 2439 | { |
| 2440 | "Condition": "'$(%s)' == '' and '$(%s)' == '' and " |
| 2441 | "'$(ConfigurationType)' != 'Makefile'" |
| 2442 | % (rule.before_targets, rule.after_targets) |
| 2443 | }, |
| 2444 | [rule.before_targets, "Midl"], |
| 2445 | [rule.after_targets, "CustomBuild"], |
| 2446 | ], |
| 2447 | [ |
| 2448 | "PropertyGroup", |
| 2449 | [ |
| 2450 | rule.depends_on, |
| 2451 | {"Condition": "'$(ConfigurationType)' != 'Makefile'"}, |
| 2452 | "_SelectedFiles;$(%s)" % rule.depends_on, |
| 2453 | ], |
| 2454 | ], |
| 2455 | [ |
| 2456 | "ItemDefinitionGroup", |
| 2457 | [ |
| 2458 | rule.rule_name, |
| 2459 | ["CommandLineTemplate", rule.command], |
| 2460 | ["Outputs", rule.outputs], |
| 2461 | ["ExecutionDescription", rule.description], |
| 2462 | ["AdditionalDependencies", rule.additional_dependencies], |
| 2463 | ], |
| 2464 | ], |
| 2465 | ] |
| 2466 | ) |
| 2467 | easy_xml.WriteXmlIfChanged(content, props_path, pretty=True, win32=True) |
| 2468 | |
| 2469 | |
| 2470 | def _GenerateMSBuildRuleTargetsFile(targets_path, msbuild_rules): |
no test coverage detected