问题
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