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.
53 lines
985 B
53 lines
985 B
8 years ago
|
import os
|
||
|
|
||
|
original_java_library = java_library
|
||
|
def java_library(
|
||
|
name,
|
||
8 years ago
|
srcs=[],
|
||
8 years ago
|
**kwargs
|
||
|
):
|
||
|
|
||
|
original_java_library(
|
||
|
name=name,
|
||
8 years ago
|
srcs=srcs,
|
||
|
**kwargs
|
||
8 years ago
|
)
|
||
8 years ago
|
|
||
7 years ago
|
create_infer_genrule(name, srcs)
|
||
8 years ago
|
|
||
|
original_android_library = android_library
|
||
|
def android_library(
|
||
|
name,
|
||
|
srcs=[],
|
||
|
**kwargs
|
||
|
):
|
||
|
|
||
|
original_android_library(
|
||
|
name=name,
|
||
|
srcs=srcs,
|
||
8 years ago
|
**kwargs
|
||
|
)
|
||
8 years ago
|
|
||
7 years ago
|
create_infer_genrule(name, srcs)
|
||
8 years ago
|
|
||
7 years ago
|
def create_infer_genrule(
|
||
8 years ago
|
name,
|
||
|
srcs
|
||
|
):
|
||
7 years ago
|
genrule_name = name + '_infer'
|
||
|
genrule(
|
||
|
name = genrule_name,
|
||
|
srcs=srcs,
|
||
|
cmd = ' '.join([
|
||
|
os.getenv('INFER_BIN', 'infer'),
|
||
7 years ago
|
'--genrule-mode',
|
||
7 years ago
|
'--project-root', os.getenv('PROJECT_ROOT', os.environ['PWD']),
|
||
7 years ago
|
'--eradicate-only',
|
||
7 years ago
|
'--results-dir', '$OUT',
|
||
|
'--classpath', '$(classpath :{})'.format(name),
|
||
|
'--sourcepath', '$SRCDIR',
|
||
|
'--generated-classes', '$(location :{})'.format(name),
|
||
|
]),
|
||
|
out = 'infer_out',
|
||
|
)
|