|
Project Information
Members
Featured
Downloads
Links
|
JSMin Ant TaskA custom task for Apache Ant which acts as an interface to the JSMin program. About JSMin"JSMin is a filter which removes comments and unnecessary whitespace from javascript files. It typically reduces filesize by half, resulting in faster downloads. It also encourages a more expressive programming style because it eliminates the download cost of clean, literate self-documentation." Excerpt from Douglas Crockford's JSMin page DescriptionThe JSMin Ant task acts as an interface to the JSMin Java class. The task can be used for the automated minification of javascript files in your build and deploy processes.
Parameters
ExamplesDefine the task in your build file: <taskdef name="jsmin"
classname="net.matthaynes.jsmin.JSMin_Task"
classpath="/path/to/jsmin.jar"/>Using the task on a single file, with the .min suffix added to the file extension: <jsmin srcfile="file.js" suffix="true" /> Using the task with a fileset, and an output directory specified: <jsmin destdir="./outputdirectory">
<fileset dir="./somejsdirectory/" includes="**/*.js"/>
</jsmin>Prepending a copyright notice to the minified file: <jsmin srcfile="file.js" copyright="(c) 2008 whoever.com" /> Will add the following to the top of the file: /* (c) 2008 whoever.com */ SupportIf you have any issues then please let us know, I will see what I can do. I would also be very interested to hear what platforms and Ant versions people are using as I have not had time to extensivley test this task. Project Stats
|