I have some problems replacing TeamCity MSBuild, I think.
I tried to compile a Delphi 2010 project (compatible with MSBuild) with NAnt using the MSBuild (NAnt Contrib) task.
Everything works fine if I do it without TeamCity on the console.
If I try with TeamCity, I get the following error message:
Failed to detect default target(s) in the project file F:\CI\TeamCity\TeamCity\buildAgent\work\892195dab42324a3\build\src.temp\TestProject\Test.dproj. Please define targets explicitly in the build configuration options on TeamCity Web UI. Project does not define DefaultTargets or InitialTargets.
I tried to explicitly set the target using the MSBuild / target switch pointing to the Rebuild target. So far no luck.
Any suggestions? Thanks in advance.
Edit:
<foreach item="File" property="iterator.dproj"> <in> <items> <include name="${src.temp}\**\*.dproj" /> </items> </in> <do> <msbuild project="${iterator.dproj}"> <arg value="/target:Rebuild" /> </msbuild> </do> </foreach>
The * .dproj file is a standard delphi 2010 project file (it is converted using xsl, but it is still a valid project file)
Edit2:
Thanks. ermakovich, I replaced the msbuild task (from NAnt contrib) with a direct call to NAnt, which does not cause an error on the TeamCity server. TeamCity seems to replace the NAnt contrib msbuild task call. :-)
<property name="msbuild.exe" value="${framework::get-framework-directory(nant.settings.currentframework)}\msbuild.exe" /> <foreach item="File" property="iterator.dproj"> <in> <items> <include name="${src.temp}\**\*.dproj" /> </items> </in> <do> <exec program="${msbuild.exe}"> <arg path="${iterator.dproj}" /> </exec> </do> </foreach>
continuous-integration msbuild nant teamcity
Dennis
source share