You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Ch...@findexa.no on 2002/01/04 17:55:54 UTC

Task for whitespace optimizing

I've written a custom task for optimizing whitespace in text files.

It operates on a filset and replaces each file with a whitespace optimized
version of itself. 

Usage is typically something like this:

<ws-optimize>
  <fileset dir="${deploy}/webapp">
    <include name="**/*.jsp"/>
    <include name="**/*.js"/>
    <include name="**/*.css"/>
    <include name="**/*.html"/>
    <include name="**/*.htm"/>
  </fileset>
</ws-optimize>

If you use this after moving the files out of the version control repository
web-developers can keep their bloated WYSIWYG files unchanged. The files
that are deployed are typically reduced by 1/3 or 1/4 in size.

I was wondering if this could be a canditate for a built-in or optional Ant
task?


Christian Nedregaard
Senior developer
Findexa as




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Task for whitespace optimizing

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 4 Jan 2002, Erik Hatcher <ja...@ehatchersolutions.com>
wrote:

> Is there an equivalent task out there with this functionality
> already?

I'm not sure what "white space optimized" concretely means, but it
seems that fixcrlf (maybe doing two passes) is close to it.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Task for whitespace optimizing

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
I'm +1 for adding this (caveats below), although +0 on whether its builtin
or optional.  Since there is no difference functionally between the two at
the moment we should probably lean towards putting things in optional just
to keep the current "core" tasks as small as possible.

Is there an equivalent task out there with this functionality already?

Christian - if you provide us with the code (with the Apache license and
following the coding standards) along with some unit tests then we can all
have a clearer picture of it.  I would think such a task to be generally
useful would need some parameters to affect how the whitespace gets removed
(trim leading and trailing?  compress internally?  tabs to spaces?)

    Erik


----- Original Message -----
From: <Ch...@findexa.no>
To: <an...@jakarta.apache.org>
Sent: Friday, January 04, 2002 11:55 AM
Subject: Task for whitespace optimizing


>
> I've written a custom task for optimizing whitespace in text files.
>
> It operates on a filset and replaces each file with a whitespace optimized
> version of itself.
>
> Usage is typically something like this:
>
> <ws-optimize>
>   <fileset dir="${deploy}/webapp">
>     <include name="**/*.jsp"/>
>     <include name="**/*.js"/>
>     <include name="**/*.css"/>
>     <include name="**/*.html"/>
>     <include name="**/*.htm"/>
>   </fileset>
> </ws-optimize>
>
> If you use this after moving the files out of the version control
repository
> web-developers can keep their bloated WYSIWYG files unchanged. The files
> that are deployed are typically reduced by 1/3 or 1/4 in size.
>
> I was wondering if this could be a canditate for a built-in or optional
Ant
> task?
>
>
> Christian Nedregaard
> Senior developer
> Findexa as
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>