@@ -8,31 +8,27 @@ set -o pipefail
88usage=' ' ' build-coatjava.sh [OPTIONS]... [MAVEN_OPTIONS]...
99
1010 OPTIONS
11-
11+ --clara install clara too
1212 --clean clean up built objects and exit (does not compile)
13+ --quiet run more quietly
14+ --no-progress no download progress printouts
15+ --help show this message
1316
17+ OPTIONS FOR MAGNETIC FIELD MAPS
18+ --lfs use git-lfs for field maps and test data
19+ --cvmfs use cvmfs to download field maps
20+ --xrootd use xrootd to download field maps
1421 --nomaps do not download field maps
1522
23+ OPTIONS FOR TESTING
1624 --spotbugs also run spotbugs plugin
1725 --unittests also run unit tests
18-
1926 --depana run dependency analysis (only)
20-
21- --quiet run more quietly
22- --no-progress no download progress printouts
23-
24- --xrootd use xrootd to download field maps
25- --cvmfs use cvmfs to download field maps
26- --lfs use lfs for field maps and test data
27-
28- --clara install clara too
2927 --data download test data (requires lfs)
3028
31- --help show this message
32-
3329 MAVEN_OPTIONS
34-
35- all other arguments will be passed to `mvn`, e.g., -T4 will build with 4 parallel threads
30+ all other arguments will be passed to `mvn`; for example,
31+ -T4 will build with 4 parallel threads
3632' ' '
3733
3834cleanBuild=" no"
7975
8076if $downloadData && ! $useLfs ; then
8177 echo " $usage "
82- echo " ERROR::::::::::: --data requires --lfs"
78+ echo " ERROR::::::::::: --data requires --lfs" >&2
8379 exit 2
8480fi
8581
@@ -110,10 +106,16 @@ download () {
110106 xrdcp $1 ./
111107 ret=$?
112108 elif $useLfs ; then
113- cd $src_dir
114- git submodule update --init etc/data/magfield
115- if $downloadData ; then git submodule update --init validation/advanced-tests/data; fi
116- cd - > /dev/null
109+ if command_exists git-lfs ; then
110+ cd $src_dir > /dev/null
111+ git lfs install
112+ git submodule update --init etc/data/magfield
113+ if $downloadData ; then git submodule update --init validation/advanced-tests/data; fi
114+ cd - > /dev/null
115+ else
116+ echo ' ERROR: `git-lfs` not found; please install it, or use a different option other than `--lfs`' >&2
117+ ret=1
118+ fi
117119 elif $useCvmfs ; then
118120 cp -v $1 ./
119121 ret=$?
@@ -127,7 +129,7 @@ download () {
127129 fi
128130 else
129131 ret=1
130- echo ERROR::::::::::: Could not find wget nor curl.
132+ echo " ERROR::::::::::: Could not find wget nor curl." >&2
131133 fi
132134 return $ret
133135}
@@ -148,11 +150,12 @@ if [ $cleanBuild == "no" ] && [ $downloadMaps == "yes" ]; then
148150 do
149151 download $webDir /$map
150152 if [ $? -ne 0 ]; then
151- echo ERROR::::::::::: Could not download field map:
152- echo $webDir /$map
153- echo One option is to download manually into etc/data/magfield and then run this build script with --nomaps
153+ echo " ERROR::::::::::: Could not download field map:" >&2
154+ echo " $webDir /$map " >&2
155+ echo " One option is to download manually into etc/data/magfield and then run this build script with --nomaps" >&2
154156 exit 1
155157 fi
158+ $useLfs && break
156159 done
157160 cd -
158161fi
@@ -208,7 +211,7 @@ if [ $runSpotBugs == "yes" ]; then
208211 $mvn com.github.spotbugs:spotbugs-maven-plugin:check # check goal produces a report and produces build failed if bugs
209212 # the spotbugsXml.xml file is easiest read in a web browser
210213 # see http://spotbugs.readthedocs.io/en/latest/maven.html and https://spotbugs.github.io/spotbugs-maven-plugin/index.html for more info
211- if [ $? != 0 ] ; then echo " spotbugs failure" ; exit 1 ; fi
214+ if [ $? != 0 ] ; then echo " spotbugs failure" >&2 ; exit 1 ; fi
212215fi
213216
214217# installation
0 commit comments