Skip to content

Commit 8faa75d

Browse files
authored
Merge pull request #71 from evolvedbinary/7.x.x/hotfix/build-script-clean-target
[7.x.x] Small enhancements to the simple build script
2 parents 2e2b61b + ac4333c commit 8faa75d

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

build.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
set -e
2929

3030
TARGET="useage"
31+
DEBUG=false
3132
OFFLINE=false
3233
CONCURRENCY="-T2C"
3334

@@ -37,10 +38,14 @@ do
3738
key="$1"
3839

3940
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)
4142
TARGET="$1"
4243
shift
4344
;;
45+
--debug)
46+
DEBUG=true
47+
shift
48+
;;
4449
--offline)
4550
OFFLINE=true
4651
shift
@@ -57,7 +62,7 @@ esac
5762
done
5863

5964
function 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

@@ -84,10 +90,20 @@ fi
8490
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
8591
BASE_CMD="${SCRIPT_DIR}/mvnw -V"
8692

93+
if [ "${DEBUG}" == "true" ]; then
94+
BASE_CMD="${BASE_CMD} --debug"
95+
fi
96+
8797
if [ "${OFFLINE}" == "true" ]; then
8898
BASE_CMD="${BASE_CMD} --offline"
8999
fi
90100

101+
if [ "${TARGET}" == "clean" ]; then
102+
CMD="${BASE_CMD} ${CONCURRENCY} clean"
103+
$CMD
104+
exit 0;
105+
fi
106+
91107
if [ "${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

Comments
 (0)