From 182d6153d44e6be1787d581bd44c2e86278199e4 Mon Sep 17 00:00:00 2001 From: LSmyrnaios Date: Wed, 30 Nov 2022 16:25:57 +0200 Subject: [PATCH] - Set some optimization settings for gradle. - Fix error-handling in "installAndRun.sh". - Update dependencies. --- build.gradle | 4 ++-- gradle.properties | 4 ++++ gradle/wrapper/gradle-wrapper.properties | 3 ++- installAndRun.sh | 19 ++++++++++++++----- 4 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 gradle.properties diff --git a/build.gradle b/build.gradle index 428fc65..e865a59 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'org.springframework.boot' version '2.7.5' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'org.springframework.boot' version '2.7.6' + id 'io.spring.dependency-management' version '1.1.0' id 'java' } diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..9cc4b13 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.caching=true +org.gradle.parallel=true +org.gradle.caching.debug=false +org.gradle.warning.mode=all diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..f398c33 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/installAndRun.sh b/installAndRun.sh index 4de9fab..b5768a9 100755 --- a/installAndRun.sh +++ b/installAndRun.sh @@ -1,11 +1,20 @@ -cd "${0%/*}" || (echo "Could not chdir to this script's dir!" && exit) # Change the working directory to the script's directory, when running from other location. +# This script installs and runs the project. + +# For error-handling, we cannot use the "set -e" since: it has problems https://mywiki.wooledge.org/BashFAQ/105 +# So we have our own function, for use when a single command fails. +handle_error () { + echo -e "$1"; exit $2 +} + +# Change the working directory to the script's directory, when running from another location. +cd "${0%/*}" || handle_error "Could not change-dir to this script's dir!" 1 justInstall=0 if [[ $# -eq 1 ]]; then justInstall=$1 elif [[ $# -gt 1 ]]; then - echo -e "Wrong number of arguments given: ${#}\nPlease execute it like: script.sh "; exit 1 + echo -e "Wrong number of arguments given: ${#}\nPlease execute it like: script.sh "; exit 2 fi # Check of the "inputData.txt" file exist, if not, ask to fill it. @@ -34,15 +43,15 @@ if [[ ! -f $inputDataFile ]]; then echo -e "\n\n" fi -gradleVersion="7.5.1" +gradleVersion="7.6" if [[ justInstall -eq 0 ]]; then if [ ! -d libs ]; then - mkdir libs || (echo -e "The directory \"libs\" could not be created! Exiting.." && exit 2) + mkdir libs || handle_error "The directory \"libs\" could not be created! Exiting.." 3 fi - cd libs || exit 3 + cd libs || exit 4 git clone https://github.com/LSmyrnaios/PublicationsRetriever.git # We assume there is no previously source-code here, if so, it will be overwritten. # Keep a backup of the existing JAR file.