Make facebook-clang-plugins a submodule @update-submodule: facebook-clang-plugins

master
Irene Papakonstantinou 10 years ago
parent a5fa6a52ee
commit 204b2ccc53

@ -7,7 +7,7 @@ git clone https://github.com/facebook/infer.git
```
To analyse C and Objective-C, Infer requires clang and the
[facebook-clang-plugin](https://github.com/facebook/facebook-clang-plugins). If
[facebook-clang-plugins](https://github.com/facebook/facebook-clang-plugins). If
you wish to analyse only Java/Android code, then you could skip these
dependencies. Details below.
@ -53,7 +53,9 @@ To compile support for both Java and C/Objective-C, do this instead.
```bash
cd infer
./update-fcp.sh && ../facebook-clang-plugin/clang/setup.sh && ./compile-fcp.sh # go have a coffee :)
git submodule update --init --recursive
facebook-clang-plugins/clang/setup.sh # go have a coffee :)
./compile-fcp.sh
make -C infer
export PATH=`pwd`/infer/bin:$PATH
```
@ -112,8 +114,8 @@ Then continue with:
```bash
cd infer
./update-fcp.sh
../facebook-clang-plugin/clang/setup.sh # go have a coffee :)
git submodule update --init --recursive
facebook-clang-plugins/clang/setup.sh # go have a coffee :)
./compile-fcp.sh
make -C infer
export PATH=`pwd`/infer/bin:$PATH

@ -16,7 +16,7 @@ set -x
# THE INSTALLATION OF THE PLUGINS.
INFER_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PLUGIN_DIR="$INFER_ROOT/../facebook-clang-plugin"
PLUGIN_DIR="$INFER_ROOT/facebook-clang-plugins"
CLANG_EXEC="$PLUGIN_DIR/clang/bin/clang"
# check if clang is available

@ -1 +0,0 @@
7d01248a6499fbadc1aaa2c98094533527307771

@ -21,7 +21,7 @@ infer -- xcodebuild -workspace HelloWorld.xcworkspace -scheme HelloWorld'''
SCRIPT_DIR = os.path.dirname(__file__)
INFER_ROOT = os.path.join(SCRIPT_DIR, '..', '..', '..')
FCP_ROOT = os.path.join(INFER_ROOT, '..', 'facebook-clang-plugin')
FCP_ROOT = os.path.join(INFER_ROOT, 'facebook-clang-plugins')
CLANG_WRAPPER = os.path.join(
SCRIPT_DIR, 'clang',
)

@ -15,8 +15,8 @@ CMD_FILE_EXT=".sh"
# extenion of the file containing the output of the Infer Clang frontend
INFERCLANG_LOG_FILE_EXT=".astlog"
# path of the plugin to load in clang
CLANG_PLUGIN_REL_PATH="facebook-clang-plugin/libtooling/build/FacebookClangPlugin.dylib"
PLUGIN_PATH="${SCRIPT_DIR}/../../../../${CLANG_PLUGIN_REL_PATH}"
CLANG_PLUGIN_REL_PATH="facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
PLUGIN_PATH="${SCRIPT_DIR}/../../../${CLANG_PLUGIN_REL_PATH}"
# name of the plugin to use
PLUGIN_NAME="YojsonASTExporter"
# output directory of the plugin

@ -6,7 +6,7 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CLANG_COMPILER="${SCRIPT_DIR}/../../../../facebook-clang-plugin/clang/bin/clang"
CLANG_COMPILER="${SCRIPT_DIR}/../../../facebook-clang-plugins/clang/bin/clang"
if [ "${0%++}" != "$0" ]; then XX="++"; else XX=""; fi

@ -91,7 +91,7 @@ CLANG_SOURCES = clang
INFERCLANG_MAIN = $(CLANG_SOURCES)/cMain
INFERCLANG_BINARY = $(BINDIR)/InferClang
CLANG_PLUGIN_ROOT ?= $(ROOT)/../facebook-clang-plugin
CLANG_PLUGIN_ROOT ?= $(ROOT)/facebook-clang-plugins
CLANG_PLUGIN_BINARIES = $(addprefix $(CLANG_PLUGIN_ROOT)/clang-ocaml/build/, clang_ast_converter clang_ast_named_decl_printer)
CLANG_OCAML_ROOT = $(CLANG_PLUGIN_ROOT)/clang-ocaml
@ -125,9 +125,9 @@ CHECKCOPYRIGHT_MAIN = $(SCRIPT_SOURCES)/checkCopyright
# Based on that determine which code should be loaded
ifeq ($(wildcard $(ROOT)/.facebook),)
EXTRA_DEPS = opensource
else
else
EXTRA_DEPS = facebook
endif
endif
DEPENDENCIES = $(BACKEND_SOURCES) checkers facebook/checkers facebook/checkers/graphql facebook/scripts harness $(EXTRA_DEPS)
@ -148,7 +148,7 @@ checkCopyright: build_checkCopyright annotations $(CHECKCOPYRIGHT_BINARY)
build_java: init $(INFERPRINT_ATDGEN_STUBS)
$(OCAMLBUILD) $(TYPEPROP_MAIN).native $(INFERANALYZE_MAIN).native $(INFERPRINT_MAIN).native $(INFERJAVA_MAIN).native
build_clang: init $(INFERPRINT_ATDGEN_STUBS) check_clang_plugin $(CLANG_ATDGEN_STUBS)
build_clang: init $(INFERPRINT_ATDGEN_STUBS) $(CLANG_ATDGEN_STUBS)
$(OCAMLBUILD) $(INFERANALYZE_MAIN).native $(INFERPRINT_MAIN).native $(INFERCLANG_MAIN).native
build_llvm:
@ -160,9 +160,6 @@ build_checkCopyright:
annotations:
rsync -r --delete --exclude=*.ml* --exclude=*.o --exclude=*.cm* --exclude=*.native $(BUILDDIR)/* $(ANNOTDIR)
check_clang_plugin:
$(SCRIPTDIR)/check_clang_plugin_version.sh $(CLANG_PLUGIN_ROOT)
$(INFERPRINT_ATDGEN_STUBS): $(INFERPRINT_ATDGEN_STUB_ATD)
atdgen -t $(INFERPRINT_ATDGEN_STUB_ATD) -o $(INFERPRINT_ATDGEN_STUB_BASE)
atdgen -j $(INFERPRINT_ATDGEN_STUB_ATD) -o $(INFERPRINT_ATDGEN_STUB_BASE)

@ -12,7 +12,7 @@ set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
INFER_DIR=$SCRIPT_DIR/../infer
CLANG_PLUGIN_DIR=$SCRIPT_DIR/../../facebook-clang-plugin
CLANG_PLUGIN_DIR=$SCRIPT_DIR/../facebook-clang-plugins
platform=`uname`
# Build Infer
@ -30,20 +30,20 @@ BINARY_TARBALL=$BINARY_DIR.tar.xz
PKG_DIR=$SCRIPT_DIR/../$BINARY_DIR
# Start with infer
mkdir -p $PKG_DIR/infer/infer/{annotations,bin,lib}
mkdir -p $PKG_DIR/infer/examples
mkdir -p $PKG_DIR/infer/scripts
cp -r $INFER_DIR/annotations/* $PKG_DIR/infer/infer/annotations
cp -r $INFER_DIR/bin/* $PKG_DIR/infer/infer/bin
cp -r $INFER_DIR/lib/* $PKG_DIR/infer/infer/lib
cp -r $INFER_DIR/../examples/* $PKG_DIR/infer/examples
cp $INFER_DIR/../{CONTRIBUTING.md,LICENSE,PATENTS,README.md,INSTALL.md} $PKG_DIR/infer/
cp -r $INFER_DIR/../scripts/* $PKG_DIR/infer/scripts
mkdir -p $PKG_DIR/infer/{annotations,bin,lib}
mkdir -p $PKG_DIR/examples
mkdir -p $PKG_DIR/scripts
cp -r $INFER_DIR/annotations/* $PKG_DIR/infer/annotations
cp -r $INFER_DIR/bin/* $PKG_DIR/infer/bin
cp -r $INFER_DIR/lib/* $PKG_DIR/infer/lib
cp -r $INFER_DIR/../examples/* $PKG_DIR/examples
cp $INFER_DIR/../{CONTRIBUTING.md,LICENSE,PATENTS,README.md,INSTALL.md} $PKG_DIR/
cp -r $INFER_DIR/../scripts/* $PKG_DIR/scripts
# don't include pyc files into the release
find $PKG_DIR -name "*.pyc" | xargs rm
# Add facebook-clang-plugin
PKG_PLUGIN_DIR=$PKG_DIR/facebook-clang-plugin
PKG_PLUGIN_DIR=$PKG_DIR/facebook-clang-plugins
mkdir -p $PKG_PLUGIN_DIR/clang/{bin,lib,include}
mkdir -p $PKG_PLUGIN_DIR/libtooling/build
cp $CLANG_PLUGIN_DIR/{CONTRIBUTING.md,LICENSE,LLVM-LICENSE,PATENTS,README.md} $PKG_PLUGIN_DIR

@ -1,33 +0,0 @@
#!/bin/bash
# Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
set -x
set -e
# This script fetches the revision of the 'facebook-clang-plugins'
# required by Infer.
INFER_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
PLUGIN_REPO=https://github.com/facebook/facebook-clang-plugins
PLUGIN_DIR="$INFER_ROOT/../facebook-clang-plugin"
VERSION_FILE="$INFER_ROOT/dependencies/clang-plugin/clang-plugin-version.config"
# check if the repo is already in place
if [ ! -e "$PLUGIN_DIR" ]; then
echo "$PLUGIN_DIR not found, cloning..."
git $GIT_OPTIONS clone $PLUGIN_REPO "$PLUGIN_DIR"
fi
# update revision if needed
echo "Checking out the right version of the clang plugin..."
pushd $PLUGIN_DIR
git checkout master
git $GIT_OPTIONS pull
git checkout $(cat "$VERSION_FILE")
popd
Loading…
Cancel
Save