2828set -e
2929
3030TARGET=" useage"
31+ DEBUG=false
3132OFFLINE=false
3233CONCURRENCY=" -T2C"
3334
3738key=" $1 "
3839
3940case $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)
4142 TARGET=" $1 "
4243 shift
4344 ;;
45+ --debug)
46+ DEBUG=true
47+ shift
48+ ;;
4449 --offline)
4550 OFFLINE=true
4651 shift
5762done
5863
5964function print-useage() {
60- echo -e " \n./build.sh [--offline] <target> | --help"
65+ echo -e " \n./build.sh [--debug] [-- offline] <target> | --help"
6166 echo -e " \nAvailable build targets are:"
6267 echo -e " \tquick - A distribution directory that can be found in exist-distribution/target/elemental-x.y.x-dir"
6368 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() {
7075 echo -e " \tlicence-format - Adds the correct license header to any source files that are missing it"
7176 echo -e " \tdependency-check - Checks that all modules have correctly declared their dependencies"
7277 echo -e " \tdependency-security-check - Checks that all dependencies have no unexpected CVE security issues"
78+ echo -e " \tclean - Remove all built artifacts"
7379 echo -e " \n--offline - attempts to run the Maven build in offline mode"
7480}
7581
8490SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
8591BASE_CMD=" ${SCRIPT_DIR} /mvnw -V"
8692
93+ if [ " ${DEBUG} " == " true" ]; then
94+ BASE_CMD=" ${BASE_CMD} --debug"
95+ fi
96+
8797if [ " ${OFFLINE} " == " true" ]; then
8898 BASE_CMD=" ${BASE_CMD} --offline"
8999fi
90100
101+ if [ " ${TARGET} " == " clean" ]; then
102+ CMD=" ${BASE_CMD} ${CONCURRENCY} clean"
103+ $CMD
104+ exit 0;
105+ fi
106+
91107if [ " ${TARGET} " == " quick" ]; then
92108 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"
93109 $CMD
0 commit comments