.netmsbuildmicrosoft-ajax-minifierajaxmin

Microsoft Ajax Minifier - TFS 2010 Workflow - AjaxMin in the TFS Build


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.


Solution

  • 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.