Created
August 6, 2018 04:15
-
-
Save hsinjungwu/80f69e9ff8e7bed94b3616ae7d9f9f05 to your computer and use it in GitHub Desktop.
Batch Build C# Solutions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@title 自動建置專案 | |
REM MsBuildPath:MSBuild的位置 | |
SET MsBuildPath=c:\progra~2\MSBuild\14.0\Bin\ | |
REM Sln:sln檔案的位置 | |
SET Sln[0]=D:\a.sln | |
SET Sln[1]=D:\b.sln | |
SET Sln[2]=D:\folder1\1.sln | |
REM Sln 長度 | |
SET LEN=3 | |
REM 開始建置檔案 | |
SET IDX=0 | |
:LoopStart | |
IF %IDX% EQU %LEN% GOTO :EOF | |
SET Sln_Current=0 | |
FOR /F "usebackq delims==~ tokens=1-2" %%I IN (`SET Sln[%IDX%]`) DO ( | |
SET Sln_Current=%%J | |
) | |
%MsBuildPath%MSBuild.exe %Sln_Current% /nologo /t:Rebuild /p:Configuration=DEBUG /v:q /clp:ErrorsOnly | |
IF errorlevel 1 ( | |
ECHO %Sln_Current%自動建置執行有誤; | |
PAUSE | |
) | |
ECHO. | |
SET /A IDX= %IDX% + 1 | |
GOTO LoopStart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment