Chromium Code Reviews| Index: build_apprtc_collider.py |
| =================================================================== |
| --- build_apprtc_collider.py (revision 0) |
| +++ build_apprtc_collider.py (working copy) |
| @@ -0,0 +1,43 @@ |
| +#!/usr/bin/python |
| +# Copyright 2014 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# found in the LICENSE file. |
| + |
| +"""Builds the AppRTC collider using the golang toolchain. |
| + |
| +The golang toolchain is downloaded by download_golang.py. We use that here |
| +to build the AppRTC collider server. |
| +""" |
| + |
| +import os |
| +import shutil |
| +import subprocess |
| +import sys |
| + |
| +import utils |
| + |
| + |
| +def main(): |
| + web_samples_dir = os.path.join('webrtc-samples', 'samples/web') |
|
kjellander_chromium
2014/12/08 13:58:07
'samples/web' -> 'samples', 'web'
phoglund_chromium
2014/12/08 14:26:15
Done.
|
| + golang_workspace = os.path.join('src', 'out', 'go-workspace') |
| + shutil.rmtree(golang_workspace, ignore_errors=True) |
| + golang_workspace_src = os.path.join(golang_workspace, 'src') |
| + |
| + collider_dir = os.path.join(web_samples_dir, 'content', 'apprtc', 'collider') |
| + shutil.copytree(collider_dir, golang_workspace_src, |
| + ignore=shutil.ignore_patterns('.svn')) |
|
kjellander_chromium
2014/12/08 13:58:07
what if they move to .git?
phoglund_chromium
2014/12/08 14:26:15
I'll make it ignore .git too then.
|
| + |
| + golang_binary = 'go%s' % ('.exe' if utils.GetPlatform() == 'win' else '') |
| + golang_path = os.path.join('go', 'bin', golang_binary) |
| + |
| + golang_env = os.environ.copy() |
| + golang_env['GOROOT'] = os.path.abspath('go') |
| + golang_env['GOPATH'] = os.path.abspath(golang_workspace) |
| + golang_env['PATH'] += os.pathsep + os.path.abspath('mercurial') |
| + subprocess.check_call([golang_path, 'get', 'collidermain'], |
| + env=golang_env) |
| + subprocess.check_call([golang_path, 'install', 'collidermain'], |
|
kjellander_chromium
2014/12/08 13:58:07
Is it "installed" somewhere outside the workspace?
phoglund_chromium
2014/12/08 14:26:15
Good question, it might be. I should actually invo
|
| + env=golang_env) |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main()) |
| Property changes on: build_apprtc_collider.py |
| ___________________________________________________________________ |
| Added: svn:executable |
| ## -0,0 +1 ## |
| +* |
| \ No newline at end of property |
| Added: svn:eol-style |
| ## -0,0 +1 ## |
| +LF |
| \ No newline at end of property |