@echo off
REM Generated by the Codename One Initializr for build.bat (see the build
REM progress reporting notes there). Runs the Maven wrapper through
REM Cn1Capture.java, which keeps a copy of the output so build.bat can say why a
REM build stopped. Exits with the Maven wrapper's own status.
REM
REM Paths given to Java are relative and ASCII: java.exe reads its command line
REM in the console code page, so a project folder with other characters in its
REM name would not reach it intact. And if the helper did not start for ANY
REM reason (no marker), Maven runs directly: reporting never costs a build.
REM The marker is per run: two builds in one project must not see each other's.
pushd "%~dp0.."
set "CN1_RAN=.mvn\cn1-capture-%RANDOM%%RANDOM%.ran"
if exist "%CN1_RAN%" del /q "%CN1_RAN%" >nul 2>&1
"%CN1_JAVA_EXE%" .mvn\Cn1Capture.java "%CN1_LOG%" "%CN1_RAN%" .\mvnw.cmd %*
set "CN1_CAPTURE_RC=%errorlevel%"
if not exist "%CN1_RAN%" goto :direct
del /q "%CN1_RAN%" >nul 2>&1
popd
exit /b %CN1_CAPTURE_RC%
:direct
set "CN1_LOG="
call .\mvnw.cmd %*
set "CN1_CAPTURE_RC=%errorlevel%"
popd
exit /b %CN1_CAPTURE_RC%
