OLD | NEW |
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 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 hashlib | 6 import hashlib |
7 import json | 7 import json |
8 import multiprocessing | 8 import multiprocessing |
9 import os.path | 9 import os.path |
10 import re | 10 import re |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 if postbuild: | 1196 if postbuild: |
1197 variables.append(('postbuilds', postbuild)) | 1197 variables.append(('postbuilds', postbuild)) |
1198 | 1198 |
1199 def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): | 1199 def GetPostbuildCommand(self, spec, output, output_binary, is_command_start): |
1200 """Returns a shell command that runs all the postbuilds, and removes | 1200 """Returns a shell command that runs all the postbuilds, and removes |
1201 |output| if any of them fails. If |is_command_start| is False, then the | 1201 |output| if any of them fails. If |is_command_start| is False, then the |
1202 returned string will start with ' && '.""" | 1202 returned string will start with ' && '.""" |
1203 if not self.xcode_settings or spec['type'] == 'none' or not output: | 1203 if not self.xcode_settings or spec['type'] == 'none' or not output: |
1204 return '' | 1204 return '' |
1205 output = QuoteShellArgument(output, self.flavor) | 1205 output = QuoteShellArgument(output, self.flavor) |
1206 target_postbuilds = [] | 1206 postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) |
1207 if output_binary is not None: | 1207 if output_binary is not None: |
1208 target_postbuilds = self.xcode_settings.GetTargetPostbuilds( | 1208 postbuilds = self.xcode_settings.AddImplicitPostbuilds( |
1209 self.config_name, | 1209 self.config_name, |
1210 os.path.normpath(os.path.join(self.base_to_build, output)), | 1210 os.path.normpath(os.path.join(self.base_to_build, output)), |
1211 QuoteShellArgument( | 1211 QuoteShellArgument( |
1212 os.path.normpath(os.path.join(self.base_to_build, output_binary)), | 1212 os.path.normpath(os.path.join(self.base_to_build, output_binary)), |
1213 self.flavor), | 1213 self.flavor), |
1214 quiet=True) | 1214 postbuilds, quiet=True) |
1215 postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True) | 1215 |
1216 postbuilds = target_postbuilds + postbuilds | |
1217 if not postbuilds: | 1216 if not postbuilds: |
1218 return '' | 1217 return '' |
1219 # Postbuilds expect to be run in the gyp file's directory, so insert an | 1218 # Postbuilds expect to be run in the gyp file's directory, so insert an |
1220 # implicit postbuild to cd to there. | 1219 # implicit postbuild to cd to there. |
1221 postbuilds.insert(0, gyp.common.EncodePOSIXShellList( | 1220 postbuilds.insert(0, gyp.common.EncodePOSIXShellList( |
1222 ['cd', self.build_to_base])) | 1221 ['cd', self.build_to_base])) |
1223 env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) | 1222 env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv()) |
1224 # G will be non-null if any postbuild fails. Run all postbuilds in a | 1223 # G will be non-null if any postbuild fails. Run all postbuilds in a |
1225 # subshell. | 1224 # subshell. |
1226 commands = env + ' (' + \ | 1225 commands = env + ' (' + \ |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2125 arglists.append( | 2124 arglists.append( |
2126 (target_list, target_dicts, data, params, config_name)) | 2125 (target_list, target_dicts, data, params, config_name)) |
2127 pool.map(CallGenerateOutputForConfig, arglists) | 2126 pool.map(CallGenerateOutputForConfig, arglists) |
2128 except KeyboardInterrupt, e: | 2127 except KeyboardInterrupt, e: |
2129 pool.terminate() | 2128 pool.terminate() |
2130 raise e | 2129 raise e |
2131 else: | 2130 else: |
2132 for config_name in config_names: | 2131 for config_name in config_names: |
2133 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2132 GenerateOutputForConfig(target_list, target_dicts, data, params, |
2134 config_name) | 2133 config_name) |
OLD | NEW |