-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·82 lines (67 loc) · 2.67 KB
/
build.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
#!/bin/bash
##########################
# Copyright (C) 2020 Ondřej Vašíček <ondrej.vasicek.0@gmail.com>, <xvasic25@stud.fit.vutbr.cz>
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
##########################
HELP="
Loads configuration files and then builds and installs the adapter
and its dependencies.
"
USAGE=" Usage: $0 [-h]
-h ... help
"
USRPATH="$PWD" # get the call directory
ROOTDIR="$(dirname "$(realpath "$0")")" # get the script directory
# source shared utils
source "$ROOTDIR/dev_tools/shared.sh"
main () {
# process arguments
for arg in "$@"
do
case "$arg" in
-h) print_help "$HELP" "$USAGE"; shift ;;
*) invalid_arg "$arg" "$USAGE" ;;
esac
done
# firt check that the required utilities are available
if ! type "mvn" &> /dev/null; then
echo -e "\nERORR: The '${RED}mvn${NC}' utility is required by Unite but is ${RED}not available${NC}.\n"
exit "$?"
fi
echo
echo "############################################################"
echo " Processing configuration files"
echo "############################################################"
echo
processConfFiles "$ROOTDIR"
echo
echo "############################################################"
echo " Building and Installing shared resources"
echo "############################################################"
echo
mvn -f "$ROOTDIR/domain/pom.xml" clean install || exit "$?"
mvn -f "$ROOTDIR/shared/pom.xml" clean install || exit "$?"
mvn install:install-file -Dfile="$ROOTDIR/lib/cz.vutbr.fit.group.verifit.arrowhead.client.jersey_0.1.0.202205231408.jar" -DgroupId='cz.vutbr.fit.group.verifit.arrowhead.client' -DartifactId='jersey' -Dversion='0.1.0.qualifier' -Dpackaging='jar' || exit "$?"
echo
echo "############################################################"
echo " Building and Installing the Compilation adapter"
echo "############################################################"
echo
mvn -f "$ROOTDIR/compilation/pom.xml" clean install || exit "$?"
echo
echo "############################################################"
echo " Building and Installing the Analysis adapter"
echo "############################################################"
echo
mvn -f "$ROOTDIR/analysis/pom.xml" clean install || exit "$?"
echo
echo -e "##### ${GREEN}BUILD DONE${NC} ###########################################"
echo
exit 0
}
main "$@"