From d62b046f5283ae4f69088107acafe7abd0919d02 Mon Sep 17 00:00:00 2001 From: Tony Hu Date: Fri, 12 Jan 2018 17:15:23 -0800 Subject: [PATCH] [infer][genrule] create_genrules in DEFS now only creates Buck rule for "checkers" analyzer Reviewed By: jeremydubreil Differential Revision: D6714383 fbshipit-source-id: ef1617f --- DEFS | 36 ++++++++++------------ infer/tests/build_systems/genrule/Makefile | 6 ++-- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/DEFS b/DEFS index 0248f1eb4..d54042899 100644 --- a/DEFS +++ b/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', + ) diff --git a/infer/tests/build_systems/genrule/Makefile b/infer/tests/build_systems/genrule/Makefile index 606043666..e3d1bc177 100644 --- a/infer/tests/build_systems/genrule/Makefile +++ b/infer/tests/build_systems/genrule/Makefile @@ -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