2010-02-22 5 views
9

mspec을 teamcity와 통합 할 수 있도록 추가 빌드 단계를 추가했습니다. 그러나 빌드 할 시간이 길어 지므로 IDE에서 빌드 할 때 이것을 실행하고 싶지 않습니다. IDE에서 빌드하고이 특정 대상을 실행하지 않는지 여부를 감지 할 수 있습니까? 이것은 내가 지금까지 가지고있는 것이다.VS IDE에서 건물을 감지 할 수 있습니까?

<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" /> 

쉬운 해결책은 다른 빌드 구성을 추가하는 것입니다.하지만 그렇게하지 않는 것이 좋습니다.

출력 창에 덤프되는 TeamCity 출력도 일종의 성가신 일입니다. :)

+0

일시적으로이 빌드의 릴리스 버전에서만 실행 중이지만 여전히 IDE에서 빌드가 완료되었는지 여부를 감지 할 수 있는지 여부에 관심이 있습니다. – Dave

답변

9

BuildingInsideVisualStudio을 확인할 수 있습니다.

<Target Name="RunSpecs" Condition=" '$(BuildingInsideVisualStudio)'!='true' "> 
    <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> 

통지 대상에 조건 :

그래서 귀하의 경우에는 다음과 같이 할 수 있습니다. 참고로, 일반적으로 일반적으로 advise against putting condition on targets이지만이 방법을 사용하는 것이 좋습니다.

+0

대단히 감사합니다! – Dave

관련 문제