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.
49 lines
1.1 KiB
49 lines
1.1 KiB
sources = glob(['**/*.java'])
|
|
|
|
dependencies = [
|
|
'//infer/annotations:annotations',
|
|
'//infer/lib/java/android:android',
|
|
'//dependencies/java/jsr-305:jsr-305',
|
|
'//dependencies/java/jsr-330:jsr-330',
|
|
'//dependencies/java/android/support/v4:android-support-v4',
|
|
'//dependencies/java/butterknife:butterknife',
|
|
]
|
|
|
|
java_library(
|
|
name = 'eradicate',
|
|
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', 'ERADICATE_RETURN_OVER_ANNOTATED=1'])
|
|
infer_cmd = ' '.join([
|
|
'infer',
|
|
'--no-progress-bar',
|
|
'--absolute-paths',
|
|
'-o', out,
|
|
'-a', 'eradicate',
|
|
'--',
|
|
'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 + [':eradicate'],
|
|
visibility = [
|
|
'PUBLIC',
|
|
]
|
|
)
|