You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by eo...@mind.net on 2002/03/04 18:00:39 UTC

Re: Fwd: Re: Patternsets, Filesets, and Mapper

Diane,

Sorry about the delay, got pulled into another project last week.

Taking a close look at this, it seems that you are saving the class lists to a file... 
Wouldn't this have the similar problem to the includesfile thing mentioned earlier?  IE: I
have 7 files running in parallel, all doing this for 3 sets of files....  That is a lot of
files, disk i/o, and have to have 21 different files.....

My patches do what I wanted to do.  I am fine moving those into a different class or
whatever.... but it does not seem like Ant can currently handle it without my patch
without using 21 extra files....

Anyone have a solution that does not need all the extra files?

Thanks,
Malachi

> <project name="malachi" default="genLists">
> 
>   <fileset dir="src" id="srcfiles">
>     <include name="com/mycompany/util/class1.java"/>
>     <include name="com/mycompany/io/class2.java"/>
>   </fileset>
> 
>   <target name="genLists" depends="setClassList,setPkgList">
>     <echo message="classfiles = ${classfiles}"/>
>     <echo message="pkglist = ${pkglist}"/>
>   </target>
> 
>   <target name="setClassList">
>     <delete file="classes.properties"/>
>     <pathconvert pathsep="," property="classes" refid="srcfiles">
>       <map from="${basedir}${file.separator}src"
>            to="${basedir}${file.separator}build${file.separator}classes"/>
>     </pathconvert>
>     <propertyfile file="classes.properties">
>       <entry key="classfiles" value="${classes}"/>
>     </propertyfile>
>     <replace file="classes.properties">
>       <replacefilter token=".java" value=".class"/>
>     </replace>
>     <property file="classes.properties"/>
>   </target>
> 
>   <target name="setPkgList">
>     <delete file="pkgs.properties"/>
>     <pathconvert pathsep="," dirsep="." property="pkgs" refid="srcfiles">
>       <map from="${basedir}" to=""/>
>     </pathconvert>
>     <propertyfile file="pkgs.properties">
>       <entry key="pkglist" value="${pkgs}"/>
>     </propertyfile>
>     <replace file="pkgs.properties">
>       <replacefilter token=".src." value=""/>
>     </replace>
>     <replaceregexp file="pkgs.properties"
>                    match="\.java"
>                    replace=""
>                    flags="g"
>                    byline="true"/>
>     <property file="pkgs.properties"/>
>   </target>
> 
> </project>
> 
> Diane



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


Re: Fwd: Re: Patternsets, Filesets, and Mapper

Posted by Diane Holt <ho...@yahoo.com>.
--- eoti@mind.net wrote:
> Taking a close look at this, it seems that you are saving the class
> lists to a file...

Well, you could do it inside a <script> task instead. (Or write a separate
task.)

> Wouldn't this have the similar problem to the includesfile thing
> mentioned earlier?  IE: I have 7 files running in parallel, all doing
> this for 3 sets of files....  That is a lot of
> files, disk i/o, and have to have 21 different files.....

I didn't know you were setting up your build this way -- I just figured
you'd have everything in a main build file. Is there some reason you're
not?  I used generic names like "classfiles" because I have no idea what
your actual names would be, but I assumed you'd just adopt things to your
needs, supplying the various filesets, along with meaningful id names,
property names, etc.

> My patches do what I wanted to do.  I am fine moving those into a
> different class or whatever.... but it does not seem like Ant can
> currently handle it without my patch without using 21 extra files....

There's nothing in Ant that's making you use 21 files. You can write
everything out to the same file, just use distinctive names for the
fileset ids and properties. Or don't write a file at all, and just use
<script> or a separate task to do the string manipulations.

But hey, if you'd prefer using your modified version of Ant instead, go
for it. (I used an in-house version for a long time, until things finally
caught up to where I could pitch mine. But it does make upgrading a little
dicey.)

> Anyone have a solution that does not need all the extra files?

Yeah -- don't have seven different build files, and if you don't want to
write things out to a file, use <script> (or a separate task) to do the
string diddling. (I did a sample script that does that awhile back, so I
can play with that to do your stuff -- but only if you're seriously
interested in finding a way to do this with standard Ant.)

Diane

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



__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com

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