Jenkins MSbuild multiple files

泄露秘密 提交于 2019-12-25 14:39:10

问题


I want to use Jenkins's MSbuild to build multiple project. Is it possible? Maybe use semicolons to separate projects, like below:


回答1:


That doesn't work that way. But you could add another MSBuild-Step for each project.

If you don't want to repeat the 'Command Line Arguments' every time one solution could be to check the 'Pass build variables as properties' . Then in 'Buildenvironment' you choose 'Inject environment variables to the build process' and add something like BUILD_ARGS="/t:rebuild ..." to 'Properties Content' and add ${BUILD_ARGS} (or %BUILD_ARGS%) to 'Command Line Arguments'

If you want to manage only one job with one build step, you can do this by using a Windows batch-file build-step. For example:

set BUILD_ARGS="/t:rebuild /p:VisualStudioVersion=11"

msbuild projectA.sln %BUILD_ARGS%
msbuild projectB.sln %BUILD_ARGS%

In this case, you usually have to call something like call "C:\<path-to-your-visual-studio-ins>\VC\vcvars.bat" initially, depending on your required build environment.
Also, you may want to handle errors. Therefore you could add for example IF %ERRORLEVEL% NEQ 0 GOTO :eof after each msbuild line.



来源:https://stackoverflow.com/questions/34309260/jenkins-msbuild-multiple-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!