forked from Teiid-Designer/komodo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·122 lines (104 loc) · 2.47 KB
/
build.sh
File metadata and controls
executable file
·122 lines (104 loc) · 2.47 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
#################
#
# Show help and exit
#
#################
function show_help {
echo "Usage: $0 -p [-d] [-s] [-q] [-h]"
echo "-p - profile to build (dv63, wildfly ...)"
echo "-d - enable maven debugging"
echo "-s - skip test execution"
echo "-q - skip integration test execution"
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 "p:bdhsq" opt;
do
case $opt in
d) DEBUG=1 ;;
h) show_help ;;
s) SKIP=1 ;;
p) PROFILE=$OPTARG ;;
q) INT_SKIP=1 ;;
*) show_help ;;
esac
done
#
# Source directory containing komodo codebase
# Should be the same directory as the build script location
#
SRC_DIR="${SCRIPT_DIR}"
#
# Maven repository to use.
# Ensure it only contains komodo related artifacts and
# does not clutter up user's existing $HOME/.m2 repository
#
#LOCAL_REPO="${ROOT_DIR}/m2-repository"
LOCAL_REPO="${HOME}/.m2/repository"
#
# Maven command
#
MVN="mvn clean install"
#
# Check we have a profile
#
if [ -z "${PROFILE}" ]; then
echo "No profile have been specified. Use -p for either DV6.3 build (dv63) or community build (wildfly)"
exit 1
fi
#
# Turn on dedugging if required
#
if [ "${DEBUG}" == "1" ]; then
MVN_FLAGS="-e -X -U"
fi
#
# Skip tests
#
if [ "${SKIP}" == "1" ]; then
SKIP_FLAG="-DskipTests"
INTEGRATION_SKIP_FLAG="-Dintegration.skipTests=true"
fi
if [ "${INT_SKIP}" == "1" ]; then
INTEGRATION_SKIP_FLAG="-Dintegration.skipTests=true"
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} -s settings.xml -P ${PROFILE} -Dmaven.repo.local=${LOCAL_REPO} ${SKIP_FLAG} ${INTEGRATION_SKIP_FLAG}"
echo "==============="
# Build and test the komodo codebase
echo "Build and install the komodo plugins"
cd "${SRC_DIR}"
echo "Executing ${MVN} ${MVN_FLAGS}"
${MVN} ${MVN_FLAGS}