|
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the MIT license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
|
|
|
|
TESTS_DIR = ../..
|
|
|
|
ROOT_DIR = $(TESTS_DIR)/../..
|
|
|
|
|
|
|
|
BUCK_TARGET = //src:hello @buck_target.txt
|
|
|
|
SOURCES = $(wildcard src/*.c) $(wildcard src/subtarget1/*.c) $(wildcard src/subtarget2/*.c)
|
|
|
|
OBJECTS = buck-out/gen/src/hello\#compile-hello.c.o1f717d69,default/hello.c.o
|
|
|
|
INFER_OPTIONS = --report-custom-error --developer-mode --no-linters
|
|
|
|
INFERPRINT_OPTIONS = --issues-tests
|
|
|
|
CLEAN_EXTRA = buck-out
|
|
|
|
|
|
|
|
include $(TESTS_DIR)/infer.make
|
|
|
|
|
|
|
|
$(OBJECTS): $(JAVA_SOURCE_FILES)
|
|
|
|
$(QUIET)$(call silent_on_success,Compiling Buck flavors tests,\
|
|
|
|
$(BUCK) build --no-cache $(BUCK_TARGET))
|
|
|
|
|
|
|
|
infer-out/report.json: $(CLANG_DEPS) $(SOURCES) $(MAKEFILE_LIST)
|
|
|
|
$(QUIET)$(BUCK) clean
|
|
|
|
$(call silent_on_success,Testing Buck flavors integration,\
|
[buck] one buck mode datatype to rule them all
Summary:
This changes how we select amongst our (currently) 4 Buck integrations
for Java and clang, as well as how the user's choice is reflected by the
Config module.
The old command line interface is still supported but is now deprecated.
The changes in how to select each integration are:
- clang via "flavors", activated with `--flavors`, now with `--buck-clang`
- clang via "compilation DB", activated with `--buck-compilation-database`, unchanged
- Java via "genrule", activated with `--genrule-master-mode`, now with `--buck-java`
- Java "without genrules", used to be activated by *not specifying any other Buck mode*, unchanged
Instead of various `Config` flags corresponding to the previous CLI that
are allowed in any combination of `flavors`,
`buck_compilation_database`, `genrule_master_mode`, `Config` now exposes
a single `buck_mode` datatype. This allows, eg, `flavors` to override
`buck_compilation_database` if needed. It will also make it easier to
get rid of the old "Java without genrules" integration in a later diff
(see inline comments).
Reviewed By: ngorogiannis
Differential Revision: D19175686
fbshipit-source-id: 29b3831be
5 years ago
|
|
|
$(INFER_BIN) $(INFER_OPTIONS) capture --buck-clang --results-dir $(CURDIR)/infer-out -- \
|
|
|
|
$(BUCK) build --no-cache $(BUCK_TARGET) &&\
|
|
|
|
$(INFER_BIN) $(INFER_OPTIONS) --merge analyze)
|