forked from phoboslab/JavaScriptCore-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.py
63 lines (49 loc) · 2.07 KB
/
make.py
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
import argparse
import logging
import os
import tempfile
import shutil
import subprocess
from xcodebuild import FrameworkBuild
"""Script to build JavaScriptCore.framework."""
__author__ = "Martijn The"
__email__ = "martijn@getpebble.com"
class PebbleKitiOSException (Exception):
pass
def build(out, derived_data_path):
outdir = out if out else tempfile.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'))
return outdir
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
if args.verbose:
log_level = logging.DEBUG
logging.basicConfig(format='[%(levelname)-8s] %(message)s',
level=log_level)
outdir = build(args.out, args.derived_data)
if args.no_open:
os.system("open %s" % outdir)