ProtobufTest/Tools/protogen--net8.0/run.bat

33 lines
778 B
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

chcp 65001
@echo off
setlocal
set "PROTOC=.\protogen.exe"
set "PROTO_FILES=.\ProtoConfig"
set "PROTO_OUT=.\CSharpConfig"
set "DEST_FOLDER=..\..\Assets\Scripts\Proto"
@REM 显示将要处理的文件列表
echo 将要处理的文件列表:
for %%f in ("%PROTO_FILES%\*") do (
echo %%f
)
@REM 遍历指定文件夹下的所有文件
for %%f in ("%PROTO_FILES%\*") do (
echo 正在处理文件:%%f
"%PROTOC%" "%%f" --csharp_out="%PROTO_OUT%"
)
if exist "%DEST_FOLDER%" rmdir /s /q "%DEST_FOLDER%"
@REM 检查并创建目标文件夹
mkdir "%DEST_FOLDER%"
@REM 拷贝生成的.cs文件到目标文件夹
echo 拷贝生成的.cs文件到目标文件夹%DEST_FOLDER%
xcopy /s /y "%PROTO_OUT%\*" "%DEST_FOLDER%"
@REM 输出结束消息
echo 处理完成
pause