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 ntpath | 6 import ntpath |
7 import os | 7 import os |
8 import posixpath | 8 import posixpath |
9 import re | 9 import re |
10 import subprocess | 10 import subprocess |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 # Done if not processing outputs as sources. | 822 # Done if not processing outputs as sources. |
823 if int(rule.get('process_outputs_as_sources', False)): | 823 if int(rule.get('process_outputs_as_sources', False)): |
824 # Add in the outputs from this rule. | 824 # Add in the outputs from this rule. |
825 trigger_files = _FindRuleTriggerFiles(rule, sources) | 825 trigger_files = _FindRuleTriggerFiles(rule, sources) |
826 for trigger_file in trigger_files: | 826 for trigger_file in trigger_files: |
827 inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) | 827 inputs, outputs = _RuleInputsAndOutputs(rule, trigger_file) |
828 inputs = OrderedSet(_FixPaths(inputs)) | 828 inputs = OrderedSet(_FixPaths(inputs)) |
829 outputs = OrderedSet(_FixPaths(outputs)) | 829 outputs = OrderedSet(_FixPaths(outputs)) |
830 inputs.remove(_FixPath(trigger_file)) | 830 inputs.remove(_FixPath(trigger_file)) |
831 sources.update(inputs) | 831 sources.update(inputs) |
832 if not spec.get('msvs_external_builder'): | 832 if spec['type'] != 'none' and not spec.get('msvs_external_builder'): |
833 excluded_sources.update(inputs) | 833 excluded_sources.update(inputs) |
834 sources.update(outputs) | 834 sources.update(outputs) |
835 | 835 |
836 | 836 |
837 def _FilterActionsFromExcluded(excluded_sources, actions_to_add): | 837 def _FilterActionsFromExcluded(excluded_sources, actions_to_add): |
838 """Take inputs with actions attached out of the list of exclusions. | 838 """Take inputs with actions attached out of the list of exclusions. |
839 | 839 |
840 Arguments: | 840 Arguments: |
841 excluded_sources: list of source files not to be built. | 841 excluded_sources: list of source files not to be built. |
842 actions_to_add: dict of actions keyed on source file they're attached to. | 842 actions_to_add: dict of actions keyed on source file they're attached to. |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 if not generator_flags.get('standalone'): | 1381 if not generator_flags.get('standalone'): |
1382 sources.add(gyp_file) | 1382 sources.add(gyp_file) |
1383 | 1383 |
1384 # Add in 'action' inputs and outputs. | 1384 # Add in 'action' inputs and outputs. |
1385 for a in spec.get('actions', []): | 1385 for a in spec.get('actions', []): |
1386 inputs = a['inputs'] | 1386 inputs = a['inputs'] |
1387 inputs = [_NormalizedSource(i) for i in inputs] | 1387 inputs = [_NormalizedSource(i) for i in inputs] |
1388 # Add all inputs to sources and excluded sources. | 1388 # Add all inputs to sources and excluded sources. |
1389 inputs = OrderedSet(inputs) | 1389 inputs = OrderedSet(inputs) |
1390 sources.update(inputs) | 1390 sources.update(inputs) |
1391 if not spec.get('msvs_external_builder'): | 1391 if spec['type'] != 'none' and not spec.get('msvs_external_builder'): |
1392 excluded_sources.update(inputs) | 1392 excluded_sources.update(inputs) |
1393 if int(a.get('process_outputs_as_sources', False)): | 1393 if int(a.get('process_outputs_as_sources', False)): |
1394 _AddNormalizedSources(sources, a.get('outputs', [])) | 1394 _AddNormalizedSources(sources, a.get('outputs', [])) |
1395 # Add in 'copies' inputs and outputs. | 1395 # Add in 'copies' inputs and outputs. |
1396 for cpy in spec.get('copies', []): | 1396 for cpy in spec.get('copies', []): |
1397 _AddNormalizedSources(sources, cpy.get('files', [])) | 1397 _AddNormalizedSources(sources, cpy.get('files', [])) |
1398 return (sources, excluded_sources) | 1398 return (sources, excluded_sources) |
1399 | 1399 |
1400 | 1400 |
1401 def _AdjustSourcesAndConvertToFilterHierarchy( | 1401 def _AdjustSourcesAndConvertToFilterHierarchy( |
(...skipping 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3306 action_spec.extend( | 3306 action_spec.extend( |
3307 # TODO(jeanluc) 'Document' for all or just if as_sources? | 3307 # TODO(jeanluc) 'Document' for all or just if as_sources? |
3308 [['FileType', 'Document'], | 3308 [['FileType', 'Document'], |
3309 ['Command', command], | 3309 ['Command', command], |
3310 ['Message', description], | 3310 ['Message', description], |
3311 ['Outputs', outputs] | 3311 ['Outputs', outputs] |
3312 ]) | 3312 ]) |
3313 if additional_inputs: | 3313 if additional_inputs: |
3314 action_spec.append(['AdditionalInputs', additional_inputs]) | 3314 action_spec.append(['AdditionalInputs', additional_inputs]) |
3315 actions_spec.append(action_spec) | 3315 actions_spec.append(action_spec) |
OLD | NEW |