【发布时间】:2016-06-07 06:30:13
【问题描述】:
我无法让 MSBuild Sonar Runner 在 powershell 脚本中工作。示例脚本如下所示,遵循从同一目录执行所有步骤的文档化过程。
$sonarRunnerPath = "C:\Users\glenn\MSBuild.SonarQube.Runner-2.0\MSBuild.SonarQube.Runner.exe"
$msbuildPath = "$env:WINDIR\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe"
Push-Location $slnDir
& $sonarRunnerPath begin /k:proj:alpha "/n:Project Alpha" /v:1.0.0.%BUILD_NUMBER% /d:sonar.host.url=http://sonar.local
& $msbuildPath /nologo /t:Build /nologo /v:n /clp:ErrorsOnly /m /p:Configuration=Release
& $sonarRunnerPath end
但是在构建(第二步)之后我注意到 $slnDir/.sonarqube/out 目录是空的,然后在运行结束命令后我收到标准错误消息:
No ProjectInfo.xml files were found. Possible causes:
关于为什么在 powershell 中运行 msbuild 会阻止 msbuild 生成 ProjectInfo.xml 输出文件的任何想法?
【问题讨论】:
-
%BUILD_NUMBER%是环境变量吗?你应该使用$env:BUILD_NUMBER。如果可以的话,您应该考虑使用相对应的完整路径。
标签: powershell msbuild sonarqube