OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 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 """Runs Android's lint tool.""" | 7 """Runs Android's lint tool.""" |
8 | 8 |
9 | 9 |
10 import argparse | 10 import argparse |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 # sibling res/ and src/ directories (which should be pass explicitly if they | 163 # sibling res/ and src/ directories (which should be pass explicitly if they |
164 # are to be included). | 164 # are to be included). |
165 if manifest_path: | 165 if manifest_path: |
166 os.symlink(os.path.abspath(manifest_path), | 166 os.symlink(os.path.abspath(manifest_path), |
167 os.path.join(project_dir, 'AndroidManifest.xml')) | 167 os.path.join(project_dir, 'AndroidManifest.xml')) |
168 cmd.append(project_dir) | 168 cmd.append(project_dir) |
169 | 169 |
170 if os.path.exists(result_path): | 170 if os.path.exists(result_path): |
171 os.remove(result_path) | 171 os.remove(result_path) |
172 | 172 |
173 env = {} | 173 env = os.environ.copy() |
174 stderr_filter = None | 174 stderr_filter = None |
175 if cache_dir: | 175 if cache_dir: |
176 env['_JAVA_OPTIONS'] = '-Duser.home=%s' % _RebasePath(cache_dir) | 176 env['_JAVA_OPTIONS'] = '-Duser.home=%s' % _RebasePath(cache_dir) |
177 # When _JAVA_OPTIONS is set, java prints to stderr: | 177 # When _JAVA_OPTIONS is set, java prints to stderr: |
178 # Picked up _JAVA_OPTIONS: ... | 178 # Picked up _JAVA_OPTIONS: ... |
179 # | 179 # |
180 # We drop all lines that contain _JAVA_OPTIONS from the output | 180 # We drop all lines that contain _JAVA_OPTIONS from the output |
181 stderr_filter = lambda l: re.sub(r'.*_JAVA_OPTIONS.*\n?', '', l) | 181 stderr_filter = lambda l: re.sub(r'.*_JAVA_OPTIONS.*\n?', '', l) |
182 | 182 |
183 try: | 183 try: |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 silent=args.silent), | 357 silent=args.silent), |
358 args, | 358 args, |
359 input_paths=input_paths, | 359 input_paths=input_paths, |
360 input_strings=input_strings, | 360 input_strings=input_strings, |
361 output_paths=output_paths, | 361 output_paths=output_paths, |
362 depfile_deps=classpath) | 362 depfile_deps=classpath) |
363 | 363 |
364 | 364 |
365 if __name__ == '__main__': | 365 if __name__ == '__main__': |
366 sys.exit(main()) | 366 sys.exit(main()) |
OLD | NEW |