msbuild批处理发布网站

发布时间2018/12/3 21:38:42

下载次数 0 次 访问量245 次

免开发-应用中心上线啦,专注提供优质插件源码和产品应用!

@echo off
rem ---------------------------------
rem ----作成者:李暁賓---------------
rem ---------------------------------

cd /d %~dp0

echo %date%

set /p input="是否编译(y/n): "

if not %input% == y (
    pause
    exit 0
)

for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
     set year=%%i
     set month=%%j
     set day=%%k
     set down=%%l
)
set datestr=%year%%month%%day%

rem MSBuild.exe 路径
set MSBUILD_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
rem solution 路径
set SOLUTION_FILE=C:\Users\work\00_dev\01_src\Test\Test.sln
rem Release / Debug
set BUILD_CONFIG=Release
rem build / rebuild / clean
set BUILD_TYPE=clean;build
rem Any CPU / x64 / x86
set BUILD_PLATFORM="Any CPU"
set OUTPUT_PATH=C:\Users\work\00_dev\01_src\%datestr%

@echo 编译开始

"%MSBUILD_PATH%" %SOLUTION_FILE% /t:%BUILD_TYPE% /p:Configuration=%BUILD_CONFIG%;Platform=%BUILD_PLATFORM%;OutDir=%OUTPUT_PATH%\%BUILD_CONFIG% /m

@echo 编译结束

pause
exit 0

网友评论

发表评论

欢迎评论哦!