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

Side by Side Diff: build/android/gyp/javac.py

Issue 330573003: Use raw strings for javac colorize regexes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | 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
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 import fnmatch 7 import fnmatch
8 import optparse 8 import optparse
9 import os 9 import os
10 import re 10 import re
11 import sys 11 import sys
12 12
13 from util import build_utils 13 from util import build_utils
14 from util import md5_check 14 from util import md5_check
15 15
16 sys.path.append(build_utils.COLORAMA_ROOT) 16 sys.path.append(build_utils.COLORAMA_ROOT)
17 import colorama 17 import colorama
18 18
19 19
20 def ColorJavacOutput(output): 20 def ColorJavacOutput(output):
21 fileline_prefix = '(?P<fileline>(?P<file>[-.\w/\\]+.java):(?P<line>[0-9]+):)' 21 fileline_prefix = r'(?P<fileline>(?P<file>[-.\w/\\]+.java):(?P<line>[0-9]+):)'
22 warning_re = re.compile( 22 warning_re = re.compile(
23 fileline_prefix + '(?P<full_message> warning: (?P<message>.*))$') 23 fileline_prefix + r'(?P<full_message> warning: (?P<message>.*))$')
24 error_re = re.compile( 24 error_re = re.compile(
25 fileline_prefix + '(?P<full_message> (?P<message>.*))$') 25 fileline_prefix + r'(?P<full_message> (?P<message>.*))$')
26 marker_re = re.compile(r'\s*(?P<marker>\^)\s*$') 26 marker_re = re.compile(r'\s*(?P<marker>\^)\s*$')
27 27
28 warning_color = ['full_message', colorama.Fore.YELLOW + colorama.Style.DIM] 28 warning_color = ['full_message', colorama.Fore.YELLOW + colorama.Style.DIM]
29 error_color = ['full_message', colorama.Fore.MAGENTA + colorama.Style.BRIGHT] 29 error_color = ['full_message', colorama.Fore.MAGENTA + colorama.Style.BRIGHT]
30 marker_color = ['marker', colorama.Fore.BLUE + colorama.Style.BRIGHT] 30 marker_color = ['marker', colorama.Fore.BLUE + colorama.Style.BRIGHT]
31 31
32 def Colorize(line, regex, color): 32 def Colorize(line, regex, color):
33 match = regex.match(line) 33 match = regex.match(line)
34 start = match.start(color[0]) 34 start = match.start(color[0])
35 end = match.end(color[0]) 35 end = match.end(color[0])
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 DoJavac(options, args) 136 DoJavac(options, args)
137 137
138 if options.stamp: 138 if options.stamp:
139 build_utils.Touch(options.stamp) 139 build_utils.Touch(options.stamp)
140 140
141 141
142 if __name__ == '__main__': 142 if __name__ == '__main__':
143 sys.exit(main()) 143 sys.exit(main())
144 144
145 145
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