[email protected] | d8b6599 | 2014-01-08 23:44:19 | [diff] [blame] | 1 | # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | import sys |
| 6 | |
| 7 | import recipe_util # pylint: disable=F0401 |
| 8 | |
| 9 | |
| 10 | # This class doesn't need an __init__ method, so we disable the warning |
| 11 | # pylint: disable=W0232 |
| 12 | class Naclports(recipe_util.Recipe): |
| 13 | """Basic Recipe class for naclports.""" |
| 14 | |
| 15 | @staticmethod |
| 16 | def fetch_spec(props): |
| 17 | url = 'https://chromium.googlesource.com/external/naclports.git' |
| 18 | solution = { 'name' :'src', |
| 19 | 'url' : url, |
| 20 | 'deps_file': 'DEPS', |
| 21 | 'managed' : False, |
| 22 | 'custom_deps': {}, |
| 23 | 'safesync_url': '', |
| 24 | } |
| 25 | spec = { |
| 26 | 'solutions': [solution], |
| 27 | 'svn_url': 'https://naclports.googlecode.com/svn', |
| 28 | 'svn_branch': 'trunk/src', |
[email protected] | 2ddad2c | 2014-03-03 18:34:28 | [diff] [blame] | 29 | 'svn_ref': 'master', |
[email protected] | d8b6599 | 2014-01-08 23:44:19 | [diff] [blame] | 30 | } |
| 31 | if props.get('submodule_git_svn_spec'): |
| 32 | spec['submodule_git_svn_spec'] = props['submodule_git_svn_spec'] |
| 33 | if props.get('target_os'): |
| 34 | spec['target_os'] = props['target_os'].split(',') |
| 35 | if props.get('target_os_only'): |
| 36 | spec['target_os_only'] = props['target_os_only'] |
| 37 | checkout_type = 'gclient_git_svn' |
| 38 | if props.get('nosvn'): |
| 39 | checkout_type = 'gclient_git' |
| 40 | spec_type = '%s_spec' % checkout_type |
| 41 | return { |
| 42 | 'type': checkout_type, |
| 43 | spec_type: spec, |
| 44 | } |
| 45 | |
| 46 | @staticmethod |
| 47 | def expected_root(_props): |
| 48 | return 'src' |
| 49 | |
| 50 | |
| 51 | def main(argv=None): |
| 52 | return Naclports().handle_args(argv) |
| 53 | |
| 54 | |
| 55 | if __name__ == '__main__': |
| 56 | sys.exit(main(sys.argv)) |