electron/brightray/script/build

34 lines
867 B
Python
Executable file

#!/usr/bin/env python
import os
import subprocess
import sys
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
GYP = os.path.join(SOURCE_ROOT, 'vendor', 'gyp', 'gyp_main.py')
def main():
os.chdir(SOURCE_ROOT)
return (run_gyp() or build())
def run_gyp():
return subprocess.call([sys.executable, GYP, '--depth', '.', 'brightray.gyp'])
def build():
if sys.platform == 'darwin':
return subprocess.call(['xcodebuild'])
if sys.platform == 'linux2':
return subprocess.call(['make'])
assert sys.platform == 'win32', sys.platform
program_files = os.environ.get('PROGRAMFILES(X86)', os.environ['PROGRAMFILES'])
msbuild = os.path.join(program_files, 'MSBuild', '12.0', 'Bin', 'MSBuild.exe')
return subprocess.call([msbuild, 'brightray.sln'])
if __name__ == '__main__':
sys.exit(main())