forked from JeffersonLab/clas12-offline-software
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-coatjava.sh
executable file
·97 lines (87 loc) · 3.47 KB
/
build-coatjava.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
usage='build-coatjava.sh [--nospotbugs] [--nomaps] [--nounittests]'
runSpotBugs="yes"
downloadMaps="yes"
runUnitTests="yes"
for xx in $@
do
if [ "$xx" == "--nospotbugs" ]
then
runSpotBugs="no"
elif [ "$xx" == "-n" ]
then
runSpotBugs="no"
elif [ "$xx" == "--nomaps" ]
then
downloadMaps="no"
elif [ "$xx" == "--nounittests" ]
then
runUnitTests="no"
else
echo $usage
exit
fi
done
# download the default field maps, as defined in bin/env.sh:
# (and duplicated in etc/services/reconstruction.yaml):
source `dirname $0`/bin/env.sh
if [ $downloadMaps == "yes" ]; then
webDir=http://clasweb.jlab.org/clas12offline/magfield
locDir=etc/data/magfield
mkdir -p $locDir
cd $locDir
for map in $SOLENOIDMAP $TORUSMAP
do
# -N only redownloads if timestamp/filesize is newer/different
wget -N --no-check-certificate $webDir/$map
done
cd -
fi
rm -rf coatjava
mkdir -p coatjava
cp -r bin coatjava/
cp -r etc coatjava/
mkdir -p coatjava/lib/clas
cp external-dependencies/JEventViewer-1.1.jar coatjava/lib/clas/
cp external-dependencies/vecmath-1.3.1-2.jar coatjava/lib/clas/
mkdir -p coatjava/lib/utils
cp external-dependencies/jclara-4.3-SNAPSHOT.jar coatjava/lib/utils
cp external-dependencies/clas12mon-2.0.jar coatjava/lib/utils
cp external-dependencies/KPP-Plots-2.0.jar coatjava/lib/utils
#cp external-dependencies/jaw-1.0.jar coatjava/lib/utils
mkdir -p coatjava/lib/services
### clean up any cache copies ###
rm -rf ~/.m2/repository/org/hep/hipo
rm -rf ~/.m2/repository/org/jlab
unset CLAS12DIR
if [ $runUnitTests == "yes" ]; then
mvn install # also runs unit tests
if [ $? != 0 ] ; then echo "mvn install failure" ; exit 1 ; fi
else
mvn -Dmaven.test.skip=true install
if [ $? != 0 ] ; then echo "mvn install failure" ; exit 1 ; fi
fi
if [ $runSpotBugs == "yes" ]; then
# mvn com.github.spotbugs:spotbugs-maven-plugin:spotbugs # spotbugs goal produces a report target/spotbugsXml.xml for each module
mvn com.github.spotbugs:spotbugs-maven-plugin:check # check goal produces a report and produces build failed if bugs
# the spotbugsXml.xml file is easiest read in a web browser
# see http://spotbugs.readthedocs.io/en/latest/maven.html and https://spotbugs.github.io/spotbugs-maven-plugin/index.html for more info
if [ $? != 0 ] ; then echo "spotbugs failure" ; exit 1 ; fi
fi
cd common-tools/coat-lib
mvn package
if [ $? != 0 ] ; then echo "mvn package failure" ; exit 1 ; fi
cd -
cp common-tools/coat-lib/target/coat-libs-5.1-SNAPSHOT.jar coatjava/lib/clas/
cp reconstruction/dc/target/clas12detector-dc-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/tof/target/tof-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/cvt/target/cvt-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/ft/target/clas12detector-ft-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/ec/target/clas12detector-ec-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/ltcc/target/clasrec-ltcc-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/htcc/target/clasrec-htcc-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/cnd/target/clas12detector-cnd-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/rich/target/clas12detector-rich-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/fvt/target/clas12detector-fmt-1.0-SNAPSHOT.jar coatjava/lib/services/
cp reconstruction/eb/target/clas12detector-eb-1.0-SNAPSHOT.jar coatjava/lib/services/
echo "COATJAVA SUCCESSFULLY BUILT !"