修改构建脚本
This commit is contained in:
parent
ea80d6e89c
commit
0f2404bf12
|
@ -1,13 +0,0 @@
|
|||
@echo off
|
||||
|
||||
echo Build %1 task!
|
||||
|
||||
cd %1
|
||||
go fmt
|
||||
go vet
|
||||
go build -v
|
||||
echo errorlevel:%errorlevel%
|
||||
if "%errorlevel%"=="0" exit
|
||||
if not "%errorlevel%"=="0" echo %1 build failed!
|
||||
pause
|
||||
exit
|
37
build.bat
37
build.bat
|
@ -1,30 +1,17 @@
|
|||
go env -w GO111MODULE=off
|
||||
@echo "go fmt common..."
|
||||
cd common
|
||||
go fmt
|
||||
|
||||
@echo "go fmt api3th..."
|
||||
cd ../api3th
|
||||
go fmt
|
||||
@echo off
|
||||
|
||||
@echo "go fmt model..."
|
||||
cd ../model
|
||||
go fmt
|
||||
|
||||
@echo "go fmt webapi..."
|
||||
cd ../webapi
|
||||
go fmt
|
||||
|
||||
@echo "go fmt lib complete!"
|
||||
|
||||
cd ..
|
||||
start build-sub.bat dbproxy
|
||||
start build-sub.bat mgrsrv
|
||||
start build-sub.bat gatesrv
|
||||
start build-sub.bat worldsrv
|
||||
start build-sub.bat gamesrv
|
||||
start build-sub.bat robot
|
||||
start build-sub.bat ranksrv
|
||||
call shell/build_sub.bat dbproxy
|
||||
call shell/build_sub.bat mgrsrv
|
||||
call shell/build_sub.bat gatesrv
|
||||
call shell/build_sub.bat worldsrv
|
||||
call shell/build_sub.bat gamesrv
|
||||
call shell/build_sub.bat robot
|
||||
call shell/build_sub.bat ranksrv
|
||||
|
||||
@echo "Wait all build task complete!"
|
||||
pause
|
||||
|
||||
if %errorcode% neq 0 (
|
||||
pause
|
||||
)
|
||||
|
|
|
@ -2,9 +2,4 @@ set CGO_ENABLED=0
|
|||
set GOOS=linux
|
||||
set GOARCH=amd64
|
||||
|
||||
go env -w GO111MODULE=off
|
||||
|
||||
build.bat
|
||||
|
||||
@echo "complete"
|
||||
pause
|
||||
call build.bat
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
set CGO_ENABLED=0
|
||||
set GOOS=darwin
|
||||
set GOARCH=amd64
|
||||
|
||||
go env -w GO111MODULE=off
|
||||
|
||||
build.bat
|
||||
|
||||
@echo "complete"
|
||||
pause
|
Binary file not shown.
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
@ -0,0 +1,34 @@
|
|||
rem 切换到develop分支
|
||||
git checkout develop
|
||||
|
||||
rem 生成配置文件
|
||||
call shell/gen_data.bat
|
||||
|
||||
rem 生产protocol
|
||||
call shell/gen_go.bat
|
||||
|
||||
rem 提交public
|
||||
call update_public.bat
|
||||
|
||||
rem 提交develop
|
||||
git add .
|
||||
git commit -m "update develop"
|
||||
|
||||
rem 切换release
|
||||
git checkout release
|
||||
|
||||
rem 合并develop分支
|
||||
git merge develop
|
||||
|
||||
rem 提交release
|
||||
git add .
|
||||
git commit -m "update release"
|
||||
|
||||
rem 编译
|
||||
call build_linux.bat
|
||||
|
||||
rem 提交deploy仓库
|
||||
call update_deploy.bat
|
||||
|
||||
|
||||
|
16
gen_data.bat
16
gen_data.bat
|
@ -1,17 +1,3 @@
|
|||
@echo off
|
||||
set work_path=%cd%
|
||||
set protoc=%work_path%\bin\protoc-3.19.4-win64\bin\protoc.exe
|
||||
set protoc-gen-go-plugin-path="%work_path%\bin\protoc-gen-go.exe"
|
||||
|
||||
cd %work_path%/tools/xlsx2proto
|
||||
go build
|
||||
xlsx2proto.exe
|
||||
|
||||
cd ../../protocol/server
|
||||
%protoc% --proto_path=%GOPATH%\src --proto_path=. --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=%GOPATH%\src pbdata.proto
|
||||
|
||||
cd ../../tools/xlsx2binary
|
||||
go build
|
||||
xlsx2binary.exe
|
||||
|
||||
call shell/gen_data.bat
|
||||
pause
|
||||
|
|
18
gen_go.bat
18
gen_go.bat
|
@ -1,19 +1,3 @@
|
|||
@echo off
|
||||
set work_path=%cd%
|
||||
set proto_path=%work_path%\protocol
|
||||
set protoc=%work_path%\bin\protoc-3.19.4-win64\bin\protoc.exe
|
||||
set protoc-gen-go-plugin-path="%work_path%\bin\protoc-gen-go.exe"
|
||||
|
||||
echo %protoc3%
|
||||
cd %proto_path%
|
||||
for /d %%s in (,*) do (
|
||||
cd %%s
|
||||
for %%b in (,*.proto) do (
|
||||
echo %%b
|
||||
%protoc% --proto_path=%GOPATH%\src --proto_path=. --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=%GOPATH%\src %%b
|
||||
)
|
||||
cd ..
|
||||
)
|
||||
|
||||
|
||||
call shell/gen_go.bat
|
||||
pause
|
2
public
2
public
|
@ -1 +1 @@
|
|||
Subproject commit abbc14d3f158a3ab8865e25b735e601502a55257
|
||||
Subproject commit fcb24ec4f50716936ebb587e84867835b4dba2fc
|
|
@ -0,0 +1,10 @@
|
|||
cd %1
|
||||
echo ========= Build %1 =========
|
||||
go fmt
|
||||
go vet
|
||||
go build -v
|
||||
if %errorlevel% neq 0 (
|
||||
echo Build failed %1.
|
||||
set errorcode=1
|
||||
)
|
||||
cd ..
|
|
@ -0,0 +1,14 @@
|
|||
set work_path=%cd%
|
||||
set protoc=%work_path%\bin\protoc-3.19.4-win64\bin\protoc.exe
|
||||
set protoc-gen-go-plugin-path="%work_path%\bin\protoc-gen-go.exe"
|
||||
|
||||
cd %work_path%/tools/xlsx2proto
|
||||
go build
|
||||
xlsx2proto.exe
|
||||
|
||||
cd ../../protocol/server
|
||||
%protoc% --proto_path=%GOPATH%\src --proto_path=. --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=%GOPATH%\src pbdata.proto
|
||||
|
||||
cd ../../tools/xlsx2binary
|
||||
go build
|
||||
xlsx2binary.exe
|
|
@ -0,0 +1,15 @@
|
|||
set work_path=%cd%
|
||||
set proto_path=%work_path%\protocol
|
||||
set protoc=%work_path%\bin\protoc-3.19.4-win64\bin\protoc.exe
|
||||
set protoc-gen-go-plugin-path="%work_path%\bin\protoc-gen-go.exe"
|
||||
|
||||
rem echo %protoc3%
|
||||
cd %proto_path%
|
||||
for /d %%s in (,*) do (
|
||||
cd %%s
|
||||
for %%b in (,*.proto) do (
|
||||
rem echo %%b
|
||||
%protoc% --proto_path=%GOPATH%\src --proto_path=. --plugin=protoc-gen-go=%protoc-gen-go-plugin-path% --go_out=%GOPATH%\src %%b
|
||||
)
|
||||
cd ..
|
||||
)
|
|
@ -0,0 +1,15 @@
|
|||
if exist ".\public" (
|
||||
cd .\public
|
||||
git checkout main
|
||||
git pull
|
||||
|
||||
xcopy ..\data .\data /s /e /y
|
||||
xcopy ..\protocol .\protocol /s /e /y
|
||||
xcopy ..\xlsx .\xlsx /s /e /y
|
||||
|
||||
git add .
|
||||
git commit -m "update"
|
||||
git push
|
||||
cd ..
|
||||
)
|
||||
|
|
@ -1,18 +1,3 @@
|
|||
@echo off
|
||||
|
||||
if not exist ".\public" (
|
||||
pause
|
||||
)
|
||||
|
||||
cd .\public
|
||||
git checkout main
|
||||
git pull
|
||||
|
||||
xcopy ..\data .\data /s /e /y
|
||||
xcopy ..\protocol .\protocol /s /e /y
|
||||
xcopy ..\xlsx .\xlsx /s /e /y
|
||||
|
||||
git add .
|
||||
git commit -m "update"
|
||||
git push
|
||||
call shell/update_public.bat
|
||||
pause
|
Loading…
Reference in New Issue