2013-06-24 07:36:38 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
CONFIGURATIONS = ['Release', 'Debug']
|
2013-07-07 08:25:50 +00:00
|
|
|
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
|
2013-06-24 07:36:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2013-07-07 08:25:50 +00:00
|
|
|
os.chdir(SOURCE_ROOT)
|
|
|
|
|
|
|
|
ninja = os.path.join('vendor', 'depot_tools', 'ninja')
|
|
|
|
if sys.platform == 'win32':
|
|
|
|
ninja += '.exe'
|
|
|
|
|
2013-06-24 07:36:38 +00:00
|
|
|
args = parse_args()
|
|
|
|
for config in args.configuration:
|
|
|
|
build_path = os.path.join('out', config)
|
2013-07-07 08:25:50 +00:00
|
|
|
subprocess.call([ninja, '-C', build_path])
|
2013-06-24 07:36:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
def parse_args():
|
|
|
|
parser = argparse.ArgumentParser(description='Build atom-shell')
|
|
|
|
parser.add_argument('-c', '--configuration',
|
|
|
|
help='Build with Release or Debug configuration',
|
|
|
|
nargs='+',
|
|
|
|
default=CONFIGURATIONS,
|
|
|
|
required=False)
|
|
|
|
return parser.parse_args()
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|