Microsoft Ajax Minifier - TFS 2010 工作流程 - TFS 构建中的 AjaxMin
http://ajaxmin.codeplex.com/ 上的 AjaxMin 项目很棒而且非常有用。
我之前使用的是 AjaxMin 的代码选项,我会手动扫描目录中的所有 JS 和 CSS 文件,并缩小内容,然后用缩小的内容重写原始文件。
此代码将在自定义“BuildConfigurator”中运行,该自定义“BuildConfigurator”的创建目的只是为了在构建上运行,以便为部署做好准备。
此后我们决定放弃 BuildConfigurator 并使用 TFS2010 来完成所有构建。我已经开始使用 TFS 构建工作流程,现在需要缩小所有 JS/CSS 文件(相同的文件名)。
如何在 TFS 构建工作流程中执行此操作?应该是可行的吧?
我在 http://ajaxmin.codeplex.com/ 上看到了有关如何将其添加到项目定义中的文档wikipage?title=AjaxMinTask 但这似乎是在项目级别。我希望能够对整个解决方案/构建执行此操作,其中缩小只能通过 TFS 构建完成,而不是在任何开发计算机上进行本地构建。
任何帮助将不胜感激。谢谢。
The AjaxMin project at http://ajaxmin.codeplex.com/ is great and very useful.
What I have previously used is the code option of AjaxMin where I would manually scan a directory for all JS and CSS files, and minify the contents, then rewrite the original file with the minified content.
This code would be run in a custom "BuildConfigurator" that was created just for the purpose of running on builds to get them ready for deployment.
We have since made the decision to get rid of BuildConfigurator and use TFS2010 to do all the builds. I have started using the TFS Build Workflows and I need to now minify all my JS/CSS files (same filename).
How can I do this in the TFS Build Workflow? It should be doable, right?
I saw documentation on how to add it to the project definition at http://ajaxmin.codeplex.com/wikipage?title=AjaxMinTask but that seems to be at the project level. I want to be able to do it for the whole solution/build, where the minifying would only be done with a TFS Build, as opposed to a local build on any devs machine.
Any help would be greatly appreciated. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您只需在项目文件中编写任务,就像在没有 TFS 的本地计算机中使用一样,请参阅以下链接,
为什么 Microsoft Ajax Minifier 不使用 Team build 生成迷你文件2010?
我还在 web 包中创建了 minify 文件。
之后在 TFS 服务器上安装 AjaxMin.exe,所以现在当 TFS 开始调用 MS Build 活动来构建应用程序时,默认情况下它将缩小文件,只需注意本地和服务器之间的文件路径,以便它可以工作本地路径和服务器路径(TFS)
You just need to write the task in the project file as it use in the local machine without TFS, see the following link,
Why Microsoft Ajax Minifier doesn't generate mini file with Team build 2010?
I also create the minify file inside the web package.
After that install AjaxMin.exe on the TFS server, so now when the TFS start invoke the MS Build activity to build the application by default it will Minify the files, just be careful of the file path between local and server so it can work on both local path and server path(TFS)
我最终创建了一个名为 AjaxMinify 的自定义构建活动代码,该代码将目录路径作为输入(在构建工作流程中设置),然后缩小目录/子目录中的所有文件。我刚刚在活动的代码项目中引用了 AjaxMin.dll。然后只需在您想要的构建工作流程中添加 AjaxMinify 活动即可开始工作!谢谢你的回答。
I ended up creating a custom build activity code that i called AjaxMinify that took in a directory path as input (set in the build workflow), and it then minified all files in the directory/sub-directories. I just referenced the AjaxMin.dll in the code project for the activity. Then just add the AjaxMinify activity in the build workflows that you want and presto it works! Thanks for the answers tho.