【发布时间】:2010-06-16 10:43:47
【问题描述】:
我正在尝试根据另一个 PropertyGroup 的值设置一个 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>
后来我有了这个目标
<Target Name="AfterEndToEndIteration" Condition="'$(DeploymentServer)'!=''">
</Target>
此目标未执行,因为 $(DeploymentServer 评估为 ''。但是,如果我无条件设置属性:
<PropertyGroup>
<DeploymentServer>SCHVMOMNET3</DeploymentServer>
</PropertyGroup>
它起作用了——目标被执行。
$(BuildDefinitionName) 属性没问题,因为我在其他地方使用它作为 .testconfig 文件的名称。
如何让我的目标根据条件定义的属性执行?
【问题讨论】: