@echo off
rem TODO check exit codes

echo Building minecraft-rpc-xxx.jar package.

rem Execute Maven clean package
rem Make sure mvn uses JDK17
call mvn clean package

echo Java server with Sponge plugin generated successfully.

echo Building python client files.

rem Execute the Python command for generating gRPC code
rem Make sure to call python 3.11 with grpc_tools 1.60.1
python -m grpc_tools.protoc -I=src/main/proto --python_out=clients/python --pyi_out=clients/python --grpc_python_out=clients/python src/main/proto/minecraft.proto

echo Python client generated successfully.

echo Program execution successful!