I want to use this task in the VS2010 Web Application package deployment process to compress the javascript files:
<Target Name="CompressJS">
<ItemGro开发者_如何学运维up>
<_JSFilesToCompress Include="*.js" />
</ItemGroup>
<Message Text="Compresing Javascript files $(_PackageTempDir)" Importance="high" />
<JSCompress Files="@(_JSFilesToCompress)" />
</Target>
I tried in some locations like OnAfterPipelinePreDeployCopyAllFilesToOneFolder
, but it won't work. In WDP I used to have it like:
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
CompressJS;
</BuildDependsOn>
</PropertyGroup>
Instead of trying to modify the BuildDependsOn property group, I'd try to get your target to fire after compile or before drop build. Check out c:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets for various targets to override.
<PropertyGroup>
<AfterCompileSolutionDependsOn>
CompressJS;
</AfterCompileSolutionDependsOn>
</PropertyGroup>
<Target Name="AfterCompileSolution" DependsOnTargets="$(AfterCompileSolutionDependsOn)">
</Target>
精彩评论