electron/brightray/script/build

34 lines
808 B
Text
Raw Normal View History

#!/usr/bin/env python
2013-03-13 19:12:05 +00:00
import os
import subprocess
import sys
2013-03-13 19:12:05 +00:00
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
GYP = os.path.join(SOURCE_ROOT, 'vendor', 'gyp', 'gyp_main.py')
2013-05-14 17:29:35 +00:00
def main():
os.chdir(SOURCE_ROOT)
2013-08-06 21:25:07 +00:00
return (run_gyp() or build())
2013-05-14 17:29:35 +00:00
def run_gyp():
return subprocess.call([sys.executable, GYP, '--depth', '.', 'brightray.gyp'])
2013-05-14 17:29:35 +00:00
def build():
if sys.platform == 'darwin':
2013-08-06 21:25:07 +00:00
return subprocess.call(['xcodebuild'])
if sys.platform == 'linux2':
return subprocess.call(['make'])
2013-05-14 17:29:35 +00:00
assert sys.platform == 'win32', sys.platform
msbuild = os.path.join(os.environ['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
2013-08-06 21:25:07 +00:00
return subprocess.call([msbuild, 'brightray.sln'])
if __name__ == '__main__':
sys.exit(main())