Merge pull request #8668 from electron/fix-mas
[platform/framework/web/crosswalk-tizen.git] / script / build-libchromiumcontent.py
1 #!/usr/bin/env python
2
3 import argparse
4 import os
5 import sys
6
7 from lib.config import enable_verbose_mode, get_target_arch
8 from lib.util import execute_stdout
9
10
11 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
12
13
14 def main():
15   os.chdir(SOURCE_ROOT)
16
17   args = parse_args()
18   if args.verbose:
19     enable_verbose_mode()
20
21   # ./script/bootstrap
22   # ./script/update -t x64 --defines=''
23   # ./script/build --no_shared_library -t x64
24   # ./script/create-dist -c static_library -t x64 --no_zip
25   script_dir = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor',
26                             'libchromiumcontent', 'script')
27   bootstrap = os.path.join(script_dir, 'bootstrap')
28   update = os.path.join(script_dir, 'update')
29   build = os.path.join(script_dir, 'build')
30   create_dist = os.path.join(script_dir, 'create-dist')
31   execute_stdout([sys.executable, bootstrap])
32   execute_stdout([sys.executable, update, '-t', args.target_arch,
33                   '--defines', args.defines])
34   execute_stdout([sys.executable, build, '-R', '-t', args.target_arch])
35   execute_stdout([sys.executable, create_dist, '-c', 'static_library',
36                   '--no_zip', '-t', args.target_arch])
37
38
39 def parse_args():
40   parser = argparse.ArgumentParser(description='Build libchromiumcontent')
41   parser.add_argument('--target_arch',
42                       help='Specify the arch to build for')
43   parser.add_argument('--defines', default='',
44                       help='The definetions passed to gyp')
45   parser.add_argument('-v', '--verbose', action='store_true',
46                       help='Prints the output of the subprocesses')
47   return parser.parse_args()
48
49
50 if __name__ == '__main__':
51   sys.exit(main())