From 9174db02d8e84b56ec805e62ecbe3855b1f46e28 Mon Sep 17 00:00:00 2001 From: Gautam Korlam Date: Tue, 10 Jan 2017 08:34:39 -0800 Subject: [PATCH] Add an option to skip updating submodules if only building for java Summary: When invoking `./build-infer.sh java`, there is no need to update the facebook-clang-plugins submodule that is done as part of the `autogen.sh` script. The submodule update takes a very long time and can be skipped when building only for java Closes https://github.com/facebook/infer/pull/557 Reviewed By: dkgi Differential Revision: D4387800 Pulled By: sblackshear fbshipit-source-id: 1662f7b --- autogen.sh | 2 +- build-infer.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/autogen.sh b/autogen.sh index 80d7a305f..fa8cce072 100755 --- a/autogen.sh +++ b/autogen.sh @@ -12,7 +12,7 @@ set -e # try to pull submodules if we are in a git repo # might fail if git is not installed (how did you even checkout the # repo in the first place?) -if test -d '.git'; then +if test -d '.git' && [ -z "$SKIP_SUBMODULES" ] ; then printf 'git repository detected, updating submodule... ' git submodule update --init > /dev/null printf 'done\n' diff --git a/build-infer.sh b/build-infer.sh index 0c86bc2d3..def0d763f 100755 --- a/build-infer.sh +++ b/build-infer.sh @@ -135,7 +135,11 @@ install_opam_deps echo "preparing build... " if [ ! -f .release ]; then - ./autogen.sh > /dev/null + if [ "$BUILD_CLANG" = "no" ]; then + SKIP_SUBMODULES=true ./autogen.sh > /dev/null + else + ./autogen.sh > /dev/null + fi fi if [ "$BUILD_CLANG" = "no" ]; then