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

Side by Side Diff: build/config/ios/ios_app.py

Issue 1250913002: patch from chinmaygarde@ to make progress on mac, ios. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge to #341416 Created 5 years, 4 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
OLDNEW
(Empty)
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved.
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 argparse
6 import errno
7 import os
8 import subprocess
9 import sys
10
11
12 def ProcessInfoPlist(args):
13 output_plist_file = os.path.abspath(os.path.join(args.output, 'Info.plist'))
14 return subprocess.check_call( [
15 '/usr/bin/env',
16 'xcrun',
17 'plutil',
18 '-convert',
19 'binary1',
20 '-o',
21 output_plist_file,
22 '--',
23 args.input,
24 ])
25
26
27 def PerformCodeSigning(args):
28 return subprocess.check_call([
29 '/usr/bin/env',
30 'xcrun',
31 'codesign',
32 '--entitlements',
33 args.entitlements_path,
34 '--sign',
35 args.identity,
36 '-f',
37 args.application_path,
38 ])
39
40
41 def MakeDirectories(path):
42 try:
43 os.makedirs(path)
44 except OSError as exc:
45 if exc.errno == errno.EEXIST and os.path.isdir(path):
46 return 0
47 else:
48 return -1
49
sdefresne 2015/08/04 07:42:01 nit: remove blank line
Dirk Pranke 2015/08/04 18:27:15 will do.
50 return 0
51
52
53 def GenerateProjectStructure(args):
54 application_path = os.path.join(args.dir, args.name + ".app")
55 return MakeDirectories( application_path )
56
57
58 def main():
59 parser = argparse.ArgumentParser(description='A script that aids in '
60 'the creation of an iOS application')
61 subparsers = parser.add_subparsers()
62
63 # Plist Parser
64 plist_parser = subparsers.add_parser('plist',
65 help='Process the Info.plist')
66 plist_parser.set_defaults(func=ProcessInfoPlist)
67
68 plist_parser.add_argument('-i', dest='input', help='The input plist path')
69 plist_parser.add_argument('-o', dest='output', help='The output plist dir')
70
71 # Directory Structure Parser
72 dir_struct_parser = subparsers.add_parser('structure',
73 help='Creates the directory of an iOS application')
74
75 dir_struct_parser.set_defaults(func=GenerateProjectStructure)
76
77 dir_struct_parser.add_argument('-d', dest='dir', help='Out directory')
78 dir_struct_parser.add_argument('-n', dest='name', help='App name')
79
80 # Code Signing
81 code_signing_parser = subparsers.add_parser('codesign',
82 help='Code sign the specified application')
83
84 code_signing_parser.set_defaults(func=PerformCodeSigning)
85
86 code_signing_parser.add_argument('-p', dest='application_path', required=True,
87 help='The application path')
88 code_signing_parser.add_argument('-i', dest='identity', required=True,
89 help='The code signing identity to use')
90 code_signing_parser.add_argument('-e', dest='entitlements_path',
91 required=True,
92 help='The path to the entitlements .xcent')
93
94 # Engage!
95 args = parser.parse_args()
96 return args.func(args)
97
98
99 if __name__ == '__main__':
100 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698