Visual Studio 2010 部署包
我想在 VS2010 Web 应用程序包部署过程中使用此任务来压缩 javascript 文件:
<Target Name="CompressJS">
<ItemGroup>
<_JSFilesToCompress Include="*.js" />
</ItemGroup>
<Message Text="Compresing Javascript files $(_PackageTempDir)" Importance="high" />
<JSCompress Files="@(_JSFilesToCompress)" />
</Target>
我在 OnAfterPipelinePreDeployCopyAllFilesToOneFolder
等位置尝试过,但它不起作用。在 WDP 中我曾经这样:
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
CompressJS;
</BuildDependsOn>
</PropertyGroup>
I want to use this task in the VS2010 Web Application package deployment process to compress the javascript files:
<Target Name="CompressJS">
<ItemGroup>
<_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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不会尝试修改 BuildDependsOn 属性组,而是尝试让您的目标在编译后或删除构建之前触发。查看 c:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets 以了解要覆盖的各种目标。
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.