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

Unified 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: Sync should fail if git pull fails. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ae971442e0fddad414b2525e024eba1a6fa0ade8
--- /dev/null
+++ b/components/cronet/tools/cr_cronet.py
@@ -0,0 +1,52 @@
+#!/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
+ gyp_defines = 'GYP_DEFINES="OS=android enable_websockets=0 '+ \
+ 'disable_file_support=1 disable_ftp_support=1 '+ \
+ 'use_icu_alternatives_on_android=1" '
+
+ if (options.command=='init'):
+ return run (gyp_defines + ' gclient runhooks')
+ if (options.command=='sync'):
+ return run ('git pull --rebase && ' + gyp_defines + ' 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()
+ return 1
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« 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