发布批处理
发布批处理
::生成新的版本
set year=%date:~2,2%
set month=%date:~5,2%
set day=%date:~8,2%
set VERSION=%year%%month%%day%
set NEWVERSION=1.0.0.%VERSION%
set NAME=MicroSeis
set SRC=%NAME%-%NEWVERSION%
set OLD=%NAME%-base
rd /s /q %SRC%\
xcopy /e /y /q %OLD% %SRC%\
:: 编译新的文件
SET PROJECTPATH=D:\XXX
:: 编译工具路径
SET DEVENVCOM="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com"
set BUILDSRC=%PROJECTPATH%\Release
%DEVENVCOM% "%PROJECTPATH%\XXX.sln" /rebuild "Release|x64" /project "XXX"
xcopy /e /y /q %PROJECTPATH%\XXX\bin\x64\Release\Microseis.exe %SRC%\
del %SRC%\*.pdb
del %SRC%\*.xml
:: pause;
rem 自动拷贝到共享目录
set DEST=D:\share\release\%NAME%-%NEWVERSION%
xcopy /e /y /q %SRC%\ %DEST%\
echo "发布成功"
:: pause;
标签:set,编译,SRC%,C#,XXX,批处理,Release
From: https://www.cnblogs.com/lvye1221/p/17265446.html