-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·96 lines (81 loc) · 1.83 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
#################
#
# Show help and exit
#
#################
function show_help {
echo "Usage: $0 [-d] [-h]"
echo "-d - enable maven debugging"
exit 1
}
#
# This script should be executed from the directory
# it is located in. Try and stop alternatives
#
SCRIPT=`basename "$0"`
if [ ! -f $SCRIPT ]; then
echo "This script must be executed from the same directory it is located in"
exit 1
fi
#
# We must be in the same directory as the script so work
# out the root directory and find its absolute path
#
SCRIPT_DIR=`pwd`
echo "Script directory = $SCRIPT_DIR"
#
# Set root directory to be its parent since we are downloading
# lots of stuff and the relative path to the parent pom is
# ../build/parent/pom.xml
#
ROOT_DIR="$SCRIPT_DIR/.."
#
# By default debug is turned off
#
DEBUG=0
#
# Determine the command line options
#
while getopts "bdh" opt;
do
case $opt in
d) DEBUG=1 ;;
h) show_help ;;
*) show_help ;;
esac
done
#
# Source directory containing teiid designer codebase
# Should be the same directory as the build script location
#
SRC_DIR="${SCRIPT_DIR}"
#
# Maven repository to use.
# Ensure it only contains teiid related artifacts and
# does not clutter up user's existing $HOME/.m2 repository
#
LOCAL_REPO="${ROOT_DIR}/m2-repository"
echo "maven repository - $LOCAL_REPO"
#
# Maven command
#
MVN="mvn clean install"
#
# Turn on dedugging if required
#
if [ "${DEBUG}" == "1" ]; then
MVN_FLAGS="-e -X"
fi
#
# Maven options
# -P <profiles> : The profiles to be used for downloading jbosstools artifacts
# -D maven.repo.local : Assign the $LOCAL_REPO as the target repository
#
MVN_FLAGS="${MVN_FLAGS} -Dmaven.repo.local=${LOCAL_REPO}"
echo "==============="
# Build and test the teiid designer codebase
echo "Build and install the teiid designer plugins"
cd "${SRC_DIR}"
echo "Executing ${MVN} ${MVN_FLAGS}"
${MVN} ${MVN_FLAGS}