Rewrite build script in python.
This commit is contained in:
parent
3cc304cbe5
commit
5c4c86c6ef
2 changed files with 30 additions and 12 deletions
12
script/build
12
script/build
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
MODE=Release
|
|
||||||
if [ ! -z $1 ]; then
|
|
||||||
MODE=$1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd "$(dirname "$0")/.."
|
|
||||||
|
|
||||||
xcodebuild -configuration ${MODE} -target atom
|
|
30
script/build.py
Executable file
30
script/build.py
Executable file
|
@ -0,0 +1,30 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
CONFIGURATIONS = ['Release', 'Debug']
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
args = parse_args()
|
||||||
|
for config in args.configuration:
|
||||||
|
build_path = os.path.join('out', config)
|
||||||
|
subprocess.check_call(['ninja', '-C', build_path])
|
||||||
|
|
||||||
|
|
||||||
|
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())
|
Loading…
Add table
Add a link
Reference in a new issue