OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import copy | 5 import copy |
6 import gyp | 6 import gyp |
7 import gyp.common | 7 import gyp.common |
8 import gyp.msvs_emulation | 8 import gyp.msvs_emulation |
9 import gyp.MSVSVersion | 9 import gyp.MSVSVersion |
10 import gyp.system_test | 10 import gyp.system_test |
11 import gyp.xcode_emulation | 11 import gyp.xcode_emulation |
| 12 import hashlib |
12 import os.path | 13 import os.path |
13 import re | 14 import re |
14 import subprocess | 15 import subprocess |
15 import sys | 16 import sys |
16 | 17 |
17 import gyp.ninja_syntax as ninja_syntax | 18 import gyp.ninja_syntax as ninja_syntax |
18 | 19 |
19 generator_default_variables = { | 20 generator_default_variables = { |
20 'EXECUTABLE_PREFIX': '', | 21 'EXECUTABLE_PREFIX': '', |
21 'EXECUTABLE_SUFFIX': '', | 22 'EXECUTABLE_SUFFIX': '', |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 | 504 |
504 def WriteActions(self, actions, extra_sources, prebuild, | 505 def WriteActions(self, actions, extra_sources, prebuild, |
505 extra_mac_bundle_resources): | 506 extra_mac_bundle_resources): |
506 # Actions cd into the base directory. | 507 # Actions cd into the base directory. |
507 env = self.GetSortedXcodeEnv() | 508 env = self.GetSortedXcodeEnv() |
508 if self.flavor == 'win': | 509 if self.flavor == 'win': |
509 env = self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR') | 510 env = self.msvs_settings.GetVSMacroEnv('$!PRODUCT_DIR') |
510 all_outputs = [] | 511 all_outputs = [] |
511 for action in actions: | 512 for action in actions: |
512 # First write out a rule for the action. | 513 # First write out a rule for the action. |
513 name = '%s_%s' % (self.qualified_target, action['action_name']) | 514 name = '%s_%s' % (action['action_name'], |
| 515 hashlib.md5(self.qualified_target).hexdigest()) |
514 description = self.GenerateDescription('ACTION', | 516 description = self.GenerateDescription('ACTION', |
515 action.get('message', None), | 517 action.get('message', None), |
516 name) | 518 name) |
517 is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action) | 519 is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(action) |
518 if self.flavor == 'win' else False) | 520 if self.flavor == 'win' else False) |
519 args = action['action'] | 521 args = action['action'] |
520 args = [self.msvs_settings.ConvertVSMacros(arg, self.base_to_build) | 522 args = [self.msvs_settings.ConvertVSMacros(arg, self.base_to_build) |
521 for arg in args] if self.flavor == 'win' else args | 523 for arg in args] if self.flavor == 'win' else args |
522 rule_name = self.WriteNewNinjaRule(name, args, description, | 524 rule_name = self.WriteNewNinjaRule(name, args, description, |
523 is_cygwin, env=env) | 525 is_cygwin, env=env) |
(...skipping 12 matching lines...) Expand all Loading... |
536 | 538 |
537 self.ninja.newline() | 539 self.ninja.newline() |
538 | 540 |
539 return all_outputs | 541 return all_outputs |
540 | 542 |
541 def WriteRules(self, rules, extra_sources, prebuild, | 543 def WriteRules(self, rules, extra_sources, prebuild, |
542 extra_mac_bundle_resources): | 544 extra_mac_bundle_resources): |
543 all_outputs = [] | 545 all_outputs = [] |
544 for rule in rules: | 546 for rule in rules: |
545 # First write out a rule for the rule action. | 547 # First write out a rule for the rule action. |
546 name = '%s_%s' % (self.qualified_target, rule['rule_name']) | 548 name = '%s_%s' % (rule['rule_name'], |
| 549 hashlib.md5(self.qualified_target).hexdigest()) |
547 # Skip a rule with no action and no inputs. | 550 # Skip a rule with no action and no inputs. |
548 if 'action' not in rule and not rule.get('rule_sources', []): | 551 if 'action' not in rule and not rule.get('rule_sources', []): |
549 continue | 552 continue |
550 args = rule['action'] | 553 args = rule['action'] |
551 description = self.GenerateDescription( | 554 description = self.GenerateDescription( |
552 'RULE', | 555 'RULE', |
553 rule.get('message', None), | 556 rule.get('message', None), |
554 ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name) | 557 ('%s ' + generator_default_variables['RULE_INPUT_PATH']) % name) |
555 is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule) | 558 is_cygwin = (self.msvs_settings.IsRuleRunUnderCygwin(rule) |
556 if self.flavor == 'win' else False) | 559 if self.flavor == 'win' else False) |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 | 1545 |
1543 user_config = params.get('generator_flags', {}).get('config', None) | 1546 user_config = params.get('generator_flags', {}).get('config', None) |
1544 if user_config: | 1547 if user_config: |
1545 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1548 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1546 user_config) | 1549 user_config) |
1547 else: | 1550 else: |
1548 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1551 config_names = target_dicts[target_list[0]]['configurations'].keys() |
1549 for config_name in config_names: | 1552 for config_name in config_names: |
1550 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1553 GenerateOutputForConfig(target_list, target_dicts, data, params, |
1551 config_name) | 1554 config_name) |
OLD | NEW |