Hiroaki,

Wow, you've put a lot of work into this. I'm actually doing more and more with Velocity myself, so this is intriguing. But doesn't the Velocity project have its own Ant task(s)?

While it would be cool to have this within Ant's own codebase and distribution, I think the general consensus is that this really should be housed with the Velocity project itself, with perhaps a standalone JAR distributed as part of the main Velocity distribution.

I'm very impressed with the attention to detail you've give to your contribution. At the very least add this to Bugzilla, either Ant's or Velocity's area, with all the details as patch and source attachments so that this is not lost.

        Erik



On Monday, January 20, 2003, at 06:19 PM, Hiroaki Nakamura wrote:
Hi.
I made the Jakarta-Velocity task for Ant.
Please take a look and consider to accept it as a new optional task.

The <velocity> task is meant to be a richer version of filter function
of the <copy> task. I have been using the filter function for replacing
parameters in configuration files. But I need more functionality than
just replacing. I think this is where Velocity comes in. This template
engine has directives like #if and #foreach, so it is more powerful.

The <velocity> task has attributes and nested elements similar to the
<copy> task. I thought it would be easy to use. But not all of <copy>
attributes are supported. Please see the velocity.html in the patch.

Here is a example of calling a <velocity> task:

    <velocity todir="c" propertyfile="velocity.properties">
      <velocitycontext>
        <contextdata key="a" value="A1"/>
        <contextdata key="b" value="B1" if="SOME_PROP"/>
        <contextdata key="b" value="B2" unless="SOME_PROP"/>
        <contextdata key="str" classname="my.package.StringTool"/>
      </velocitycontext>
      <fileset dir="a">
        <include name="**/*.vm"/>
      </fileset>
      <mapper type="glob" from="*.vm" to="*.html"/>
    </velocity>

Opinions and suggestions are welcome.


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to