forked from facebook/infer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DEFS
54 lines (46 loc) · 1.04 KB
/
DEFS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import os
analyzers = ['infer', 'eradicate']
original_java_library = java_library
def java_library(
name,
srcs=[],
**kwargs
):
original_java_library(
name=name,
srcs=srcs,
**kwargs
)
create_genrules(name, srcs)
original_android_library = android_library
def android_library(
name,
srcs=[],
**kwargs
):
original_android_library(
name=name,
srcs=srcs,
**kwargs
)
create_genrules(name, srcs)
def create_genrules(
name,
srcs
):
if 'GENERATE_INFER_GENRULES' in os.environ and srcs:
for analyzer in analyzers:
analyzer_name = name + '_{}'.format(analyzer)
genrule(
name = analyzer_name,
srcs=srcs,
cmd = ' '.join([
os.getenv('INFER_BIN', 'infer'),
'-a', analyzer,
'--results-dir', '$OUT',
'--classpath', '$(classpath :{})'.format(name),
'--sourcepath', '$SRCDIR',
'--generated-classes', '$(location :{})'.format(name),
]),
out = '{}_out'.format(analyzer),
)