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 """ | 5 """ |
6 This module contains classes that help to emulate xcodebuild behavior on top of | 6 This module contains classes that help to emulate xcodebuild behavior on top of |
7 other build systems, such as make and ninja. | 7 other build systems, such as make and ninja. |
8 """ | 8 """ |
9 | 9 |
10 import gyp.common | 10 import gyp.common |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 def GetExecutablePath(self): | 217 def GetExecutablePath(self): |
218 """Returns the directory name of the bundle represented by this target. E.g. | 218 """Returns the directory name of the bundle represented by this target. E.g. |
219 Chromium.app/Contents/MacOS/Chromium.""" | 219 Chromium.app/Contents/MacOS/Chromium.""" |
220 if self._IsBundle(): | 220 if self._IsBundle(): |
221 return self._GetBundleBinaryPath() | 221 return self._GetBundleBinaryPath() |
222 else: | 222 else: |
223 return self._GetStandaloneBinaryPath() | 223 return self._GetStandaloneBinaryPath() |
224 | 224 |
225 def _GetSdkVersionInfoItem(self, sdk, infoitem): | 225 def _GetSdkVersionInfoItem(self, sdk, infoitem): |
226 job = subprocess.Popen(['xcodebuild', '-version', '-sdk', sdk, infoitem], | 226 job = subprocess.Popen(['xcodebuild', '-version', '-sdk', sdk, infoitem], |
227 stdout=subprocess.PIPE, | 227 stdout=subprocess.PIPE) |
228 stderr=subprocess.STDOUT) | |
229 out = job.communicate()[0] | 228 out = job.communicate()[0] |
230 if job.returncode != 0: | 229 if job.returncode != 0: |
231 sys.stderr.write(out + '\n') | 230 sys.stderr.write(out + '\n') |
232 raise GypError('Error %d running xcodebuild' % job.returncode) | 231 raise GypError('Error %d running xcodebuild' % job.returncode) |
233 return out.rstrip('\n') | 232 return out.rstrip('\n') |
234 | 233 |
235 def _SdkPath(self): | 234 def _SdkPath(self): |
236 sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx') | 235 sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx') |
237 if sdk_root.startswith('/'): | 236 if sdk_root.startswith('/'): |
238 return sdk_root | 237 return sdk_root |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 def GetSpecPostbuildCommands(spec, quiet=False): | 1075 def GetSpecPostbuildCommands(spec, quiet=False): |
1077 """Returns the list of postbuilds explicitly defined on |spec|, in a form | 1076 """Returns the list of postbuilds explicitly defined on |spec|, in a form |
1078 executable by a shell.""" | 1077 executable by a shell.""" |
1079 postbuilds = [] | 1078 postbuilds = [] |
1080 for postbuild in spec.get('postbuilds', []): | 1079 for postbuild in spec.get('postbuilds', []): |
1081 if not quiet: | 1080 if not quiet: |
1082 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( | 1081 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( |
1083 spec['target_name'], postbuild['postbuild_name'])) | 1082 spec['target_name'], postbuild['postbuild_name'])) |
1084 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) | 1083 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) |
1085 return postbuilds | 1084 return postbuilds |
OLD | NEW |