Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ jobs:
run: libexec/version-bump.sh ${{ github.ref_name }}
- name: build
run: |
git lfs install
git submodule update --init ./etc/data/magfield
./build-coatjava.sh --cvmfs --no-progress -T${{ env.nthreads }}
./install-clara -b -c ./coatjava ./clara
./build-coatjava.sh --lfs --no-progress -T${{ env.nthreads }}
./install-clara -b -c ./coatjava ./clara
- name: tar # tarball to preserve permissions
run: |
tar czvf coatjava.tar.gz coatjava
Expand Down
4 changes: 1 addition & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ build:
optional: true
script:
- git config --global --add safe.directory $CI_PROJECT_DIR
- git lfs install
- git submodule update --init etc/data/magfield
- ./build-coatjava.sh --clara -T$JL_RUNNER_AVAIL_CPU --quiet --no-progress
- ./build-coatjava.sh --lfs --clara -T$JL_RUNNER_AVAIL_CPU --quiet --no-progress
- tar -czf coatjava.tar.gz coatjava
- tar -czf clara.tar.gz clara
artifacts:
Expand Down
53 changes: 28 additions & 25 deletions build-coatjava.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,27 @@ set -o pipefail
usage='''build-coatjava.sh [OPTIONS]... [MAVEN_OPTIONS]...

OPTIONS

--clara install clara too
--clean clean up built objects and exit (does not compile)
--quiet run more quietly
--no-progress no download progress printouts
--help show this message

OPTIONS FOR MAGNETIC FIELD MAPS
--lfs use git-lfs for field maps and test data
--cvmfs use cvmfs to download field maps
--xrootd use xrootd to download field maps
--nomaps do not download field maps

OPTIONS FOR TESTING
--spotbugs also run spotbugs plugin
--unittests also run unit tests

--depana run dependency analysis (only)

--quiet run more quietly
--no-progress no download progress printouts

--xrootd use xrootd to download field maps
--cvmfs use cvmfs to download field maps
--lfs use lfs for field maps and test data

--clara install clara too
--data download test data (requires lfs)

--help show this message

MAVEN_OPTIONS

all other arguments will be passed to `mvn`, e.g., -T4 will build with 4 parallel threads
all other arguments will be passed to `mvn`; for example,
-T4 will build with 4 parallel threads
'''

cleanBuild="no"
Expand Down Expand Up @@ -79,7 +75,7 @@ done

if $downloadData && ! $useLfs; then
echo "$usage"
echo "ERROR::::::::::: --data requires --lfs"
echo "ERROR::::::::::: --data requires --lfs" >&2
exit 2
fi

Expand Down Expand Up @@ -110,10 +106,16 @@ download () {
xrdcp $1 ./
ret=$?
elif $useLfs; then
cd $src_dir
git submodule update --init etc/data/magfield
if $downloadData; then git submodule update --init validation/advanced-tests/data; fi
cd - > /dev/null
if command_exists git-lfs ; then
cd $src_dir > /dev/null
git lfs install
git submodule update --init etc/data/magfield
if $downloadData; then git submodule update --init validation/advanced-tests/data; fi
cd - > /dev/null
else
echo 'ERROR: `git-lfs` not found; please install it, or use a different option other than `--lfs`' >&2
ret=1
fi
elif $useCvmfs; then
cp -v $1 ./
ret=$?
Expand All @@ -127,7 +129,7 @@ download () {
fi
else
ret=1
echo ERROR::::::::::: Could not find wget nor curl.
echo "ERROR::::::::::: Could not find wget nor curl." >&2
fi
return $ret
}
Expand All @@ -148,11 +150,12 @@ if [ $cleanBuild == "no" ] && [ $downloadMaps == "yes" ]; then
do
download $webDir/$map
if [ $? -ne 0 ]; then
echo ERROR::::::::::: Could not download field map:
echo $webDir/$map
echo One option is to download manually into etc/data/magfield and then run this build script with --nomaps
echo "ERROR::::::::::: Could not download field map:" >&2
echo "$webDir/$map" >&2
echo "One option is to download manually into etc/data/magfield and then run this build script with --nomaps" >&2
exit 1
fi
$useLfs && break
done
cd -
fi
Expand Down Expand Up @@ -208,7 +211,7 @@ if [ $runSpotBugs == "yes" ]; then
$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
if [ $? != 0 ] ; then echo "spotbugs failure" >&2 ; exit 1 ; fi
fi

# installation
Expand Down