[Android] Sever findbugs dependencies on environment variables.

Use pylib constants instead.

Review URL: https://codereview.chromium.org/11967019

git-svn-id: http://src.chromium.org/svn/trunk/src/build@177208 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
yfriedman@chromium.org 2013-01-16 20:31:10 +00:00
Родитель fc7399b062
Коммит d84743abde
3 изменённых файлов: 11 добавлений и 19 удалений

Просмотреть файл

@ -28,21 +28,17 @@ import optparse
import os
import sys
from pylib import findbugs
from pylib import constants
from pylib.utils import findbugs
def main(argv):
if not findbugs.CheckEnvironment():
return 1
parser = findbugs.GetCommonParser()
options, _ = parser.parse_args()
chrome_src = os.getenv('CHROME_SRC')
if not options.base_dir:
options.base_dir = os.path.join(chrome_src, 'build', 'android',
options.base_dir = os.path.join(constants.CHROME_DIR, 'build', 'android',
'findbugs_filter')
if not options.only_analyze:
options.only_analyze = 'org.chromium.-'

Просмотреть файл

@ -48,5 +48,6 @@ DEVICE_PERF_OUTPUT_DIR = '/data/data/' + CHROME_PACKAGE + '/files'
SCREENSHOTS_DIR = os.path.join(CHROME_DIR, 'out_screenshots')
ANDROID_SDK_VERSION = 17
ANDROID_SDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/sdk')
ANDROID_NDK_ROOT = os.path.join(CHROME_DIR, 'third_party/android_tools/ndk')

Просмотреть файл

@ -11,6 +11,8 @@ import shlex
import subprocess
import sys
from pylib import constants
def _PrintMessage(warnings, title, action, known_bugs_file):
if warnings:
@ -66,11 +68,10 @@ def _Rebaseline(current_warnings_set, known_bugs_file):
def _GetChromeClasses(release_version):
chrome_src = os.getenv('CHROME_SRC')
version = 'Debug'
if release_version:
version = 'Release'
path = os.path.join(chrome_src, 'out', version)
path = os.path.join(constants.CHROME_DIR, 'out', version)
cmd = 'find %s -name "*.class"' % path
proc = subprocess.Popen(shlex.split(cmd),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -99,9 +100,9 @@ def _Run(exclude, known_bugs, classes_to_analyze, auxiliary_classes,
findbug_args: addtional command line options needs pass to Findbugs.
"""
chrome_src = os.getenv('CHROME_SRC')
sdk_root = os.getenv('ANDROID_SDK_ROOT')
sdk_version = os.getenv('ANDROID_SDK_VERSION')
chrome_src = constants.CHROME_DIR
sdk_root = constants.ANDROID_SDK_ROOT
sdk_version = constants.ANDROID_SDK_VERSION
system_classes = []
system_classes.append(os.path.join(sdk_root, 'platforms',
@ -222,13 +223,6 @@ def GetCommonParser():
return parser
def CheckEnvironment():
if not (os.getenv('CHROME_SRC') and os.getenv('ANDROID_SDK_ROOT') and
os.getenv('ANDROID_SDK_VERSION')):
print 'Your build environment is not set up correctly.'
print 'Please source build/android/envsetup.sh.'
return False
return True
def main(argv):
parser = GetCommonParser()
@ -236,5 +230,6 @@ def main(argv):
return Run(options)
if __name__ == '__main__':
sys.exit(main(sys.argv))