@for /F "delims=" %%a in ('findstr /rc:"^    version" build.gradle') do @set versionline=%%a
@echo Closing all java and javaw processes with window title format: HubTurbo V%versionline:~15,5%*.
@taskkill /fi "Windowtitle eq HubTurbo V%versionline:~15,5%*" /im "javaw.exe"
@taskkill /fi "Windowtitle eq HubTurbo V%versionline:~15,5%*" /im "java.exe"
@echo(
@echo Starting Gradle build. This will take a while...
@echo(
@call gradlew clean shadowJar --no-daemon
@for /F "delims=" %%a in ('findstr /rc:"^    version" build.gradle') do @set versionline=%%a
@echo(
@echo Starting HubTurbo V%versionline:~15,5%. You can close this cmd window once HubTurbo begins launching.
@start "" javaw -jar build/libs/HubTurbo-%versionline:~15,5%-all.jar
@exit
Add Windows build script to root folder
Add Windows build script to root folder

The script closes any running HubTurbo instances, starts a gradle build,
then runs the newly built HubTurbo, at which point the batch script exits
while HubTurbo will continue running.

The script runs the build in --no-daemon mode, otherwise the cmd.exe
window will not close after HubTurbo has finished launching.

rbar is short for "rebuild and run".
