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

Side by Side Diff: build/android/method_count.py

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors Created 5 years, 3 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
« no previous file with comments | « build/android/lint/suppress.py ('k') | build/android/preprocess_google_play_services.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! /usr/bin/env python 1 #! /usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import os 7 import os
8 import re 8 import re
9 import sys 9 import sys
10 10
11 from devil.android.sdk import dexdump 11 from devil.android.sdk import dexdump
12 from pylib import constants 12 from pylib import constants
13 13
14 sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 14 sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib',
15 'common')) 15 'common'))
16 import perf_tests_results_helper 16 import perf_tests_results_helper # pylint: disable=import-error
17 17
18 18
19 _METHOD_IDS_SIZE_RE = re.compile(r'^method_ids_size +: +(\d+)$') 19 _METHOD_IDS_SIZE_RE = re.compile(r'^method_ids_size +: +(\d+)$')
20 20
21 def MethodCount(dexfile): 21 def MethodCount(dexfile):
22 for line in dexdump.DexDump(dexfile, file_summary=True): 22 for line in dexdump.DexDump(dexfile, file_summary=True):
23 m = _METHOD_IDS_SIZE_RE.match(line) 23 m = _METHOD_IDS_SIZE_RE.match(line)
24 if m: 24 if m:
25 return m.group(1) 25 return m.group(1)
26 raise Exception('"method_ids_size" not found in dex dump of %s' % dexfile) 26 raise Exception('"method_ids_size" not found in dex dump of %s' % dexfile)
(...skipping 19 matching lines...) Expand all
46 'and --apk-name was not provided.' % args.dexfile) 46 'and --apk-name was not provided.' % args.dexfile)
47 47
48 method_count = MethodCount(args.dexfile) 48 method_count = MethodCount(args.dexfile)
49 perf_tests_results_helper.PrintPerfResult( 49 perf_tests_results_helper.PrintPerfResult(
50 '%s_methods' % args.apk_name, 'total', [method_count], 'methods') 50 '%s_methods' % args.apk_name, 'total', [method_count], 'methods')
51 return 0 51 return 0
52 52
53 if __name__ == '__main__': 53 if __name__ == '__main__':
54 sys.exit(main()) 54 sys.exit(main())
55 55
OLDNEW
« no previous file with comments | « build/android/lint/suppress.py ('k') | build/android/preprocess_google_play_services.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698