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

Side by Side Diff: chrome/tools/build/mac/copy_keystone_framework.py

Issue 1991873003: [Mac/GN] Setup Keystone for official Chrome builds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
« no previous file with comments | « chrome/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
Mark Mentovai 2016/05/18 17:53:10 #!/usr/bin/env python
Robert Sesek 2016/05/18 18:36:25 This isn't done for GN scripts because GN explicit
Mark Mentovai 2016/05/18 18:40:11 Then put python in the usage on line 10, because i
Robert Sesek 2016/05/18 18:43:45 Done.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os.path
6 import shutil
7 import subprocess
8 import sys
9
10 # Usage: copy_keystone_framework.py /path/to/input /path/to/output
11 #
12 # This script copies the KeystoneRegistration.framework, removing its
13 # versioned directory structure, thinning it to just x86_64, and deleting
14 # the Headers directory.
15
16 def Main(args):
17 if len(args) != 3:
18 print >> sys.stderr, '%s: /path/to/input /path/to/output' % (args[0],)
19 return 1
20
21 # Delete any old copies of the framework.
22 output_path = os.path.join(args[2], 'KeystoneRegistration.framework')
23 if os.path.exists(output_path):
24 shutil.rmtree(output_path)
25
26 # Copy the framework out of its versioned directory.
27 shutil.copytree(os.path.join(args[1], 'Versions/A'), output_path)
Mark Mentovai 2016/05/18 17:53:10 os.readlink(os.path.join(args[1], 'Versions/Curren
Robert Sesek 2016/05/18 18:36:25 Switched to using rsync and Versions/Current/ so d
Mark Mentovai 2016/05/18 18:40:11 Robert Sesek wrote:
28
29 # Strip headers from the shipped product.
Mark Mentovai 2016/05/18 17:53:10 Lose PrivateHeaders too, unless it’s an error to r
Robert Sesek 2016/05/18 18:36:25 Switched to rsync using the same incantation as co
30 shutil.rmtree(os.path.join(output_path, 'Headers'))
31
32 # Thin the library to just the required arch.
33 library_path = os.path.join(output_path, 'KeystoneRegistration')
34 return subprocess.check_call(
Mark Mentovai 2016/05/18 17:53:11 check_call won’t return nonzero, but hiding that z
Robert Sesek 2016/05/18 18:36:25 Done.
35 ['lipo', '-thin', 'x86_64', library_path, '-o', library_path])
36
37
38 if __name__ == '__main__':
39 sys.exit(Main(sys.argv))
OLDNEW
« no previous file with comments | « chrome/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698