【发布时间】:2013-07-31 19:48:07
【问题描述】:
我目前必须有两个单独的属性组,它们之间只有两个区别,根据条件设置为具有一个或另一个触发器。这是我所拥有的:
<!--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) 值设置团队构建值? 像
如果 ($(BuildingInsideVisualStudio) == 'true') 设置团队构建 = $True
或
甚至像
set TEAMBUILD = $$(BuildingInsideVisualStudio)?
【问题讨论】:
-
This 或许?
-
嗯...可能。我得调查一下。感谢您的建议。
标签: msbuild cmd tfsbuild post-build-event