ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: A task as a nested element?
Date Tue, 30 Apr 2002 04:09:31 GMT
So, I didn't go that way (yet, anyway) because I wasn't sure how to go
about doing it. I've modified PathConvert.java to have the new
functionality, and it all seems to work, but if I also submit the stuff as
a standalone task (assuming there aren't any objections to it), that'll
mean some replication of code, which is probably better to avoid.

The new functionality allows for string substitution, so you can now do
something like:
  <fileset id="srcfiles" dir="src">
    <include name="**/*.java"/>
  </fileset>
  <target name="pc">
    <pathconvert pathsep="," property="classfiles" refid="srcfiles">
      <map from="${basedir}" to="${outdir}"/>
      <subst from=".java" to=".class"/>
    </pathconvert>
  </target>

As a standalone task, it'd be:
  <subst name="newProp" property="oldProp" from="foo" to="bar"/>
which sets newProp to the value of oldProp, with all occurrences of "foo"
in oldProp replaced with "bar".

What do people think? Do you want the <subst> task as a task itself? And
would you prefer it if I figure out how to make it work (as a task) from
within <pathconvert>, or can you live with the code being in two places
(assuming you want either)? (BTW, FTR: This is mostly more donated code
from Mark McMillan, with some minor modifications by me.)

Thanks,
Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message