[infer][genrule] create_genrules in DEFS now only creates Buck rule for "checkers" analyzer

Reviewed By: jeremydubreil

Differential Revision: D6714383

fbshipit-source-id: ef1617f
master
Tony Hu 7 years ago committed by Facebook Github Bot
parent eb91d59e40
commit d62b046f52

36
DEFS

@ -1,7 +1,5 @@
import os
analyzers = ['checkers']
original_java_library = java_library
def java_library(
name,
@ -15,7 +13,7 @@ def java_library(
**kwargs
)
create_genrules(name, srcs)
create_infer_genrule(name, srcs)
original_android_library = android_library
def android_library(
@ -30,24 +28,22 @@ def android_library(
**kwargs
)
create_genrules(name, srcs)
create_infer_genrule(name, srcs)
def create_genrules(
def create_infer_genrule(
name,
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),
)
genrule_name = name + '_infer'
genrule(
name = genrule_name,
srcs=srcs,
cmd = ' '.join([
os.getenv('INFER_BIN', 'infer'),
'--results-dir', '$OUT',
'--classpath', '$(classpath :{})'.format(name),
'--sourcepath', '$SRCDIR',
'--generated-classes', '$(location :{})'.format(name),
]),
out = 'infer_out',
)

@ -8,12 +8,12 @@
TESTS_DIR = ../..
ROOT_DIR = $(TESTS_DIR)/../..
ANALYZER = checkers
ANALYZER = infer
BUCK_TARGET = //infer/tests/build_systems/genrule/module2:module2
INFER_TARGET = $(BUCK_TARGET)_checkers
INFER_TARGET = $(BUCK_TARGET)_infer
SOURCES = $(wildcard $(TESTS_DIR)/codetoanalyze/java/infer/*.java)
OBJECTS = $(ROOT_DIR)/buck-out/genruletest/gen/infer/tests/build_systems/genrule/module2/lib__module2_compile__output/module2_compile.jar
JSON_REPORT = $(ROOT_DIR)/buck-out/gen/infer/tests/build_systems/genrule/module2/module2_checkers/checkers_out/report.json
JSON_REPORT = $(ROOT_DIR)/buck-out/gen/infer/tests/build_systems/genrule/module2/module2_infer/infer_out/report.json
INFER_OPTIONS = --project-root $(ROOT_DIR)
INFERPRINT_OPTIONS = --project-root $(ROOT_DIR) --issues-tests
CLEAN_EXTRA = $(ROOT_DIR)/buck-out/genruletest

Loading…
Cancel
Save