Build_Release.bat

Posted 备忘录

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Build_Release.bat相关的知识,希望对你有一定的参考价值。

Build_Release.bat

 1 @echo off
 2 pushd "%~dp0"
 3 set msbuild="%windir%\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe" /nologo /p:Configuration=Release;BuildProjectReferences=false
 4 set pathBin=..\Output\Release
 5 set path1=..\Src\Folder1
 6 set path2=..\Src\Folder2
 7 set buildlog=%~n0.log
 8 
 9 set /p input="Start msbuild all (Release) ? [Y/n]: "
10 if "%input%"=="" goto :buildAll
11 if /i "%input%"=="Y" goto :buildAll
12 if /i "%input%"=="Yes" goto :buildAll
13 goto :end
14 
15 :buildAll
16 if exist %buildlog% del %buildlog%
17 call :buildProj %path1% Proj1
18 call :buildProj %path1% Proj2
19 call :buildProj %path2% AnotherProj
20 echo.
21 set /p input="Start Foo.exe? [Y/n]: "
22 if "%input%"=="" goto :runFoo
23 if /i "%input%"=="Y" goto :runFoo
24 if /i "%input%"=="Yes" goto :runFoo
25 goto :end
26 
27 :runFoo
28 call :run %pathBin% Foo.exe
29 goto :end
30 
31 :run
32 cd /d %1
33 start "" %2
34 goto :eof
35 
36 :buildProj
37 set desc=msbuild %2...
38 title %desc%
39 echo %desc%
40 echo ---------------------------------------->>%buildlog%
41 echo %desc%>>%buildlog%
42 echo ---------------------------------------->>%buildlog%
43 %msbuild% %1\%2\%2.csproj >>%buildlog%
44 if ERRORLEVEL 1 echo ERROR!
45 goto :eof
46 
47 :end
48 popd

 

 

Build_Debug.bat

 1 @echo off
 2 pushd "%~dp0"
 3 set msbuild="%windir%\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe" /nologo /p:Configuration=Debug;BuildProjectReferences=false
 4 set pathBin=..\Output\Debug
 5 set path1=..\Src\Folder1
 6 set path2=..\Src\Folder2
 7 set buildlog=%~n0.log
 8 
 9 set /p input="Start msbuild all (Debug) ? [Y/n]: "
10 if "%input%"=="" goto :buildAll
11 if /i "%input%"=="Y" goto :buildAll
12 if /i "%input%"=="Yes" goto :buildAll
13 goto :end
14 
15 :buildAll
16 if exist %buildlog% del %buildlog%
17 call :buildProj %path1% Proj1
18 call :buildProj %path1% Proj2
19 call :buildProj %path2% AnotherProj
20 echo.
21 set /p input="Start Foo.exe? [Y/n]: "
22 if "%input%"=="" goto :runFoo
23 if /i "%input%"=="Y" goto :runFoo
24 if /i "%input%"=="Yes" goto :runFoo
25 goto :end
26 
27 :runFoo
28 call :run %pathBin% Foo.exe
29 goto :end
30 
31 :run
32 cd /d %1
33 start "" %2
34 goto :eof
35 
36 :buildProj
37 set desc=msbuild %2...
38 title %desc%
39 echo %desc%
40 echo ---------------------------------------->>%buildlog%
41 echo %desc%>>%buildlog%
42 echo ---------------------------------------->>%buildlog%
43 %msbuild% %1\%2\%2.csproj >>%buildlog%
44 if ERRORLEVEL 1 echo ERROR!
45 goto :eof
46 
47 :end
48 popd

 

 

Build_Clean.bat

 1 @echo off
 2 pushd "%~dp0"
 3 set msbuild="%windir%\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe" /nologo /t:clean
 4 set sln=..\Src\Slns\Foo.sln
 5 set /p input="Start msbuild clean? [Y/n]: "
 6 if "%input%"=="" goto :clean
 7 if /i "%input%"=="Y" goto :clean
 8 if /i "%input%"=="Yes" goto :clean
 9 goto :end
10 :clean
11 %msbuild% %sln%
12 IF %ERRORLEVEL% NEQ 0 PAUSE
13 :end
14 popd

 

以上是关于Build_Release.bat的主要内容,如果未能解决你的问题,请参考以下文章

VSCode自定义代码片段——CSS选择器

谷歌浏览器调试jsp 引入代码片段,如何调试代码片段中的js

片段和活动之间的核心区别是啥?哪些代码可以写成片段?

VSCode自定义代码片段——.vue文件的模板

VSCode自定义代码片段6——CSS选择器

VSCode自定义代码片段——声明函数