webrtc.py 1.13 KB
Newer Older
1 2 3 4 5 6
# Copyright (c) 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.

import sys

7
import config_util  # pylint: disable=import-error
8 9 10


# This class doesn't need an __init__ method, so we disable the warning
11
# pylint: disable=no-init
12 13
class WebRTC(config_util.Config):
  """Basic Config class for WebRTC."""
14 15 16

  @staticmethod
  def fetch_spec(props):
17
    url = 'https://webrtc.googlesource.com/src.git'
18 19 20 21 22 23 24 25 26 27
    spec = {
      'solutions': [
        {
          'name': 'src',
          'url': url,
          'deps_file': 'DEPS',
          'managed': False,
          'custom_deps': {},
        },
      ],
28
      'with_branch_heads': True,
29 30 31 32 33
    }

    if props.get('target_os'):
      spec['target_os'] = props['target_os'].split(',')

34 35 36
    if props.get('cache_dir'):
      spec['cache_dir'] = props['cache_dir']

37
    return {
38 39
      'type': 'gclient_git',
      'gclient_git_spec': spec,
40 41 42 43 44 45 46 47 48 49 50 51 52
    }

  @staticmethod
  def expected_root(_props):
    return 'src'


def main(argv=None):
  return WebRTC().handle_args(argv)


if __name__ == '__main__':
  sys.exit(main(sys.argv))