You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Alexander E Genaud <lx...@pobox.com> on 2006/03/16 19:22:35 UTC

Jscompress Javascript compression Task

Hello,

I've written a javascript compression task, combining the Replace task
with some Apache licensed code from

https://dwr.dev.java.net/source/browse/dwr/java/uk/ltd/getahead/dwr/util/JavascriptUtil.java

I would like to submit it to development, though it may not be
Apache-quality code. It is well tested and stable, but is inefficient
with files (reads and writes the same file once or twice, passes the
file as a String through several regex-like loops, and bypasses most
of the elegance in the copied Replace task). Any suggestions?

Example:

<jscompress
            token="optionalold" value="optionalnew"
            file="${dir.target.distversion}/framework.js"
            stripslashslash="yes"
            stripslashstar="yes"
            trimlines="yes"
            stripblanklines="yes"
            shrinkvariables="no"
            stripnewlines="no"
            echo="no" />



--
Alex
--
Those who can make you believe absurdities can make you commit atrocities
-- François Marie Arouet (Voltaire)
http://cph.blogsome.com
http://genaud.org/alex/key.asc
--
CCC7 D19D D107 F079 2F3D BF97 8443 DB5A 6DB8 9CE1

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Jscompress Javascript compression Task

Posted by Dominique Devienne <dd...@gmail.com>.
> I would like to submit it to development, though it may not be
> Apache-quality code. It is well tested and stable, but is inefficient
> with files (reads and writes the same file once or twice, passes the
> file as a String through several regex-like loops, and bypasses most
> of the elegance in the copied Replace task). Any suggestions?

The Ant team seldom accepts such tasks anymore, not because they are
not of sufficient quality, but because they are not general purpose
enough, and also mostly because the maintenance of these tasks becomes
a burden to the team, especially when the original submitter
disappears from the Ant lists. The unwritten (that I know of) policy
has been going on for several months, and has been discussed before.
Ant has many such non-general purpose task, but they are "legacy" ;-)

What I suggest would be to package your task as an AntLib, available
from java.net or SourceForge or such publicly available URL, write a
Wiki entry about it, and finally submit a patch (cvs diff -u) to the
External Tasks page of the documentation. This way you get some
exposure to the Ant community for your task. Thanks, --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org