Chromium Code Reviews| Index: components/cronet/tools/cr_cronet.py |
| diff --git a/components/cronet/tools/cr_cronet.py b/components/cronet/tools/cr_cronet.py |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..53e4ca7b9ef9d5dd95381b1510c51a503bb720ec |
| --- /dev/null |
| +++ b/components/cronet/tools/cr_cronet.py |
| @@ -0,0 +1,41 @@ |
| +#!/usr/bin/python |
| +# Copyright 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. |
| + |
| +""" |
| +cr_cronet.py - cr - like helper tool for cronet developers |
| +""" |
| + |
| +import argparse |
| +import os |
| +import sys |
| + |
| +def run(command): |
| + print command |
| + return os.system(command) |
| + |
| +def main(): |
| + parser = argparse.ArgumentParser() |
| + parser.add_argument('command', choices=['init', 'sync', 'build', 'install', 'test', 'debug']) |
| + options = parser.parse_args() |
| + print options |
| + print options.command |
| + |
| + if (options.command=='init'): |
| + return run ('GYP_DEFINES="OS=android enable_websockets=0 disable_file_support=1 disable_ftp_support=1 use_icu_alternatives_on_android=1" gclient runhooks') |
|
mmenke
2014/07/07 17:05:20
Should the first part of this also be run before s
mef
2014/07/09 13:43:53
Done.
|
| + if (options.command=='sync'): |
| + return run ('git pull --rebase && gclient sync') |
| + if (options.command=='build'): |
| + return run ('ninja -C out/Debug cronet_sample_test_apk') |
| + if (options.command=='install'): |
| + return run ('build/android/adb_install_apk.py --apk=CronetSample.apk') |
| + if (options.command=='test'): |
| + return run ('build/android/test_runner.py instrumentation --test-apk=CronetSampleTest') |
| + |
| + #parser.print_help() |
|
mmenke
2014/07/07 17:05:20
This should be fixed (Get rid of it, make it work
mef
2014/07/09 13:43:53
Done.
|
| + return 1 |
| + |
| + |
| +if __name__ == '__main__': |
| + sys.exit(main()) |