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

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

Issue 1188253013: [Android] Add a java method counting script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | build/android/pylib/sdk/__init__.py » ('j') | build/android/pylib/sdk/dexdump.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #! /usr/bin/env python
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
4 # found in the LICENSE file.
5
6 import argparse
7 import re
8 import sys
9
10 from pylib.sdk import dexdump
11
12 _METHOD_IDS_SIZE_RE = re.compile(r'^method_ids_size +: +(\d+)$')
13
14 def MethodCount(dexfile):
15 for line in dexdump.DexDump(dexfile, file_summary=True):
16 m = _METHOD_IDS_SIZE_RE.match(line)
17 if m:
18 return m.group(1)
19 raise Exception('"method_ids_size" not found in dex dump of %s' % dexfile)
20
21 def main():
22 parser = argparse.ArgumentParser()
23 parser.add_argument('dexfile')
24
25 args = parser.parse_args()
26
27 print MethodCount(args.dexfile)
mikecase (-- gone --) 2015/06/19 15:45:26 Can you use python logging here? Is something goin
jbudorick 2015/06/19 16:25:56 this actually needs to use build/util/lib/common/p
28 return 0
29
30 if __name__ == '__main__':
31 sys.exit(main())
32
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/sdk/__init__.py » ('j') | build/android/pylib/sdk/dexdump.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698