I am trying to set a PropertyGroup depending on the value of another PropertyGroup:
<PropertyGroup Condition="'$(BuildDefinitionName)'=='Dev1'">
<DeploymentServer>DEVSERVER</DeploymentServer>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildDefinitionName)'=='Main'">
<DeploymentServer>MAINSERVER</DeploymentServer>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildDefinitionName)'=='Release'">
<DeploymentServer>RELEASESERVER</DeploymentServer>
</PropertyGroup>
Later on I have this target
<Target Name="AfterEndToEndIteration" Condition="'$(DeploymentServer)'!=''">
</Target>
This target is not being executed because $(DeploymentServer evaluates to ''. However, if I set the property unconditionally:
<PropertyGroup>
<DeploymentServer>SCHVMOMNET3</DeploymentServer>
</PropertyGroup>
it works--the target gets executed.
The $(BuildDefinitionName) property is OK because I use it elsewhere as the name of a .testconfig file.
How do I get my target to execute based on a conditionally defined property?