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.
37 lines
659 B
37 lines
659 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',
|
|
'--no-progress-bar',
|
|
'-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',
|
|
]
|
|
)
|