| 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 |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 import gyp.common | 13 import gyp.common |
| 14 import gyp.easy_xml as easy_xml | 14 import gyp.easy_xml as easy_xml |
| 15 import gyp.MSVSNew as MSVSNew | 15 import gyp.MSVSNew as MSVSNew |
| 16 import gyp.MSVSProject as MSVSProject | 16 import gyp.MSVSProject as MSVSProject |
| 17 import gyp.MSVSSettings as MSVSSettings | 17 import gyp.MSVSSettings as MSVSSettings |
| 18 import gyp.MSVSToolFile as MSVSToolFile | 18 import gyp.MSVSToolFile as MSVSToolFile |
| 19 import gyp.MSVSUserFile as MSVSUserFile | 19 import gyp.MSVSUserFile as MSVSUserFile |
| 20 import gyp.MSVSVersion as MSVSVersion | 20 import gyp.MSVSVersion as MSVSVersion |
| 21 from gyp.common import GypError |
| 21 | 22 |
| 22 | 23 |
| 23 # Regular expression for validating Visual Studio GUIDs. If the GUID | 24 # Regular expression for validating Visual Studio GUIDs. If the GUID |
| 24 # contains lowercase hex letters, MSVS will be fine. However, | 25 # contains lowercase hex letters, MSVS will be fine. However, |
| 25 # IncrediBuild BuildConsole will parse the solution file, but then | 26 # IncrediBuild BuildConsole will parse the solution file, but then |
| 26 # silently skip building the target causing hard to track down errors. | 27 # silently skip building the target causing hard to track down errors. |
| 27 # Note that this only happens with the BuildConsole, and does not occur | 28 # Note that this only happens with the BuildConsole, and does not occur |
| 28 # if IncrediBuild is executed from inside Visual Studio. This regex | 29 # if IncrediBuild is executed from inside Visual Studio. This regex |
| 29 # validates that the string looks like a GUID with all uppercase hex | 30 # validates that the string looks like a GUID with all uppercase hex |
| 30 # letters. | 31 # letters. |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1774 if d in targets_to_shard: | 1775 if d in targets_to_shard: |
| 1775 for i in range(targets_to_shard[d]): | 1776 for i in range(targets_to_shard[d]): |
| 1776 new_dependencies.append(_ShardName(d, i)) | 1777 new_dependencies.append(_ShardName(d, i)) |
| 1777 else: | 1778 else: |
| 1778 new_dependencies.append(d) | 1779 new_dependencies.append(d) |
| 1779 new_target_dicts[t]['dependencies'] = new_dependencies | 1780 new_target_dicts[t]['dependencies'] = new_dependencies |
| 1780 | 1781 |
| 1781 return (new_target_list, new_target_dicts) | 1782 return (new_target_list, new_target_dicts) |
| 1782 | 1783 |
| 1783 | 1784 |
| 1785 def PerformBuild(data, configurations, params): |
| 1786 options = params['options'] |
| 1787 msvs_version = params['msvs_version'] |
| 1788 devenv = os.path.join(msvs_version.path, 'Common7', 'IDE', 'devenv.com') |
| 1789 |
| 1790 for build_file, build_file_dict in data.iteritems(): |
| 1791 (build_file_root, build_file_ext) = os.path.splitext(build_file) |
| 1792 if build_file_ext != '.gyp': |
| 1793 continue |
| 1794 sln_path = build_file_root + options.suffix + '.sln' |
| 1795 if options.generator_output: |
| 1796 sln_path = os.path.join(options.generator_output, sln_path) |
| 1797 |
| 1798 for config in configurations: |
| 1799 arguments = [devenv, sln_path, '/Build', config] |
| 1800 print 'Building [%s]: %s' % (config, arguments) |
| 1801 rtn = subprocess.check_call(arguments) |
| 1802 |
| 1803 |
| 1784 def GenerateOutput(target_list, target_dicts, data, params): | 1804 def GenerateOutput(target_list, target_dicts, data, params): |
| 1785 """Generate .sln and .vcproj files. | 1805 """Generate .sln and .vcproj files. |
| 1786 | 1806 |
| 1787 This is the entry point for this generator. | 1807 This is the entry point for this generator. |
| 1788 Arguments: | 1808 Arguments: |
| 1789 target_list: List of target pairs: 'base/base.gyp:base'. | 1809 target_list: List of target pairs: 'base/base.gyp:base'. |
| 1790 target_dicts: Dict of target properties keyed on target pair. | 1810 target_dicts: Dict of target properties keyed on target pair. |
| 1791 data: Dictionary containing per .gyp data. | 1811 data: Dictionary containing per .gyp data. |
| 1792 """ | 1812 """ |
| 1793 global fixpath_prefix | 1813 global fixpath_prefix |
| (...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3136 action_spec.extend( | 3156 action_spec.extend( |
| 3137 # TODO(jeanluc) 'Document' for all or just if as_sources? | 3157 # TODO(jeanluc) 'Document' for all or just if as_sources? |
| 3138 [['FileType', 'Document'], | 3158 [['FileType', 'Document'], |
| 3139 ['Command', command], | 3159 ['Command', command], |
| 3140 ['Message', description], | 3160 ['Message', description], |
| 3141 ['Outputs', outputs] | 3161 ['Outputs', outputs] |
| 3142 ]) | 3162 ]) |
| 3143 if additional_inputs: | 3163 if additional_inputs: |
| 3144 action_spec.append(['AdditionalInputs', additional_inputs]) | 3164 action_spec.append(['AdditionalInputs', additional_inputs]) |
| 3145 actions_spec.append(action_spec) | 3165 actions_spec.append(action_spec) |
| OLD | NEW |