码迷,mamicode.com
首页 > 其他好文 > 详细

自动编译批处理设置(MSBuild)

时间:2018-10-25 12:06:48      阅读:603      评论:0      收藏:0      [点我收藏+]

标签:msbuild   ==   path   files   lease   --   deb   自动   cpu   

基本设置,如果想更改可以设置。

@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

 

自动编译批处理设置(MSBuild)

标签:msbuild   ==   path   files   lease   --   deb   自动   cpu   

原文地址:https://www.cnblogs.com/lixiaobin/p/MsbuildSetting.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!