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.

36 lines
634 B

sources = glob([ '**/*.java'])
java_library(
name = 'file_unchanged',
srcs = sources,
visibility = [
'PUBLIC'
]
)
out = 'out'
clean_cmd = ' '.join(['rm', '-rf', out])
infer_cmd = ' '.join([
'infer',
'-i',
'--absolute-paths',
'-o', out,
'-a', 'infer',
'--',
'javac',
'$SRCS',
])
stats_copy_cmd = ' '.join(['cp', out + '/stats.json', '$OUT'])
command = ' && '.join([clean_cmd, infer_cmd, infer_cmd, stats_copy_cmd])
genrule(
name = 'analyze',
srcs = sources,
out = 'stats.json',
cmd = command,
deps = [':file_unchanged'],
visibility = [
'PUBLIC',
]
)