| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Moves Apprtc to the out/ directory, where the browser test can find it. | 6 """Moves Apprtc to the out/ directory, where the browser test can find it.""" |
| 7 | |
| 8 This copy will resolve symlinks on all platforms, which is useful for Apprtc | |
| 9 since it uses symlinks for its common javascript files (and Windows does not | |
| 10 understand those symlinks). | |
| 11 """ | |
| 12 | 7 |
| 13 import fileinput | 8 import fileinput |
| 14 import os | 9 import os |
| 15 import shutil | 10 import shutil |
| 16 import sys | 11 import sys |
| 17 | 12 |
| 18 import utils | |
| 19 | 13 |
| 20 | 14 def _ConfigureApprtcServerToDeveloperMode(app_yaml_path): |
| 21 def _ConfigureApprtcServerToDeveloperMode(apprtc_dir): | |
| 22 app_yaml_path = os.path.join(apprtc_dir, 'app.yaml') | |
| 23 if not os.path.exists(app_yaml_path): | 15 if not os.path.exists(app_yaml_path): |
| 24 return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path) | 16 return 'Expected app.yaml at %s.' % os.path.abspath(app_yaml_path) |
| 25 | 17 |
| 26 for line in fileinput.input(app_yaml_path, inplace=True): | 18 for line in fileinput.input(app_yaml_path, inplace=True): |
| 27 # We can't click past these in the firefox interop test, so | 19 # We can't click past these in the firefox interop test, so |
| 28 # disable them. | 20 # disable them. |
| 29 line = line.replace('BYPASS_JOIN_CONFIRMATION: false', | 21 line = line.replace('BYPASS_JOIN_CONFIRMATION: false', |
| 30 'BYPASS_JOIN_CONFIRMATION: true') | 22 'BYPASS_JOIN_CONFIRMATION: true') |
| 31 sys.stdout.write(line) | 23 sys.stdout.write(line) |
| 32 | 24 |
| 33 | 25 |
| 34 def _CopyApprtcToTargetDir(target_dir, apprtc_subdir): | 26 def main(): |
| 27 target_dir = os.path.join('src', 'out', 'apprtc') |
| 35 shutil.rmtree(target_dir, ignore_errors=True) | 28 shutil.rmtree(target_dir, ignore_errors=True) |
| 36 shutil.copytree('webrtc-samples', | 29 shutil.copytree('apprtc', |
| 37 target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) | 30 target_dir, ignore=shutil.ignore_patterns('.svn', '.git')) |
| 38 | 31 |
| 39 # This file is symlinked on windows, so copy it since win doesn't understand | 32 app_yaml_path = os.path.join(target_dir, 'src', 'app_engine', 'app.yaml') |
| 40 # symlinks. | 33 _ConfigureApprtcServerToDeveloperMode(app_yaml_path) |
| 41 shutil.copyfile(os.path.join('webrtc-samples', 'samples', 'web', | |
| 42 'js', 'adapter.js'), | |
| 43 os.path.join(target_dir, apprtc_subdir, 'js', 'adapter.js')) | |
| 44 | 34 |
| 45 | 35 |
| 46 def main(): | |
| 47 target_dir = os.path.join('src', 'out', 'webrtc-samples') | |
| 48 apprtc_subdir = os.path.join('samples', 'web', 'content', 'apprtc') | |
| 49 _CopyApprtcToTargetDir(target_dir, apprtc_subdir) | |
| 50 _ConfigureApprtcServerToDeveloperMode(os.path.join(target_dir, apprtc_subdir)) | |
| 51 | |
| 52 if __name__ == '__main__': | 36 if __name__ == '__main__': |
| 53 sys.exit(main()) | 37 sys.exit(main()) |
| 54 | 38 |
| OLD | NEW |