28
28
set -e
29
29
30
30
TARGET=" useage"
31
+ DEBUG=false
31
32
OFFLINE=false
32
33
CONCURRENCY=" -T2C"
33
34
37
38
key=" $1 "
38
39
39
40
case $key in
40
- quick|quick-archives|quick-docker|quick-archives-docker|quick-install|test|site|license-check|license-format|dependency-check|dependency-security-check)
41
+ clean| quick|quick-archives|quick-docker|quick-archives-docker|quick-install|test|site|license-check|license-format|dependency-check|dependency-security-check)
41
42
TARGET=" $1 "
42
43
shift
43
44
;;
45
+ --debug)
46
+ DEBUG=true
47
+ shift
48
+ ;;
44
49
--offline)
45
50
OFFLINE=true
46
51
shift
57
62
done
58
63
59
64
function print-useage() {
60
- echo -e " \n./build.sh [--offline] <target> | --help"
65
+ echo -e " \n./build.sh [--debug] [-- offline] <target> | --help"
61
66
echo -e " \nAvailable build targets are:"
62
67
echo -e " \tquick - A distribution directory that can be found in exist-distribution/target/elemental-x.y.x-dir"
63
68
echo -e " \tquick-archives - A distribution directory, and distribution archives that can be found in exist-distribution/target/"
@@ -70,6 +75,7 @@ function print-useage() {
70
75
echo -e " \tlicence-format - Adds the correct license header to any source files that are missing it"
71
76
echo -e " \tdependency-check - Checks that all modules have correctly declared their dependencies"
72
77
echo -e " \tdependency-security-check - Checks that all dependencies have no unexpected CVE security issues"
78
+ echo -e " \tclean - Remove all built artifacts"
73
79
echo -e " \n--offline - attempts to run the Maven build in offline mode"
74
80
}
75
81
84
90
SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
85
91
BASE_CMD=" ${SCRIPT_DIR} /mvnw -V"
86
92
93
+ if [ " ${DEBUG} " == " true" ]; then
94
+ BASE_CMD=" ${BASE_CMD} --debug"
95
+ fi
96
+
87
97
if [ " ${OFFLINE} " == " true" ]; then
88
98
BASE_CMD=" ${BASE_CMD} --offline"
89
99
fi
90
100
101
+ if [ " ${TARGET} " == " clean" ]; then
102
+ CMD=" ${BASE_CMD} ${CONCURRENCY} clean"
103
+ $CMD
104
+ exit 0;
105
+ fi
106
+
91
107
if [ " ${TARGET} " == " quick" ]; then
92
108
CMD=" ${BASE_CMD} ${CONCURRENCY} clean package -DskipTests -Ddependency-check.skip=true -Dappbundler.skip=true -Ddocker=false -P !mac-dmg-on-mac,!codesign-mac-app,!codesign-mac-dmg,!mac-dmg-on-unix,!installer,!concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives"
93
109
$CMD
0 commit comments