You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
961 B
30 lines
961 B
@echo off
|
|
REM Windows编译Web版本脚本
|
|
|
|
echo 正在编译Web版本...
|
|
|
|
REM 检查gson库
|
|
if not exist "lib\gson-2.10.1.jar" (
|
|
echo 错误: 缺少gson-2.10.1.jar库文件
|
|
echo 请下载gson-2.10.1.jar并放置在lib目录下
|
|
echo 下载地址: https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar
|
|
echo.
|
|
echo 或使用PowerShell下载:
|
|
echo powershell -Command "New-Item -ItemType Directory -Force -Path lib; Invoke-WebRequest -Uri 'https://repo1.maven.org/maven2/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar' -OutFile 'lib\gson-2.10.1.jar'"
|
|
exit /b 1
|
|
)
|
|
|
|
REM 创建输出目录
|
|
if not exist bin mkdir bin
|
|
|
|
REM 编译WebSocket服务器
|
|
javac -cp "lib\gson-2.10.1.jar" -d bin -encoding UTF-8 src/common/*.java src/server/WebSocketServer.java src/server/WebSocketClient.java
|
|
|
|
if %errorlevel% equ 0 (
|
|
echo 编译成功!
|
|
echo 输出目录: bin/
|
|
) else (
|
|
echo 编译失败!
|
|
exit /b 1
|
|
)
|