我目前必须有两个独立的属性组,只有两个不同的属性组,它们之间根据条件被设置为具有一个或另一个触发器。下面是我有:MSBuild中的属性组内部是否存在“if”类型语句?
<!--CAME FROM TEAMBUILD-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' != 'Debug|AnyCPU' AND '$(Configuration)|$(Platform)' != 'Release|AnyCPU' AND '$(BuildingInsideVisualStudio)' != 'true' ">
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
set MAGE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\mage.exe"
set APPFILE=$(TargetDir)$(TargetName).application
set MANIFEST=$(TargetPath).manifest
set CERT=$(ProjectDir)$(TargetName).pfx
set PROJECTNAME=$(TargetName)
set CONFIGURATION=$(ConfigurationName)
set TARGETDIR=$(TargetDir)
set TEAMBUILD=$True
Powershell -File "$(ProjectDir)POSTBUILD.ps1"
</PostBuildEvent>
</PropertyGroup>
<!--CAME FROM PUBLISH COMMAND-->
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' != 'Debug|AnyCPU' AND '$(Configuration)|$(Platform)' != 'Release|AnyCPU' AND '$(BuildingInsideVisualStudio)' == 'true' ">
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
set MAGE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\mage.exe"
set APPFILE=$(TargetDir)$(TargetName).application
set MANIFEST=$(TargetPath).manifest
set CERT=$(ProjectDir)$(TargetName).pfx
set PROJECTNAME=$(TargetName)
set CONFIGURATION=$(ConfigurationName)
set TARGETDIR=$(TargetDir)
set TEAMBUILD=$False
Powershell -File "$(ProjectDir)POSTBUILD.ps1"
</PostBuildEvent>
</PropertyGroup>
有没有一种方法来设置基础上,后生成事件里面的$(BuildingInsideVisualStudio)值teambuild价值? 喜欢的东西
如果($(BuildingInsideVisualStudio)== '真') 集TEAMBUILD = $真
或 甚至像 set TEAMBUILD = $$(BuildingInsideVisualStudio)
?
[This](http://msdn.microsoft.com/en-us/library/ms164307.aspx)或许? –
嗯......可能。我得看看它。感谢您的建议。 –