I've added an additional after build step so that I can integrate mspec with teamcity. However I do not want to run this when I'm building in the IDE as it lengthens the time to build. Is there someway I can detect whether I'm building from the IDE and not execute this specific target? This is what I have so far.
<Target Name="RunSpecs">
<PropertyGroup>
<AdditionalSettings>--teamcity</AdditionalSettings>
<MSpecCommand>..\Lib\mspec\mspec.exe $(AdditionalSettings) "$(TargetDir)$(AssemblyName).dll"</MSpecCommand>
</PropertyGroup>
<Message Importance="high" Text="Running Specs with this command: $(MSpecCommand)" />
<Exec Command="$(MSpecCommand)" IgnoreExitCode="true" />
</Target>
<Target Name="AfterBuild" DependsOnTargets="RunSpecs" />
The easy solution is to add another build configuration but I'd prefer not to do that.
Also the TeamCity output being dumped to the output window is sort of annoying. :)