From 8521510be81e2d3137aeedc298ad6eed60101076 Mon Sep 17 00:00:00 2001 From: Axel Date: Thu, 17 Dec 2020 10:53:03 +0100 Subject: [PATCH] Fixed unexpected arguments causing an error in .sh build files. --- Util/BuildTools/BuildCarlaUE4.sh | 24 ++++++++++++------------ Util/BuildTools/BuildLibCarla.sh | 14 +++++++------- Util/BuildTools/BuildOSM2ODR.sh | 15 +++++++-------- Util/BuildTools/BuildPythonAPI.sh | 10 +++++----- Util/BuildTools/Check.sh | 4 ++-- Util/BuildTools/Deploy.sh | 4 +++- Util/BuildTools/Package.sh | 3 +-- 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Util/BuildTools/BuildCarlaUE4.sh b/Util/BuildTools/BuildCarlaUE4.sh index 5b747044a..83de651ae 100755 --- a/Util/BuildTools/BuildCarlaUE4.sh +++ b/Util/BuildTools/BuildCarlaUE4.sh @@ -1,17 +1,5 @@ #! /bin/bash -# ============================================================================== -# -- Set up environment -------------------------------------------------------- -# ============================================================================== - -source $(dirname "$0")/Environment.sh - -if [ ! -d "${UE4_ROOT}" ]; then - fatal_error "UE4_ROOT is not defined, or points to a non-existant directory, please set this environment variable." -else - log "Using Unreal Engine at '$UE4_ROOT'" -fi - # ============================================================================== # -- Parse arguments ----------------------------------------------------------- # ============================================================================== @@ -71,6 +59,18 @@ while [[ $# -gt 0 ]]; do esac done +# ============================================================================== +# -- Set up environment -------------------------------------------------------- +# ============================================================================== + +source $(dirname "$0")/Environment.sh + +if [ ! -d "${UE4_ROOT}" ]; then + fatal_error "UE4_ROOT is not defined, or points to a non-existant directory, please set this environment variable." +else + log "Using Unreal Engine at '$UE4_ROOT'" +fi + if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_CARLAUE4} || ${LAUNCH_UE4_EDITOR}; }; then fatal_error "Nothing selected to be done." fi diff --git a/Util/BuildTools/BuildLibCarla.sh b/Util/BuildTools/BuildLibCarla.sh index 69dd7fc86..b599e8952 100755 --- a/Util/BuildTools/BuildLibCarla.sh +++ b/Util/BuildTools/BuildLibCarla.sh @@ -1,12 +1,5 @@ #! /bin/bash -source $(dirname "$0")/Environment.sh - -function get_source_code_checksum { - local EXCLUDE='*__pycache__*' - find "${LIBCARLA_ROOT_FOLDER}"/* \! -path "${EXCLUDE}" -print0 | sha1sum | awk '{print $1}' -} - # ============================================================================== # -- Parse arguments ----------------------------------------------------------- # ============================================================================== @@ -83,6 +76,13 @@ while [[ $# -gt 0 ]]; do esac done +source $(dirname "$0")/Environment.sh + +function get_source_code_checksum { + local EXCLUDE='*__pycache__*' + find "${LIBCARLA_ROOT_FOLDER}"/* \! -path "${EXCLUDE}" -print0 | sha1sum | awk '{print $1}' +} + if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_SERVER} || ${BUILD_CLIENT}; }; then fatal_error "Nothing selected to be done." fi diff --git a/Util/BuildTools/BuildOSM2ODR.sh b/Util/BuildTools/BuildOSM2ODR.sh index 6fcc99e4c..14b4154ec 100755 --- a/Util/BuildTools/BuildOSM2ODR.sh +++ b/Util/BuildTools/BuildOSM2ODR.sh @@ -1,12 +1,4 @@ #! /bin/bash - -source $(dirname "$0")/Environment.sh - -function get_source_code_checksum { - local EXCLUDE='*__pycache__*' - find "${OSM2ODR_ROOT_FOLDER}"/* \! -path "${EXCLUDE}" -print0 | sha1sum | awk '{print $1}' -} - DOC_STRING="Build OSM2ODR." USAGE_STRING=$(cat <<- END @@ -48,6 +40,13 @@ while [[ $# -gt 0 ]]; do esac done +source $(dirname "$0")/Environment.sh + +function get_source_code_checksum { + local EXCLUDE='*__pycache__*' + find "${OSM2ODR_ROOT_FOLDER}"/* \! -path "${EXCLUDE}" -print0 | sha1sum | awk '{print $1}' +} + if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_OSM2ODR}; }; then fatal_error "Nothing selected to be done." fi diff --git a/Util/BuildTools/BuildPythonAPI.sh b/Util/BuildTools/BuildPythonAPI.sh index a93feaf31..9164b7a76 100755 --- a/Util/BuildTools/BuildPythonAPI.sh +++ b/Util/BuildTools/BuildPythonAPI.sh @@ -1,10 +1,5 @@ #! /bin/bash -source $(dirname "$0")/Environment.sh - -export CC=clang-8 -export CXX=clang++-8 - # ============================================================================== # -- Parse arguments ----------------------------------------------------------- # ============================================================================== @@ -49,6 +44,11 @@ while [[ $# -gt 0 ]]; do esac done +source $(dirname "$0")/Environment.sh + +export CC=clang-8 +export CXX=clang++-8 + if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_PYTHONAPI} ; }; then fatal_error "Nothing selected to be done." fi diff --git a/Util/BuildTools/Check.sh b/Util/BuildTools/Check.sh index 8261528e3..cd040125a 100755 --- a/Util/BuildTools/Check.sh +++ b/Util/BuildTools/Check.sh @@ -1,7 +1,5 @@ #! /bin/bash -source $(dirname "$0")/Environment.sh - # ============================================================================== # -- Parse arguments ----------------------------------------------------------- # ============================================================================== @@ -92,6 +90,8 @@ while [[ $# -gt 0 ]]; do esac done +source $(dirname "$0")/Environment.sh + if ! { ${LIBCARLA_RELEASE} || ${LIBCARLA_DEBUG} || ${PYTHON_API} || ${SMOKE_TESTS}; }; then fatal_error "Nothing selected to be done." fi diff --git a/Util/BuildTools/Deploy.sh b/Util/BuildTools/Deploy.sh index 0083f8f8c..b8f5d4c41 100755 --- a/Util/BuildTools/Deploy.sh +++ b/Util/BuildTools/Deploy.sh @@ -4,7 +4,7 @@ # -- Set up environment -------------------------------------------------------- # ============================================================================== -source $(dirname "$0")/Environment.sh + REPLACE_LATEST=false DOCKER_PUSH=false @@ -48,6 +48,8 @@ while [[ $# -gt 0 ]]; do esac done +source $(dirname "$0")/Environment.sh + REPOSITORY_TAG=$(get_git_repository_version) LATEST_PACKAGE=CARLA_${REPOSITORY_TAG}.tar.gz diff --git a/Util/BuildTools/Package.sh b/Util/BuildTools/Package.sh index ca6e5f200..b307a3084 100755 --- a/Util/BuildTools/Package.sh +++ b/Util/BuildTools/Package.sh @@ -1,7 +1,5 @@ #! /bin/bash -source $(dirname "$0")/Environment.sh - # ============================================================================== # -- Parse arguments ----------------------------------------------------------- # ============================================================================== @@ -51,6 +49,7 @@ done # ============================================================================== # -- Prepare environment ------------------------------------------------------- # ============================================================================== +source $(dirname "$0")/Environment.sh if [ ! -d "${UE4_ROOT}" ]; then fatal_error "UE4_ROOT is not defined, or points to a non-existent directory, please set this environment variable."