- Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathmake.py
More file actions
Latest commit
63 lines (49 loc) · 2.07 KB
/
Copy pathmake.py
File metadata and controls
63 lines (49 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
importargparse
importlogging
importos
importtempfile
importshutil
importsubprocess
fromxcodebuildimportFrameworkBuild
"""Script to build JavaScriptCore.framework."""
__author__="Martijn The"
__email__="martijn@getpebble.com"
classPebbleKitiOSException (Exception):
pass
defbuild(out, derived_data_path):
outdir=outifoutelsetempfile.mkdtemp()
jsc=FrameworkBuild(workspace="JavaScriptCore-iOS.xcworkspace",
scheme="JavaScriptCore iOS",
name="JavaScriptCore",
conf="Production",
outdir=outdir,
derived_data_path=derived_data_path)
jsc.build()
# FIXME: wtf headers are copied... remove them:
shutil.rmtree(os.path.join(outdir, 'JavaScriptCore.framework',
'Headers', 'wtf'))
returnoutdir
if__name__=="__main__":
parser=argparse.ArgumentParser(description='Build'
' JavaScriptCore.framework')
parser.add_argument('--out', default=None, type=str,
help="Output directory. Defaults to a random' \
' temporary folder.")
parser.add_argument('--derived-data', default=None, type=str,
help="Derived data directory. Defaults to a random' \
' temporary folder.")
parser.add_argument('--verbose', action='store_const', default=False,
const=True, help="Enable verbose logging.")
parser.add_argument('--no-open', action='store_const', default=True,
const=False, help="Use `--no-open` to skip' \
' revealing the built product in Finder.")
args=parser.parse_args()
log_level=logging.INFO
ifargs.verbose:
log_level=logging.DEBUG
logging.basicConfig(format='[%(levelname)-8s] %(message)s',
level=log_level)
outdir=build(args.out, args.derived_data)
ifargs.no_open:
os.system("open %s"%outdir)