Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3343)

Unified Diff: build_apprtc_closure.py

Issue 872423002: Adding support for AppRTC closure compiling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/webrtc/webrtc.DEPS/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « DEPS ('k') | copy_apprtc.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build_apprtc_closure.py
===================================================================
--- build_apprtc_closure.py (revision 0)
+++ build_apprtc_closure.py (working copy)
@@ -0,0 +1,48 @@
+#!/usr/bin/python
+# Copyright 2015 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.
+
+"""Invokes the AppRTC closure compiler.
+
+The AppRTC javascript code must be closure-compiled. This script uses
+the node toolchain we downloaded earlier.
+"""
+
+import os
+import shutil
+import subprocess
+import sys
+
+import utils
+
+
+def main():
+ node_path = os.path.abspath('node')
+ if not os.path.exists(node_path):
+ return 'Expected node at %s.' % node_path
+ samples_path = os.path.join('src', 'out', 'webrtc-samples')
+ if not os.path.exists(samples_path):
+ return 'Expected webrtc-samples at %s.' % os.path.abspath(samples_path)
+
+ os.chdir(samples_path)
+
+ if utils.GetPlatform() is 'win':
+ npm_bin = os.path.join(node_path, 'npm.cmd')
+ node_bin = os.path.join(node_path, 'node.exe')
+ else:
+ npm_bin = os.path.join(node_path, 'bin', 'npm')
+ node_bin = os.path.join(node_path, 'bin', 'node')
+
+ subprocess.check_call([npm_bin, 'install'])
+ local_grunt_bin = os.path.join('node_modules', 'grunt-cli', 'bin', 'grunt')
+
+ if not os.path.exists(local_grunt_bin):
+ return ('Missing grunt-cli in the webrtc-samples checkout; did '
+ 'npm install fail?')
+
+ subprocess.check_call([node_bin, local_grunt_bin, 'closurecompiler:debug'])
+
+
+if __name__ == '__main__':
+ sys.exit(main())
Property changes on: build_apprtc_closure.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
« no previous file with comments | « DEPS ('k') | copy_apprtc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698