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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 libraries = [ self._AdjustLibrary(library) for library in libraries] | 761 libraries = [ self._AdjustLibrary(library) for library in libraries] |
762 return libraries | 762 return libraries |
763 | 763 |
764 def _BuildMachineOSBuild(self): | 764 def _BuildMachineOSBuild(self): |
765 return self._GetStdout(['sw_vers', '-buildVersion']) | 765 return self._GetStdout(['sw_vers', '-buildVersion']) |
766 | 766 |
767 def _XcodeVersion(self): | 767 def _XcodeVersion(self): |
768 # `xcodebuild -version` output looks like | 768 # `xcodebuild -version` output looks like |
769 # Xcode 4.6.3 | 769 # Xcode 4.6.3 |
770 # Build version 4H1503 | 770 # Build version 4H1503 |
| 771 # or like |
| 772 # Xcode 3.2.6 |
| 773 # Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0 |
| 774 # BuildVersion: 10M2518 |
771 # Convert that to '0463', '4H1503'. | 775 # Convert that to '0463', '4H1503'. |
772 version, build = self._GetStdout(['xcodebuild', '-version']).splitlines() | 776 version_list = self._GetStdout(['xcodebuild', '-version']).splitlines() |
| 777 version = version_list[0] |
| 778 build = version_list[-1] |
773 # Be careful to convert "4.2" to "0420": | 779 # Be careful to convert "4.2" to "0420": |
774 version = version.split()[-1].replace('.', '') | 780 version = version.split()[-1].replace('.', '') |
775 version = (version + '0' * (3 - len(version))).zfill(4) | 781 version = (version + '0' * (3 - len(version))).zfill(4) |
776 build = build.split()[-1] | 782 build = build.split()[-1] |
777 return version, build | 783 return version, build |
778 | 784 |
779 def GetExtraPlistItems(self): | 785 def GetExtraPlistItems(self): |
780 """Returns a dictionary with extra items to insert into Info.plist.""" | 786 """Returns a dictionary with extra items to insert into Info.plist.""" |
781 if not XcodeSettings._plist_cache: | 787 if not XcodeSettings._plist_cache: |
782 cache = XcodeSettings._plist_cache | 788 cache = XcodeSettings._plist_cache |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 def GetSpecPostbuildCommands(spec, quiet=False): | 1174 def GetSpecPostbuildCommands(spec, quiet=False): |
1169 """Returns the list of postbuilds explicitly defined on |spec|, in a form | 1175 """Returns the list of postbuilds explicitly defined on |spec|, in a form |
1170 executable by a shell.""" | 1176 executable by a shell.""" |
1171 postbuilds = [] | 1177 postbuilds = [] |
1172 for postbuild in spec.get('postbuilds', []): | 1178 for postbuild in spec.get('postbuilds', []): |
1173 if not quiet: | 1179 if not quiet: |
1174 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( | 1180 postbuilds.append('echo POSTBUILD\\(%s\\) %s' % ( |
1175 spec['target_name'], postbuild['postbuild_name'])) | 1181 spec['target_name'], postbuild['postbuild_name'])) |
1176 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) | 1182 postbuilds.append(gyp.common.EncodePOSIXShellList(postbuild['action'])) |
1177 return postbuilds | 1183 return postbuilds |
OLD | NEW |