我目前必須有兩個獨立的屬性組,只有兩個不同的屬性組,它們之間根據條件被設置爲具有一個或另一個觸發器。下面是我有: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)或許? –
嗯......可能。我得看看它。感謝您的建議。 –