Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,24 @@
setlocal enabledelayedexpansion

set "TARGET=useage"
set "DEBUG=false"
set "OFFLINE=false"
set "CONCURRENCY=-T2C"

:: Process arguments
:parse_args
if "%~1"=="" goto done_parsing

if /I "%~1"=="--offline" (
if /I "%~1"=="--debug" (
set "DEBUG=true"
) else if /I "%~1"=="--offline" (
set "OFFLINE=true"
) else if /I "%~1"=="--help" (
set "TARGET=useage"
) else if /I "%~1"=="-h" (
set "TARGET=useage"
) else if /I "%~1"=="clean" (
set "TARGET=clean"
) else if /I "%~1"=="quick" (
set "TARGET=quick"
) else if /I "%~1"=="quick-archives" (
Expand Down Expand Up @@ -69,6 +74,10 @@ goto parse_args

:done_parsing

if "%DEBUG%"=="true" (
set "BASE_CMD=%BASE_CMD% --debug"
)

if "%OFFLINE%"=="true" (
set "BASE_CMD=%BASE_CMD% --offline"
)
Expand All @@ -82,10 +91,12 @@ set "SCRIPT_DIR=%~dp0"
set "BASE_CMD=%SCRIPT_DIR%\mvnw.cmd -V"

:: Set CMD based on TARGET
if "%TARGET%"=="quick" (
if "%TARGET%"=="clean" (
set "CMD=%BASE_CMD% %CONCURRENCY% clean -Pinstaller,docker,concurrency-stress-tests,micro-benchmarks"
) else if "%TARGET%"=="quick" (
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"
) else if "%TARGET%"=="quick-archives" (
set "CMD=%BASE_CMD% %CONCURRENCY% clean package -DskipTests -Ddependency-check.skip=true -Ddocker=true -P installer,!concurrency-stress-tests,!micro-benchmarks"
set "CMD=%BASE_CMD% %CONCURRENCY% clean package -DskipTests -Ddependency-check.skip=true -Ddocker=false -P installer,!concurrency-stress-tests,!micro-benchmarks"
) else if "%TARGET%"=="quick-docker" (
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"
) else if "%TARGET%"=="quick-archives-docker" (
Expand All @@ -95,7 +106,7 @@ if "%TARGET%"=="quick" (
) else if "%TARGET%"=="test" (
set "CMD=%BASE_CMD% clean test -Ddependency-check.skip=true"
) else if "%TARGET%"=="site" (
set "CMD=%BASE_CMD% clean test -Ddependency-check.skip=true"
set "CMD=%BASE_CMD% clean site -Ddependency-check.skip=true"
) else if "%TARGET%"=="license-check" (
set "CMD=%BASE_CMD% license:check"
) else if "%TARGET%"=="license-format" (
Expand All @@ -115,9 +126,10 @@ goto end

:show_useage
echo.
echo Usage: build.bat [--offline] ^<target^> ^| --help
echo Usage: build.bat [--debug] [--offline] ^<target^> ^| --help
echo.
echo Available build targets:
echo clean - Remove all built artifacts
echo quick - Build distribution directory
echo quick-archives - Build and archive distribution
echo quick-docker - Build distribution + Docker image
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if [ "${OFFLINE}" == "true" ]; then
fi

if [ "${TARGET}" == "clean" ]; then
CMD="${BASE_CMD} ${CONCURRENCY} clean"
CMD="${BASE_CMD} ${CONCURRENCY} clean -Pinstaller,docker,concurrency-stress-tests,micro-benchmarks"
$CMD
exit 0;
fi
Expand All @@ -111,7 +111,7 @@ if [ "${TARGET}" == "quick" ]; then
fi

if [ "${TARGET}" == "quick-archives" ]; then
CMD="${BASE_CMD} ${CONCURRENCY} clean package -DskipTests -Ddependency-check.skip=true -Ddocker=true -P installer,!concurrency-stress-tests,!micro-benchmarks"
CMD="${BASE_CMD} ${CONCURRENCY} clean package -DskipTests -Ddependency-check.skip=true -Ddocker=false -P installer,!concurrency-stress-tests,!micro-benchmarks"
$CMD
exit 0;
fi
Expand Down