2828setlocal enabledelayedexpansion
2929
3030set " TARGET = useage"
31+ set " DEBUG = false"
3132set " OFFLINE = false"
3233set " CONCURRENCY = -T2C"
3334
3435:: Process arguments
3536:parse_args
3637if " %~1 " == " " goto done_parsing
3738
38- if /I " %~1 " == " --offline" (
39+ if /I " %~1 " == " --debug" (
40+ set " DEBUG = true"
41+ ) else if /I " %~1 " == " --offline" (
3942 set " OFFLINE = true"
4043) else if /I " %~1 " == " --help" (
4144 set " TARGET = useage"
4245) else if /I " %~1 " == " -h" (
4346 set " TARGET = useage"
47+ ) else if /I " %~1 " == " clean" (
48+ set " TARGET = clean"
4449) else if /I " %~1 " == " quick" (
4550 set " TARGET = quick"
4651) else if /I " %~1 " == " quick-archives" (
@@ -69,6 +74,10 @@ goto parse_args
6974
7075:done_parsing
7176
77+ if " %DEBUG% " == " true" (
78+ set " BASE_CMD = %BASE_CMD% --debug"
79+ )
80+
7281if " %OFFLINE% " == " true" (
7382 set " BASE_CMD = %BASE_CMD% --offline"
7483)
@@ -82,10 +91,12 @@ set "SCRIPT_DIR=%~dp0"
8291set " BASE_CMD = %SCRIPT_DIR% \mvnw.cmd -V"
8392
8493:: Set CMD based on TARGET
85- if " %TARGET% " == " quick" (
94+ if " %TARGET% " == " clean" (
95+ set " CMD = %BASE_CMD% %CONCURRENCY% clean -Pinstaller,docker,concurrency-stress-tests,micro-benchmarks"
96+ ) else if " %TARGET% " == " quick" (
8697 set " 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"
8798) else if " %TARGET% " == " quick-archives" (
88- set " CMD = %BASE_CMD% %CONCURRENCY% clean package -DskipTests -Ddependency-check.skip=true -Ddocker=true -P installer,!concurrency-stress-tests,! micro-benchmarks"
99+ set " CMD = %BASE_CMD% %CONCURRENCY% clean package -DskipTests -Ddependency-check.skip=true -Ddocker=false -P installer,!concurrency-stress-tests,! micro-benchmarks"
89100) else if " %TARGET% " == " quick-docker" (
90101 set " CMD = %BASE_CMD% %CONCURRENCY% clean package -DskipTests -Ddependency-check.skip=true -Dappbundler.skip=true -Ddocker=true -P docker,!mac-dmg-on-mac,! codesign-mac-app,!codesign-mac-dmg,! mac-dmg-on-unix,!installer,! concurrency-stress-tests,!micro-benchmarks,skip-build-dist-archives"
91102) else if " %TARGET% " == " quick-archives-docker" (
@@ -115,9 +126,10 @@ goto end
115126
116127:show_useage
117128echo .
118- echo Usage: build.bat [--offline] ^ < target^ > ^ | --help
129+ echo Usage: build.bat [--debug] [-- offline] ^ < target^ > ^ | --help
119130echo .
120131echo Available build targets:
132+ echo clean - Remove all built artifacts
121133echo quick - Build distribution directory
122134echo quick-archives - Build and archive distribution
123135echo quick-docker - Build distribution + Docker image
0 commit comments