| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import argparse | 5 import argparse |
| 6 import logging | 6 import logging |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import shlex | 9 import shlex |
| 10 import sys | 10 import sys |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 cmd.extend(['-onlyAnalyze', classes_to_analyze]) | 135 cmd.extend(['-onlyAnalyze', classes_to_analyze]) |
| 136 if exclude: | 136 if exclude: |
| 137 cmd.extend(['-exclude', os.path.abspath(exclude)]) | 137 cmd.extend(['-exclude', os.path.abspath(exclude)]) |
| 138 if output_file: | 138 if output_file: |
| 139 cmd.extend(['-output', output_file]) | 139 cmd.extend(['-output', output_file]) |
| 140 if findbug_args: | 140 if findbug_args: |
| 141 cmd.extend(findbug_args) | 141 cmd.extend(findbug_args) |
| 142 cmd.extend(os.path.abspath(j) for j in jars or []) | 142 cmd.extend(os.path.abspath(j) for j in jars or []) |
| 143 | 143 |
| 144 if output_file: | 144 if output_file: |
| 145 cmd_helper.RunCmd(cmd) | 145 _, _, stderr = cmd_helper.GetCmdStatusOutputAndError(cmd) |
| 146 |
| 146 results_doc = xml.dom.minidom.parse(output_file) | 147 results_doc = xml.dom.minidom.parse(output_file) |
| 147 else: | 148 else: |
| 148 raw_out = cmd_helper.GetCmdOutput(cmd) | 149 _, raw_out, stderr = cmd_helper.GetCmdStatusOutputAndError(cmd) |
| 149 results_doc = xml.dom.minidom.parseString(raw_out) | 150 results_doc = xml.dom.minidom.parseString(raw_out) |
| 150 | 151 |
| 152 for line in stderr.splitlines(): |
| 153 logging.debug(' %s', line) |
| 154 |
| 151 current_warnings_set = _ParseXmlResults(results_doc) | 155 current_warnings_set = _ParseXmlResults(results_doc) |
| 152 | 156 |
| 153 return (' '.join(cmd), current_warnings_set) | 157 return (' '.join(cmd), current_warnings_set) |
| 154 | 158 |
| OLD | NEW |