You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
sources = glob(['**/*.java'])
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
'//infer/annotations:annotations',
|
|
|
|
'//infer/lib/java/android:android',
|
|
|
|
]
|
|
|
|
|
|
|
|
java_library(
|
|
|
|
name = 'checkers',
|
|
|
|
srcs = sources,
|
|
|
|
deps = dependencies,
|
|
|
|
visibility = [
|
|
|
|
'PUBLIC'
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
out = 'out'
|
|
|
|
clean_cmd = ' '.join(['rm', '-rf', out])
|
|
|
|
classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies])
|
|
|
|
env_cmd = ' '.join(['export', 'INFER_REPORT_EXPENSIVE_CALLS=1'])
|
|
|
|
infer_cmd = ' '.join([
|
|
|
|
'infer',
|
|
|
|
'--absolute-paths',
|
|
|
|
'-o', out,
|
|
|
|
'-a', 'checkers',
|
|
|
|
'--',
|
|
|
|
'javac',
|
|
|
|
'-cp', classpath,
|
|
|
|
'$SRCS',
|
|
|
|
])
|
|
|
|
copy_cmd = ' '.join(['cp', out + '/report.csv', '$OUT'])
|
|
|
|
command = ' && '.join([clean_cmd, env_cmd, infer_cmd, copy_cmd])
|
|
|
|
|
|
|
|
genrule(
|
|
|
|
name = 'analyze',
|
|
|
|
srcs = sources,
|
|
|
|
out = 'report.csv',
|
|
|
|
cmd = command,
|
|
|
|
deps = dependencies + [':checkers'],
|
|
|
|
visibility = [
|
|
|
|
'PUBLIC',
|
|
|
|
]
|
|
|
|
)
|