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.

61 lines
1.4 KiB

sources = glob(['**/*.java'])
dependencies = [
'//infer/lib/java/android:android',
'//dependencies/java/jackson:jackson',
'//infer/lib/java:models',
'//infer/annotations:annotations',
]
java_library(
name = 'infer',
srcs = sources,
deps = dependencies,
visibility = [
'PUBLIC'
]
)
def analysis_cmd(analyzer):
out = 'out'
inferconfig_file = '$(location //infer/tests/codetoanalyze/java:inferconfig)'
copy_inferconfig = ' '.join(['cp', inferconfig_file, '$SRCDIR'])
clean_cmd = ' '.join(['rm', '-rf', out])
classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies])
infer_cmd = ' '.join([
'infer',
'--no-progress-bar',
'--absolute-paths',
'--no-filtering',
'-o', out,
'-a', analyzer,
'--',
'javac',
'-cp', classpath,
'$SRCS',
])
copy_cmd = ' '.join(['cp', out + '/report.csv', '$OUT'])
return ' && '.join([clean_cmd, copy_inferconfig, infer_cmd, copy_cmd])
genrule(
name = 'analyze',
out = 'report.csv',
cmd = analysis_cmd('infer'),
deps = dependencies + [':infer'],
srcs = sources,
visibility = [
'PUBLIC',
],
)
genrule(
name = 'tracing',
out = 'comparison_report.csv',
cmd = analysis_cmd('tracing'),
deps = dependencies + [':infer'],
srcs = sources,
visibility = [
'PUBLIC',
],
)