Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: components/cronet/tools/cr_cronet.py

Issue 360403002: cr_cronet - simple cr-like wrapper to help with cronet builds. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 """
7 cr_cronet.py - cr - like helper tool for cronet developers
8 """
9
10 import argparse
11 import os
12 import sys
13
14 def run(command):
15 print command
16 return os.system(command)
17
18 def main():
19 parser = argparse.ArgumentParser()
20 parser.add_argument('command',
21 choices=['init',
22 'sync',
23 'build',
24 'install',
25 'test',
26 'debug'])
27
28 options = parser.parse_args()
29 print options
30 print options.command
31 gyp_defines = 'GYP_DEFINES="OS=android enable_websockets=0 '+ \
32 'disable_file_support=1 disable_ftp_support=1 '+ \
33 'use_icu_alternatives_on_android=1" '
34
35 if (options.command=='init'):
36 return run (gyp_defines + ' gclient runhooks')
37 if (options.command=='sync'):
38 run ('git pull --rebase')
39 return run (gyp_defines + ' gclient sync')
mmenke 2014/07/09 14:23:05 What happens if the rebase fails or there's a merg
mef 2014/07/09 15:18:26 It still does the gclient sync. I guess this is wr
40 if (options.command=='build'):
41 return run ('ninja -C out/Debug cronet_sample_test_apk')
42 if (options.command=='install'):
43 return run ('build/android/adb_install_apk.py --apk=CronetSample.apk')
44 if (options.command=='test'):
45 return run ('build/android/test_runner.py instrumentation '+ \
46 '--test-apk=CronetSampleTest')
47
48 parser.print_help()
49 return 1
50
51
52 if __name__ == '__main__':
53 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698