electron/brightray/script/build
2013-08-06 17:25:07 -04:00

35 lines
787 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 = {
'win32': 'gyp.bat',
}.get(sys.platform, 'gyp')
def main():
os.chdir(SOURCE_ROOT)
return (run_gyp() or build())
def run_gyp():
return subprocess.call([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
msbuild = os.path.join(os.environ['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
return subprocess.call([msbuild, 'brightray.sln'])
if __name__ == '__main__':
sys.exit(main())