2013-05-13 22:55:10 +00:00
|
|
|
#!/usr/bin/env python
|
2013-03-13 19:12:05 +00:00
|
|
|
|
2013-05-13 22:55:10 +00:00
|
|
|
import os
|
|
|
|
import subprocess
|
2013-05-14 15:21:03 +00:00
|
|
|
import sys
|
2013-03-13 19:12:05 +00:00
|
|
|
|
|
|
|
|
2013-05-13 22:55:10 +00:00
|
|
|
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
2013-05-14 15:21:03 +00:00
|
|
|
GYP = {
|
|
|
|
'darwin': 'gyp',
|
|
|
|
'win32': 'gyp.bat',
|
|
|
|
}[sys.platform]
|
2013-05-13 22:55:10 +00:00
|
|
|
|
2013-05-14 17:29:35 +00:00
|
|
|
|
2013-05-13 22:55:10 +00:00
|
|
|
def main():
|
|
|
|
os.chdir(SOURCE_ROOT)
|
2013-05-14 17:29:35 +00:00
|
|
|
run_gyp()
|
|
|
|
build()
|
|
|
|
|
|
|
|
|
|
|
|
def run_gyp():
|
2013-05-14 15:21:03 +00:00
|
|
|
subprocess.check_call([GYP, '--depth', '.', 'brightray.gyp'])
|
2013-05-14 17:29:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
def build():
|
|
|
|
if sys.platform == 'darwin':
|
|
|
|
subprocess.check_call(['xcodebuild'])
|
|
|
|
return
|
|
|
|
|
|
|
|
assert sys.platform == 'win32', sys.platform
|
|
|
|
msbuild = os.path.join(os.environ['windir'], 'Microsoft.NET', 'Framework', 'v4.0.30319', 'MSBuild.exe')
|
|
|
|
subprocess.check_call([msbuild, 'brightray.sln'])
|
2013-05-13 22:55:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
sys.exit(main())
|