Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: pylib/gyp/mac_tool.py

Issue 51103013: Add storyboard support. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pylib/gyp/xcode_emulation.py » ('j') | pylib/gyp/xcode_emulation.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 Google Inc. All rights reserved. 2 # Copyright (c) 2012 Google Inc. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Utility functions to perform Xcode-style build steps. 6 """Utility functions to perform Xcode-style build steps.
7 7
8 These functions are executed via gyp-mac-tool when using the Makefile generator. 8 These functions are executed via gyp-mac-tool when using the Makefile generator.
9 """ 9 """
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 """Copies a resource file to the bundle/Resources directory, performing any 46 """Copies a resource file to the bundle/Resources directory, performing any
47 necessary compilation on each resource.""" 47 necessary compilation on each resource."""
48 extension = os.path.splitext(source)[1].lower() 48 extension = os.path.splitext(source)[1].lower()
49 if os.path.isdir(source): 49 if os.path.isdir(source):
50 # Copy tree. 50 # Copy tree.
51 if os.path.exists(dest): 51 if os.path.exists(dest):
52 shutil.rmtree(dest) 52 shutil.rmtree(dest)
53 shutil.copytree(source, dest) 53 shutil.copytree(source, dest)
54 elif extension == '.xib': 54 elif extension == '.xib':
55 return self._CopyXIBFile(source, dest) 55 return self._CopyXIBFile(source, dest)
56 elif extension == '.storyboard':
57 return self._CopyXIBFile(source, dest)
56 elif extension == '.strings': 58 elif extension == '.strings':
57 self._CopyStringsFile(source, dest) 59 self._CopyStringsFile(source, dest)
58 else: 60 else:
59 shutil.copyfile(source, dest) 61 shutil.copyfile(source, dest)
60 62
61 def _CopyXIBFile(self, source, dest): 63 def _CopyXIBFile(self, source, dest):
62 """Compiles a XIB file with ibtool into a binary plist in the bundle.""" 64 """Compiles a XIB file with ibtool into a binary plist in the bundle."""
63 tools_dir = os.environ.get('DEVELOPER_BIN_DIR', '/usr/bin') 65 tools_dir = os.environ.get('DEVELOPER_BIN_DIR', '/usr/bin')
64 args = [os.path.join(tools_dir, 'ibtool'), '--errors', '--warnings', 66 args = [os.path.join(tools_dir, 'ibtool'), '--errors', '--warnings',
65 '--notices', '--output-format', 'human-readable-text', '--compile', 67 '--notices', '--output-format', 'human-readable-text', '--compile',
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 def _Relink(self, dest, link): 246 def _Relink(self, dest, link):
245 """Creates a symlink to |dest| named |link|. If |link| already exists, 247 """Creates a symlink to |dest| named |link|. If |link| already exists,
246 it is overwritten.""" 248 it is overwritten."""
247 if os.path.lexists(link): 249 if os.path.lexists(link):
248 os.remove(link) 250 os.remove(link)
249 os.symlink(dest, link) 251 os.symlink(dest, link)
250 252
251 253
252 if __name__ == '__main__': 254 if __name__ == '__main__':
253 sys.exit(main(sys.argv[1:])) 255 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | pylib/gyp/xcode_emulation.py » ('j') | pylib/gyp/xcode_emulation.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698