forked from facebook/infer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DEFS
50 lines (43 loc) · 887 Bytes
/
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
import os
original_java_library = java_library
def java_library(
name,
srcs=[],
**kwargs
):
original_java_library(
name=name,
srcs=srcs,
**kwargs
)
create_infer_genrule(name, srcs)
original_android_library = android_library
def android_library(
name,
srcs=[],
**kwargs
):
original_android_library(
name=name,
srcs=srcs,
**kwargs
)
create_infer_genrule(name, srcs)
def create_infer_genrule(
name,
srcs
):
genrule_name = name + '_infer'
genrule(
name = genrule_name,
srcs=srcs,
cmd = ' '.join([
os.getenv('INFER_BIN', 'infer'),
'--eradicate-only',
'--results-dir', '$OUT',
'--classpath', '$(classpath :{})'.format(name),
'--sourcepath', '$SRCDIR',
'--generated-classes', '$(location :{})'.format(name),
]),
out = 'infer_out',
)