Add new mirror for AppRTC due to code move at GitHub.

This mirror will be replaced by a Chrome infra mirror
as soon as crbug.com/455758 is fixed.

BUG=455758
TESTED=Successfully ran gclient runhooks in a checkout with
the webrtc.DEPS solution added and the old webrtc-samples dir
removed.

Review URL: https://codereview.chromium.org/900403002

git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/webrtc/webrtc.DEPS@293976 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..337d551
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+golang/linux/go.tar.gz
+google-appengine.zip
+mercurial-src.tar.gz
+node/linux/node.tar.gz
+third_party/
+
diff --git a/DEPS b/DEPS
index f9059b0..dad006e 100644
--- a/DEPS
+++ b/DEPS
@@ -7,8 +7,10 @@
 }
 
 deps = {
-  'webrtc-samples':
-    Var('git_url') + '/external/webrtc-samples.git',
+  # TODO(kjellander): Replace the AppRTC location with a GoB mirror as soon as
+  # crbug.com/455758 is resolved.
+  'apprtc':
+    'https://github.com/webrtc/apprtc.git',
   'webrtc.DEPS/third_party/manifestdestiny':
     Var('git_url') + '/chromium/deps/manifestdestiny.git@46ae53ac463e23bfefec374a81806355ea598ac4',
   'webrtc.DEPS/third_party/mozdownload':
@@ -62,10 +64,10 @@
                 "webrtc.DEPS/build_apprtc_collider.py"],
   },
   {
-    # Build AppRTC closure Javascript.
+    # Build the AppRTC App Engine Application.
     "pattern": ".",
     "action" : ["python",
-                "webrtc.DEPS/build_apprtc_closure.py"],
+                "webrtc.DEPS/build_apprtc_appengine_app.py"],
   },
   {
     # Download media files and tools used by the webrtc quality browser tests,
diff --git a/build_apprtc_closure.py b/build_apprtc_appengine_app.py
similarity index 76%
rename from build_apprtc_closure.py
rename to build_apprtc_appengine_app.py
index 1a1f2ee..c1f91b2 100755
--- a/build_apprtc_closure.py
+++ b/build_apprtc_appengine_app.py
@@ -3,7 +3,7 @@
 # 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.
+"""Invokes grunt build on AppRTC.
 
 The AppRTC javascript code must be closure-compiled. This script uses
 the node toolchain we downloaded earlier.
@@ -34,12 +34,12 @@
   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)
+  apprtc_path = os.path.join('src', 'out', 'apprtc')
+  if not os.path.exists(apprtc_path):
+    return 'Expected apprtc at %s.' % os.path.abspath(apprtc_path)
 
-  _WorkaroundPhantomJsOnWin(samples_path)
-  os.chdir(samples_path)
+  _WorkaroundPhantomJsOnWin(apprtc_path)
+  os.chdir(apprtc_path)
   
   if utils.GetPlatform() is 'win':
     npm_bin = os.path.join(node_path, 'npm.cmd')
@@ -52,11 +52,10 @@
   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 '
+    return ('Missing grunt-cli in the apprtc checkout; did '
             'npm install fail?')
 
-  utils.RunSubprocessWithRetry([node_bin, local_grunt_bin,
-                               'closurecompiler:debug'])
+  utils.RunSubprocessWithRetry([node_bin, local_grunt_bin, 'build'])
 
 
 if __name__ == '__main__':
diff --git a/build_apprtc_collider.py b/build_apprtc_collider.py
index 4b0f86b..b5d63dd 100755
--- a/build_apprtc_collider.py
+++ b/build_apprtc_collider.py
@@ -18,12 +18,12 @@
 
 
 def main():
-  web_samples_dir = os.path.join('webrtc-samples', 'samples', 'web')
+  apprtc_dir = os.path.join('apprtc', 'src')
   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')
+  collider_dir = os.path.join(apprtc_dir, 'collider')
   shutil.copytree(collider_dir, golang_workspace_src,
                   ignore=shutil.ignore_patterns('.svn', '.git'))
 
diff --git a/copy_apprtc.py b/copy_apprtc.py
index 538e50f..2ed2e95 100755
--- a/copy_apprtc.py
+++ b/copy_apprtc.py
@@ -3,23 +3,15 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-"""Moves Apprtc to the out/ directory, where the browser test can find it.
-
-This copy will resolve symlinks on all platforms, which is useful for Apprtc
-since it uses symlinks for its common javascript files (and Windows does not
-understand those symlinks).
-"""
+"""Moves Apprtc to the out/ directory, where the browser test can find it."""
 
 import fileinput
 import os
 import shutil
 import sys
 
-import utils
 
-
-def _ConfigureApprtcServerToDeveloperMode(apprtc_dir):
-  app_yaml_path = os.path.join(apprtc_dir, 'app.yaml')
+def _ConfigureApprtcServerToDeveloperMode(app_yaml_path):
   if not os.path.exists(app_yaml_path):
     return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path)
 
@@ -31,24 +23,16 @@
     sys.stdout.write(line)
 
 
-def _CopyApprtcToTargetDir(target_dir, apprtc_subdir):
+def main():
+  target_dir = os.path.join('src', 'out', 'apprtc')
   shutil.rmtree(target_dir, ignore_errors=True)
-  shutil.copytree('webrtc-samples',
+  shutil.copytree('apprtc',
                   target_dir, ignore=shutil.ignore_patterns('.svn', '.git'))
 
-  # This file is symlinked on windows, so copy it since win doesn't understand
-  # symlinks.
-  shutil.copyfile(os.path.join('webrtc-samples', 'samples', 'web',
-                               'js', 'adapter.js'),
-                  os.path.join(target_dir, apprtc_subdir, 'js', 'adapter.js'))
+  app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml')
+  _ConfigureApprtcServerToDeveloperMode(app_yaml_path)
 
 
-def main():
-  target_dir = os.path.join('src', 'out', 'webrtc-samples')
-  apprtc_subdir = os.path.join('samples', 'web', 'content', 'apprtc')
-  _CopyApprtcToTargetDir(target_dir, apprtc_subdir)
-  _ConfigureApprtcServerToDeveloperMode(os.path.join(target_dir, apprtc_subdir))
-
 if __name__ == '__main__':
   sys.exit(main())