我有一个名为MySolution.sln的VS2008解决方案文件,其中包含三个项目ProjectName1,ProjectName2,ProjectName3和ProjectName4。我正在使用jenkins构建解决方案(仅构建ProjectName1 / 2/3而不是ProjectName4)。以下是提供给詹金斯的批次。
问题是,只要我们说,语句“%VSDIR%\ devenv.com”“MySolution.sln”/ Build“Release | x64”/ Project ProjectName1无法构建特定项目我的%errorlevel%未更新为非负整数(> 0)。无论通过/失败,%errorlevel%始终为“0”
詹金斯称之为
cmd /c call C:\Users\John\AppData\Local\Temp\hudson343434346343.bat
有关于此的任何想法吗?
批处理脚本:
@ECHO OFF
set VSDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE
"%VSDIR%\devenv.com" "MySolution.sln" /Clean "Release|x64"
"%VSDIR%\devenv.com" "MySolution.sln" /Build "Release|x64" /Project ProjectName1
IF %ERRORLEVEL% EQU 0 (
"%VSDIR%\devenv.com" "MySolution.sln" /Build "Release|x64" /Project ProjectName2
IF %ERRORLEVEL% EQU 0 (
"%VSDIR%\devenv.com" "MySolution.sln" /Build "Release|x64" /Project ProjectName3
IF %ERRORLEVEL% EQU 0 (
) ELSE (
echo "Failed to build ProjectName3"
)
) ELSE (
echo "Failed to build ProjectName2"
)
) ELSE (
echo "Failed to build ProjectName1"
)
unset VSDIR
答案 0 :(得分:0)
只需使用MSBuild插件即可。你们都准备好了。